diff options
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 73158b8bd..140b3a87f 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs | |||
@@ -548,6 +548,10 @@ impl Function { | |||
548 | let mut validator = ExprValidator::new(self.id, infer, sink); | 548 | let mut validator = ExprValidator::new(self.id, infer, sink); |
549 | validator.validate_body(db); | 549 | validator.validate_body(db); |
550 | } | 550 | } |
551 | |||
552 | pub fn container(self, db: &impl DefDatabase) -> AssocContainerId { | ||
553 | self.id.lookup(db).container | ||
554 | } | ||
551 | } | 555 | } |
552 | 556 | ||
553 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | 557 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] |
@@ -699,7 +703,7 @@ impl AssocItem { | |||
699 | 703 | ||
700 | pub fn container(self, db: &impl DefDatabase) -> AssocContainerId { | 704 | pub fn container(self, db: &impl DefDatabase) -> AssocContainerId { |
701 | match self { | 705 | match self { |
702 | AssocItem::Function(f) => f.id.lookup(db).container, | 706 | AssocItem::Function(f) => f.container(db), |
703 | AssocItem::Const(c) => c.id.lookup(db).container, | 707 | AssocItem::Const(c) => c.id.lookup(db).container, |
704 | AssocItem::TypeAlias(t) => t.id.lookup(db).container, | 708 | AssocItem::TypeAlias(t) => t.id.lookup(db).container, |
705 | } | 709 | } |