diff options
Diffstat (limited to 'crates/ra_hir/src/nameres/collector.rs')
-rw-r--r-- | crates/ra_hir/src/nameres/collector.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/ra_hir/src/nameres/collector.rs b/crates/ra_hir/src/nameres/collector.rs index 4590a5184..762a61604 100644 --- a/crates/ra_hir/src/nameres/collector.rs +++ b/crates/ra_hir/src/nameres/collector.rs | |||
@@ -131,6 +131,8 @@ where | |||
131 | fn define_macro(&mut self, name: Name, macro_id: MacroDefId, export: bool) { | 131 | fn define_macro(&mut self, name: Name, macro_id: MacroDefId, export: bool) { |
132 | if export { | 132 | if export { |
133 | self.def_map.public_macros.insert(name.clone(), macro_id); | 133 | self.def_map.public_macros.insert(name.clone(), macro_id); |
134 | } else { | ||
135 | self.def_map.local_macros.insert(name.clone(), macro_id); | ||
134 | } | 136 | } |
135 | self.global_macro_scope.insert(name, macro_id); | 137 | self.global_macro_scope.insert(name, macro_id); |
136 | } | 138 | } |
@@ -517,10 +519,10 @@ where | |||
517 | 519 | ||
518 | // Case 2: try to expand macro_rules from this crate, triggering | 520 | // Case 2: try to expand macro_rules from this crate, triggering |
519 | // recursive item collection. | 521 | // recursive item collection. |
520 | if let Some(¯o_id) = | 522 | if let Some(macro_id) = |
521 | mac.path.as_ident().and_then(|name| self.def_collector.global_macro_scope.get(name)) | 523 | mac.path.as_ident().and_then(|name| self.def_collector.global_macro_scope.get(&name)) |
522 | { | 524 | { |
523 | let macro_call_id = MacroCallLoc { def: macro_id, ast_id }.id(self.def_collector.db); | 525 | let macro_call_id = MacroCallLoc { def: *macro_id, ast_id }.id(self.def_collector.db); |
524 | 526 | ||
525 | self.def_collector.collect_macro_expansion(self.module_id, macro_call_id, macro_id); | 527 | self.def_collector.collect_macro_expansion(self.module_id, macro_call_id, macro_id); |
526 | return; | 528 | return; |