aboutsummaryrefslogtreecommitdiff
path: root/crates/hir
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir')
-rw-r--r--crates/hir/src/code_model.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs
index 0b24f247c..231ec0004 100644
--- a/crates/hir/src/code_model.rs
+++ b/crates/hir/src/code_model.rs
@@ -779,6 +779,7 @@ impl Function {
779 db.function_data(self.id).has_body 779 db.function_data(self.id).has_body
780 } 780 }
781 781
782 /// If this function is a method, the trait or type where it is declared.
782 pub fn method_owner(self, db: &dyn HirDatabase) -> Option<MethodOwner> { 783 pub fn method_owner(self, db: &dyn HirDatabase) -> Option<MethodOwner> {
783 match self.as_assoc_item(db).map(|assoc| assoc.container(db)) { 784 match self.as_assoc_item(db).map(|assoc| assoc.container(db)) {
784 Some(AssocItemContainer::Trait(t)) => Some(t.into()), 785 Some(AssocItemContainer::Trait(t)) => Some(t.into()),