aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_expand/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_expand/src')
-rw-r--r--crates/hir_expand/src/hygiene.rs9
-rw-r--r--crates/hir_expand/src/lib.rs9
2 files changed, 10 insertions, 8 deletions
diff --git a/crates/hir_expand/src/hygiene.rs b/crates/hir_expand/src/hygiene.rs
index 05c6c3fb1..848522411 100644
--- a/crates/hir_expand/src/hygiene.rs
+++ b/crates/hir_expand/src/hygiene.rs
@@ -146,10 +146,11 @@ impl HygieneInfo {
146 (&self.macro_arg.1, InFile::new(loc.kind.file_id(), arg_start)) 146 (&self.macro_arg.1, InFile::new(loc.kind.file_id(), arg_start))
147 } 147 }
148 mbe::Origin::Def => match (&*self.macro_def, self.def_start) { 148 mbe::Origin::Def => match (&*self.macro_def, self.def_start) {
149 (TokenExpander::MacroDef { def_site_token_map, .. }, Some(tt)) 149 (
150 | (TokenExpander::MacroRules { def_site_token_map, .. }, Some(tt)) => { 150 TokenExpander::MacroDef { def_site_token_map, .. }
151 (def_site_token_map, tt) 151 | TokenExpander::MacroRules { def_site_token_map, .. },
152 } 152 Some(tt),
153 ) => (def_site_token_map, tt),
153 _ => panic!("`Origin::Def` used with non-`macro_rules!` macro"), 154 _ => panic!("`Origin::Def` used with non-`macro_rules!` macro"),
154 }, 155 },
155 }; 156 };
diff --git a/crates/hir_expand/src/lib.rs b/crates/hir_expand/src/lib.rs
index 33107aa24..c31426d7c 100644
--- a/crates/hir_expand/src/lib.rs
+++ b/crates/hir_expand/src/lib.rs
@@ -368,10 +368,11 @@ impl ExpansionInfo {
368 let (token_map, tt) = match origin { 368 let (token_map, tt) = match origin {
369 mbe::Origin::Call => (&self.macro_arg.1, self.arg.clone()), 369 mbe::Origin::Call => (&self.macro_arg.1, self.arg.clone()),
370 mbe::Origin::Def => match (&*self.macro_def, self.def.as_ref()) { 370 mbe::Origin::Def => match (&*self.macro_def, self.def.as_ref()) {
371 (db::TokenExpander::MacroRules { def_site_token_map, .. }, Some(tt)) 371 (
372 | (db::TokenExpander::MacroDef { def_site_token_map, .. }, Some(tt)) => { 372 db::TokenExpander::MacroRules { def_site_token_map, .. }
373 (def_site_token_map, tt.as_ref().map(|tt| tt.syntax().clone())) 373 | db::TokenExpander::MacroDef { def_site_token_map, .. },
374 } 374 Some(tt),
375 ) => (def_site_token_map, tt.as_ref().map(|tt| tt.syntax().clone())),
375 _ => panic!("`Origin::Def` used with non-`macro_rules!` macro"), 376 _ => panic!("`Origin::Def` used with non-`macro_rules!` macro"),
376 }, 377 },
377 }; 378 };