diff options
Diffstat (limited to 'crates/ra_hir')
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 4fb679f6d..73158b8bd 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs | |||
@@ -123,7 +123,7 @@ impl_froms!( | |||
123 | ); | 123 | ); |
124 | 124 | ||
125 | pub use hir_def::{ | 125 | pub use hir_def::{ |
126 | attr::Attrs, item_scope::ItemInNs, visibility::Visibility, AssocItemId, AssocItemLoc, | 126 | attr::Attrs, item_scope::ItemInNs, visibility::Visibility, AssocContainerId, AssocItemId, |
127 | }; | 127 | }; |
128 | use rustc_hash::FxHashSet; | 128 | use rustc_hash::FxHashSet; |
129 | 129 | ||
@@ -696,16 +696,12 @@ impl AssocItem { | |||
696 | AssocItem::TypeAlias(t) => t.module(db), | 696 | AssocItem::TypeAlias(t) => t.module(db), |
697 | } | 697 | } |
698 | } | 698 | } |
699 | pub fn container(self, db: &impl DefDatabase) -> AssocItemContainer { | 699 | |
700 | let container = match self { | 700 | pub fn container(self, db: &impl DefDatabase) -> AssocContainerId { |
701 | AssocItem::Function(it) => it.id.lookup(db).container, | 701 | match self { |
702 | AssocItem::Const(it) => it.id.lookup(db).container, | 702 | AssocItem::Function(f) => f.id.lookup(db).container, |
703 | AssocItem::TypeAlias(it) => it.id.lookup(db).container, | 703 | AssocItem::Const(c) => c.id.lookup(db).container, |
704 | }; | 704 | AssocItem::TypeAlias(t) => t.id.lookup(db).container, |
705 | match container { | ||
706 | AssocContainerId::TraitId(id) => AssocItemContainer::Trait(id.into()), | ||
707 | AssocContainerId::ImplId(id) => AssocItemContainer::ImplBlock(id.into()), | ||
708 | AssocContainerId::ContainerId(_) => panic!("invalid AssocItem"), | ||
709 | } | 705 | } |
710 | } | 706 | } |
711 | } | 707 | } |