diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs index e783e0abab..a8b67da203 100644 --- a/crates/hir/src/code_model.rs +++ b/crates/hir/src/code_model.rs @@ -743,6 +743,10 @@ impl Function { db.function_data(self.id).name.clone() } + /// Get this function's return type + /// + /// The returned type can be converted to a [`Type`] via its `ty` + /// method. pub fn ret_type(self, db: &dyn HirDatabase) -> RetType { let resolver = self.id.resolver(db.upcast()); let ret_type = &db.function_data(self.id).ret_type;