diff options
Diffstat (limited to 'crates/hir_expand/src/db.rs')
-rw-r--r-- | crates/hir_expand/src/db.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/hir_expand/src/db.rs b/crates/hir_expand/src/db.rs index a3070f1f9..2748e25cf 100644 --- a/crates/hir_expand/src/db.rs +++ b/crates/hir_expand/src/db.rs | |||
@@ -130,8 +130,8 @@ fn ast_id_map(db: &dyn AstDatabase, file_id: HirFileId) -> Arc<AstIdMap> { | |||
130 | 130 | ||
131 | fn macro_def(db: &dyn AstDatabase, id: MacroDefId) -> Option<Arc<(TokenExpander, mbe::TokenMap)>> { | 131 | fn macro_def(db: &dyn AstDatabase, id: MacroDefId) -> Option<Arc<(TokenExpander, mbe::TokenMap)>> { |
132 | match id.kind { | 132 | match id.kind { |
133 | MacroDefKind::Declarative => { | 133 | MacroDefKind::Declarative(ast_id) => { |
134 | let macro_rules = match id.ast_id?.to_node(db) { | 134 | let macro_rules = match ast_id.to_node(db) { |
135 | syntax::ast::Macro::MacroRules(mac) => mac, | 135 | syntax::ast::Macro::MacroRules(mac) => mac, |
136 | syntax::ast::Macro::MacroDef(_) => return None, | 136 | syntax::ast::Macro::MacroDef(_) => return None, |
137 | }; | 137 | }; |
@@ -150,14 +150,14 @@ fn macro_def(db: &dyn AstDatabase, id: MacroDefId) -> Option<Arc<(TokenExpander, | |||
150 | }; | 150 | }; |
151 | Some(Arc::new((TokenExpander::MacroRules(rules), tmap))) | 151 | Some(Arc::new((TokenExpander::MacroRules(rules), tmap))) |
152 | } | 152 | } |
153 | MacroDefKind::BuiltIn(expander) => { | 153 | MacroDefKind::BuiltIn(expander, _) => { |
154 | Some(Arc::new((TokenExpander::Builtin(expander), mbe::TokenMap::default()))) | 154 | Some(Arc::new((TokenExpander::Builtin(expander), mbe::TokenMap::default()))) |
155 | } | 155 | } |
156 | MacroDefKind::BuiltInDerive(expander) => { | 156 | MacroDefKind::BuiltInDerive(expander, _) => { |
157 | Some(Arc::new((TokenExpander::BuiltinDerive(expander), mbe::TokenMap::default()))) | 157 | Some(Arc::new((TokenExpander::BuiltinDerive(expander), mbe::TokenMap::default()))) |
158 | } | 158 | } |
159 | MacroDefKind::BuiltInEager(_) => None, | 159 | MacroDefKind::BuiltInEager(..) => None, |
160 | MacroDefKind::ProcMacro(expander) => { | 160 | MacroDefKind::ProcMacro(expander, ..) => { |
161 | Some(Arc::new((TokenExpander::ProcMacro(expander), mbe::TokenMap::default()))) | 161 | Some(Arc::new((TokenExpander::ProcMacro(expander), mbe::TokenMap::default()))) |
162 | } | 162 | } |
163 | } | 163 | } |
@@ -269,7 +269,7 @@ fn expand_proc_macro( | |||
269 | }; | 269 | }; |
270 | 270 | ||
271 | let expander = match loc.def.kind { | 271 | let expander = match loc.def.kind { |
272 | MacroDefKind::ProcMacro(expander) => expander, | 272 | MacroDefKind::ProcMacro(expander, ..) => expander, |
273 | _ => unreachable!(), | 273 | _ => unreachable!(), |
274 | }; | 274 | }; |
275 | 275 | ||