diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-03-26 15:13:54 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-03-26 15:13:54 +0000 |
commit | ac05571dc9b01dbbb6cf97988190563f1b33ce13 (patch) | |
tree | 3ac357657b2dfa901bc28d35a7934123778dc30a /crates/ra_hir_def/src/nameres | |
parent | 539e597743229b4497491f325a257bef026602c7 (diff) | |
parent | db34abeb8589518896b82f52062b9fab4c2b1352 (diff) |
Merge #3734
3734: Get rid of ItemOrMacro r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir_def/src/nameres')
-rw-r--r-- | crates/ra_hir_def/src/nameres/raw.rs | 11 |
1 files changed, 6 insertions, 5 deletions
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(); |