aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-03-26 15:10:01 +0000
committerAleksey Kladov <[email protected]>2020-03-26 15:10:01 +0000
commitdb34abeb8589518896b82f52062b9fab4c2b1352 (patch)
tree3ac357657b2dfa901bc28d35a7934123778dc30a /crates/ra_hir_def/src
parent539e597743229b4497491f325a257bef026602c7 (diff)
Get rid of ItemOrMacro
Diffstat (limited to 'crates/ra_hir_def/src')
-rw-r--r--crates/ra_hir_def/src/body/lower.rs3
-rw-r--r--crates/ra_hir_def/src/nameres/raw.rs11
2 files changed, 8 insertions, 6 deletions
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs
index 3cf0c66ea..e8443dde8 100644
--- a/crates/ra_hir_def/src/body/lower.rs
+++ b/crates/ra_hir_def/src/body/lower.rs
@@ -563,7 +563,8 @@ impl ExprCollector<'_> {
563 ast::ModuleItem::ImplDef(_) 563 ast::ModuleItem::ImplDef(_)
564 | ast::ModuleItem::UseItem(_) 564 | ast::ModuleItem::UseItem(_)
565 | ast::ModuleItem::ExternCrateItem(_) 565 | ast::ModuleItem::ExternCrateItem(_)
566 | ast::ModuleItem::Module(_) => continue, 566 | ast::ModuleItem::Module(_)
567 | ast::ModuleItem::MacroCall(_) => continue,
567 }; 568 };
568 self.body.item_scope.define_def(def); 569 self.body.item_scope.define_def(def);
569 if let Some(name) = name { 570 if let Some(name) = name {
diff --git a/crates/ra_hir_def/src/nameres/raw.rs b/crates/ra_hir_def/src/nameres/raw.rs
index 1631e87b8..8f190e7f9 100644
--- a/crates/ra_hir_def/src/nameres/raw.rs
+++ b/crates/ra_hir_def/src/nameres/raw.rs
@@ -209,11 +209,8 @@ impl RawItemsCollector {
209 current_module: Option<Idx<ModuleData>>, 209 current_module: Option<Idx<ModuleData>>,
210 body: impl ast::ModuleItemOwner, 210 body: impl ast::ModuleItemOwner,
211 ) { 211 ) {
212 for item_or_macro in body.items_with_macros() { 212 for item in body.items() {
213 match item_or_macro { 213 self.add_item(current_module, item)
214 ast::ItemOrMacro::Macro(m) => self.add_macro(current_module, m),
215 ast::ItemOrMacro::Item(item) => self.add_item(current_module, item),
216 }
217 } 214 }
218 } 215 }
219 216
@@ -265,6 +262,10 @@ impl RawItemsCollector {
265 ast::ModuleItem::StaticDef(it) => { 262 ast::ModuleItem::StaticDef(it) => {
266 (DefKind::Static(self.source_ast_id_map.ast_id(&it)), it.name()) 263 (DefKind::Static(self.source_ast_id_map.ast_id(&it)), it.name())
267 } 264 }
265 ast::ModuleItem::MacroCall(it) => {
266 self.add_macro(current_module, it);
267 return;
268 }
268 }; 269 };
269 if let Some(name) = name { 270 if let Some(name) = name {
270 let name = name.as_name(); 271 let name = name.as_name();