From 4f7df2aac107c0de2cab851f2a4f1ab369511fc8 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Mon, 11 Nov 2019 18:45:55 +0800 Subject: Add MacroDefKind --- crates/ra_hir_def/src/nameres/collector.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'crates/ra_hir_def') diff --git a/crates/ra_hir_def/src/nameres/collector.rs b/crates/ra_hir_def/src/nameres/collector.rs index 5f18e9de3..30664278e 100644 --- a/crates/ra_hir_def/src/nameres/collector.rs +++ b/crates/ra_hir_def/src/nameres/collector.rs @@ -3,7 +3,7 @@ use hir_expand::{ builtin_macro::find_builtin_macro, name::{self, AsName, Name}, - DeclarativeMacro, HirFileId, MacroCallId, MacroCallLoc, MacroDefId, MacroFileKind, + HirFileId, MacroCallId, MacroCallLoc, MacroDefId, MacroDefKind, MacroFileKind, }; use ra_cfg::CfgOptions; use ra_db::{CrateId, FileId}; @@ -708,13 +708,12 @@ 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 = DeclarativeMacro { ast_id, krate: self.def_collector.def_map.krate }; - self.def_collector.define_macro( - self.module_id, - name.clone(), - MacroDefId::DeclarativeMacro(macro_id), - mac.export, - ); + let macro_id = MacroDefId { + ast_id, + krate: self.def_collector.def_map.krate, + kind: MacroDefKind::Declarative, + }; + self.def_collector.define_macro(self.module_id, name.clone(), macro_id, mac.export); } return; } -- cgit v1.2.3