aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_expand/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_expand/src/lib.rs')
-rw-r--r--crates/hir_expand/src/lib.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/hir_expand/src/lib.rs b/crates/hir_expand/src/lib.rs
index ae3086a95..55f026c7b 100644
--- a/crates/hir_expand/src/lib.rs
+++ b/crates/hir_expand/src/lib.rs
@@ -145,7 +145,10 @@ impl HirFileId {
145 let arg_tt = loc.kind.arg(db)?; 145 let arg_tt = loc.kind.arg(db)?;
146 146
147 let def = loc.def.ast_id.and_then(|id| { 147 let def = loc.def.ast_id.and_then(|id| {
148 let def_tt = id.to_node(db).token_tree()?; 148 let def_tt = match id.to_node(db) {
149 ast::Macro::MacroRules(mac) => mac.token_tree()?,
150 ast::Macro::MacroDef(_) => return None,
151 };
149 Some(InFile::new(id.file_id, def_tt)) 152 Some(InFile::new(id.file_id, def_tt))
150 }); 153 });
151 154
@@ -228,7 +231,7 @@ pub struct MacroDefId {
228 // (which will probably require touching this code), we can instead use 231 // (which will probably require touching this code), we can instead use
229 // that (and also remove the hacks for resolving built-in derives). 232 // that (and also remove the hacks for resolving built-in derives).
230 pub krate: Option<CrateId>, 233 pub krate: Option<CrateId>,
231 pub ast_id: Option<AstId<ast::MacroRules>>, 234 pub ast_id: Option<AstId<ast::Macro>>,
232 pub kind: MacroDefKind, 235 pub kind: MacroDefKind,
233 236
234 pub local_inner: bool, 237 pub local_inner: bool,