From 8cd23a4fb8c6a1012ba3e40dd3329a5abaed06b7 Mon Sep 17 00:00:00 2001 From: uHOOCCOOHu Date: Fri, 27 Sep 2019 00:16:55 +0800 Subject: Store crate info in `MacroDefId` --- crates/ra_hir/src/nameres/collector.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'crates/ra_hir/src/nameres/collector.rs') diff --git a/crates/ra_hir/src/nameres/collector.rs b/crates/ra_hir/src/nameres/collector.rs index ef7dc6ebe..65929c522 100644 --- a/crates/ra_hir/src/nameres/collector.rs +++ b/crates/ra_hir/src/nameres/collector.rs @@ -662,7 +662,10 @@ where // Case 1: macro rules, define a macro in crate-global mutable scope if is_macro_rules(&mac.path) { if let Some(name) = &mac.name { - let macro_id = MacroDefId(mac.ast_id.with_file_id(self.file_id)); + let macro_id = MacroDefId { + ast_id: mac.ast_id.with_file_id(self.file_id), + krate: self.def_collector.def_map.krate, + }; let macro_ = MacroDef { id: macro_id }; self.def_collector.define_macro(self.module_id, name.clone(), macro_, mac.export); } -- cgit v1.2.3