diff options
Diffstat (limited to 'crates/ra_hir_def/src/item_tree')
-rw-r--r-- | crates/ra_hir_def/src/item_tree/lower.rs | 6 | ||||
-rw-r--r-- | crates/ra_hir_def/src/item_tree/tests.rs | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_hir_def/src/item_tree/lower.rs b/crates/ra_hir_def/src/item_tree/lower.rs index 6c58c6378..8a36de311 100644 --- a/crates/ra_hir_def/src/item_tree/lower.rs +++ b/crates/ra_hir_def/src/item_tree/lower.rs | |||
@@ -95,7 +95,7 @@ impl Ctx { | |||
95 | ast::Item::TraitDef(_) | ast::Item::ImplDef(_) | ast::Item::ExternBlock(_) => {} | 95 | ast::Item::TraitDef(_) | ast::Item::ImplDef(_) | ast::Item::ExternBlock(_) => {} |
96 | 96 | ||
97 | // These don't have inner items. | 97 | // These don't have inner items. |
98 | ast::Item::Module(_) | ast::Item::ExternCrateItem(_) | ast::Item::UseItem(_) => {} | 98 | ast::Item::Module(_) | ast::Item::ExternCrate(_) | ast::Item::UseItem(_) => {} |
99 | }; | 99 | }; |
100 | 100 | ||
101 | let attrs = Attrs::new(item, &self.hygiene); | 101 | let attrs = Attrs::new(item, &self.hygiene); |
@@ -113,7 +113,7 @@ impl Ctx { | |||
113 | ast::Item::UseItem(ast) => Some(ModItems( | 113 | ast::Item::UseItem(ast) => Some(ModItems( |
114 | self.lower_use(ast).into_iter().map(Into::into).collect::<SmallVec<_>>(), | 114 | self.lower_use(ast).into_iter().map(Into::into).collect::<SmallVec<_>>(), |
115 | )), | 115 | )), |
116 | ast::Item::ExternCrateItem(ast) => self.lower_extern_crate(ast).map(Into::into), | 116 | ast::Item::ExternCrate(ast) => self.lower_extern_crate(ast).map(Into::into), |
117 | ast::Item::MacroCall(ast) => self.lower_macro_call(ast).map(Into::into), | 117 | ast::Item::MacroCall(ast) => self.lower_macro_call(ast).map(Into::into), |
118 | ast::Item::ExternBlock(ast) => { | 118 | ast::Item::ExternBlock(ast) => { |
119 | Some(ModItems(self.lower_extern_block(ast).into_iter().collect::<SmallVec<_>>())) | 119 | Some(ModItems(self.lower_extern_block(ast).into_iter().collect::<SmallVec<_>>())) |
@@ -498,7 +498,7 @@ impl Ctx { | |||
498 | 498 | ||
499 | fn lower_extern_crate( | 499 | fn lower_extern_crate( |
500 | &mut self, | 500 | &mut self, |
501 | extern_crate: &ast::ExternCrateItem, | 501 | extern_crate: &ast::ExternCrate, |
502 | ) -> Option<FileItemTreeId<ExternCrate>> { | 502 | ) -> Option<FileItemTreeId<ExternCrate>> { |
503 | let path = ModPath::from_name_ref(&extern_crate.name_ref()?); | 503 | let path = ModPath::from_name_ref(&extern_crate.name_ref()?); |
504 | let alias = extern_crate.rename().map(|a| { | 504 | let alias = extern_crate.rename().map(|a| { |
diff --git a/crates/ra_hir_def/src/item_tree/tests.rs b/crates/ra_hir_def/src/item_tree/tests.rs index a6057ceab..68be1cb40 100644 --- a/crates/ra_hir_def/src/item_tree/tests.rs +++ b/crates/ra_hir_def/src/item_tree/tests.rs | |||
@@ -232,7 +232,7 @@ fn smoke() { | |||
232 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_on_use"))] }, input: None }]) }] | 232 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_on_use"))] }, input: None }]) }] |
233 | Import { path: ModPath { kind: Plain, segments: [Name(Text("b"))] }, alias: None, visibility: RawVisibilityId("pub(self)"), is_glob: true, is_prelude: false, ast_id: FileAstId::<ra_syntax::ast::generated::nodes::UseItem>(0) } | 233 | Import { path: ModPath { kind: Plain, segments: [Name(Text("b"))] }, alias: None, visibility: RawVisibilityId("pub(self)"), is_glob: true, is_prelude: false, ast_id: FileAstId::<ra_syntax::ast::generated::nodes::UseItem>(0) } |
234 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("ext_crate"))] }, input: None }]) }] | 234 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("ext_crate"))] }, input: None }]) }] |
235 | ExternCrate { path: ModPath { kind: Plain, segments: [Name(Text("krate"))] }, alias: None, visibility: RawVisibilityId("pub(self)"), is_macro_use: false, ast_id: FileAstId::<ra_syntax::ast::generated::nodes::ExternCrateItem>(1) } | 235 | ExternCrate { path: ModPath { kind: Plain, segments: [Name(Text("krate"))] }, alias: None, visibility: RawVisibilityId("pub(self)"), is_macro_use: false, ast_id: FileAstId::<ra_syntax::ast::generated::nodes::ExternCrate>(1) } |
236 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("on_trait"))] }, input: None }]) }] | 236 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("on_trait"))] }, input: None }]) }] |
237 | Trait { name: Name(Text("Tr")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(0), auto: false, items: [TypeAlias(Idx::<TypeAlias>(0)), Const(Idx::<Const>(0)), Function(Idx::<Function>(0)), Function(Idx::<Function>(1))], ast_id: FileAstId::<ra_syntax::ast::generated::nodes::TraitDef>(2) } | 237 | Trait { name: Name(Text("Tr")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(0), auto: false, items: [TypeAlias(Idx::<TypeAlias>(0)), Const(Idx::<Const>(0)), Function(Idx::<Function>(0)), Function(Idx::<Function>(1))], ast_id: FileAstId::<ra_syntax::ast::generated::nodes::TraitDef>(2) } |
238 | > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_ty"))] }, input: None }]) }] | 238 | > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_ty"))] }, input: None }]) }] |