diff options
author | Edwin Cheng <[email protected]> | 2019-11-11 10:45:55 +0000 |
---|---|---|
committer | Edwin Cheng <[email protected]> | 2019-11-11 10:48:16 +0000 |
commit | 4f7df2aac107c0de2cab851f2a4f1ab369511fc8 (patch) | |
tree | 9f78811b31771c2822c0852c4527ad145f845e70 /crates/ra_hir_def/src | |
parent | c4aa8b63bcea5faa23da56b679cafbdbad6892f1 (diff) |
Add MacroDefKind
Diffstat (limited to 'crates/ra_hir_def/src')
-rw-r--r-- | crates/ra_hir_def/src/nameres/collector.rs | 15 |
1 files changed, 7 insertions, 8 deletions
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 @@ | |||
3 | use hir_expand::{ | 3 | use hir_expand::{ |
4 | builtin_macro::find_builtin_macro, | 4 | builtin_macro::find_builtin_macro, |
5 | name::{self, AsName, Name}, | 5 | name::{self, AsName, Name}, |
6 | DeclarativeMacro, HirFileId, MacroCallId, MacroCallLoc, MacroDefId, MacroFileKind, | 6 | HirFileId, MacroCallId, MacroCallLoc, MacroDefId, MacroDefKind, MacroFileKind, |
7 | }; | 7 | }; |
8 | use ra_cfg::CfgOptions; | 8 | use ra_cfg::CfgOptions; |
9 | use ra_db::{CrateId, FileId}; | 9 | use ra_db::{CrateId, FileId}; |
@@ -708,13 +708,12 @@ where | |||
708 | // Case 1: macro rules, define a macro in crate-global mutable scope | 708 | // Case 1: macro rules, define a macro in crate-global mutable scope |
709 | if is_macro_rules(&mac.path) { | 709 | if is_macro_rules(&mac.path) { |
710 | if let Some(name) = &mac.name { | 710 | if let Some(name) = &mac.name { |
711 | let macro_id = DeclarativeMacro { ast_id, krate: self.def_collector.def_map.krate }; | 711 | let macro_id = MacroDefId { |
712 | self.def_collector.define_macro( | 712 | ast_id, |
713 | self.module_id, | 713 | krate: self.def_collector.def_map.krate, |
714 | name.clone(), | 714 | kind: MacroDefKind::Declarative, |
715 | MacroDefId::DeclarativeMacro(macro_id), | 715 | }; |
716 | mac.export, | 716 | self.def_collector.define_macro(self.module_id, name.clone(), macro_id, mac.export); |
717 | ); | ||
718 | } | 717 | } |
719 | return; | 718 | return; |
720 | } | 719 | } |