From db34abeb8589518896b82f52062b9fab4c2b1352 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 26 Mar 2020 16:10:01 +0100 Subject: Get rid of ItemOrMacro --- crates/ra_hir_def/src/nameres/raw.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'crates/ra_hir_def/src/nameres') 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 { current_module: Option>, body: impl ast::ModuleItemOwner, ) { - for item_or_macro in body.items_with_macros() { - match item_or_macro { - ast::ItemOrMacro::Macro(m) => self.add_macro(current_module, m), - ast::ItemOrMacro::Item(item) => self.add_item(current_module, item), - } + for item in body.items() { + self.add_item(current_module, item) } } @@ -265,6 +262,10 @@ impl RawItemsCollector { ast::ModuleItem::StaticDef(it) => { (DefKind::Static(self.source_ast_id_map.ast_id(&it)), it.name()) } + ast::ModuleItem::MacroCall(it) => { + self.add_macro(current_module, it); + return; + } }; if let Some(name) = name { let name = name.as_name(); -- cgit v1.2.3