mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-04 19:29:07 +00:00
Document hir::Function::ret_type
This adds documentation for the newly added function. It might be a bit too detailed, but I like it that way :)
This commit is contained in:
parent
a6dc7cf36d
commit
2f0969b873
@ -743,6 +743,10 @@ impl Function {
|
|||||||
db.function_data(self.id).name.clone()
|
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 {
|
pub fn ret_type(self, db: &dyn HirDatabase) -> RetType {
|
||||||
let resolver = self.id.resolver(db.upcast());
|
let resolver = self.id.resolver(db.upcast());
|
||||||
let ret_type = &db.function_data(self.id).ret_type;
|
let ret_type = &db.function_data(self.id).ret_type;
|
||||||
|
Loading…
Reference in New Issue
Block a user