aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/item_tree.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_def/src/item_tree.rs')
-rw-r--r--crates/ra_hir_def/src/item_tree.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_hir_def/src/item_tree.rs b/crates/ra_hir_def/src/item_tree.rs
index da79d8ffd..615c1e14c 100644
--- a/crates/ra_hir_def/src/item_tree.rs
+++ b/crates/ra_hir_def/src/item_tree.rs
@@ -70,7 +70,7 @@ impl GenericParamsId {
70pub struct ItemTree { 70pub struct ItemTree {
71 top_level: SmallVec<[ModItem; 1]>, 71 top_level: SmallVec<[ModItem; 1]>,
72 attrs: FxHashMap<AttrOwner, Attrs>, 72 attrs: FxHashMap<AttrOwner, Attrs>,
73 inner_items: FxHashMap<FileAstId<ast::ModuleItem>, SmallVec<[ModItem; 1]>>, 73 inner_items: FxHashMap<FileAstId<ast::Item>, SmallVec<[ModItem; 1]>>,
74 74
75 data: Option<Box<ItemTreeData>>, 75 data: Option<Box<ItemTreeData>>,
76} 76}
@@ -187,7 +187,7 @@ impl ItemTree {
187 /// 187 ///
188 /// Most AST items are lowered to a single `ModItem`, but some (eg. `use` items) may be lowered 188 /// Most AST items are lowered to a single `ModItem`, but some (eg. `use` items) may be lowered
189 /// to multiple items in the `ItemTree`. 189 /// to multiple items in the `ItemTree`.
190 pub fn inner_items(&self, ast: FileAstId<ast::ModuleItem>) -> &[ModItem] { 190 pub fn inner_items(&self, ast: FileAstId<ast::Item>) -> &[ModItem] {
191 &self.inner_items[&ast] 191 &self.inner_items[&ast]
192 } 192 }
193 193
@@ -310,7 +310,7 @@ from_attrs!(ModItem(ModItem), Variant(Idx<Variant>), Field(Idx<Field>));
310 310
311/// Trait implemented by all item nodes in the item tree. 311/// Trait implemented by all item nodes in the item tree.
312pub trait ItemTreeNode: Clone { 312pub trait ItemTreeNode: Clone {
313 type Source: AstNode + Into<ast::ModuleItem>; 313 type Source: AstNode + Into<ast::Item>;
314 314
315 fn ast_id(&self) -> FileAstId<Self::Source>; 315 fn ast_id(&self) -> FileAstId<Self::Source>;
316 316