aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/nameres/collector.rs
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2021-03-21 00:45:24 +0000
committerJonas Schievink <[email protected]>2021-03-21 00:45:24 +0000
commit5322cd830eba39c66650a995af7006c2ef16f925 (patch)
treea31747f6c05faf9f393358560ca859f519a7db84 /crates/hir_def/src/nameres/collector.rs
parent787bd3c5516d250245f6070308d689311b638fbe (diff)
Expand legacy-scoped macro during collection
Diffstat (limited to 'crates/hir_def/src/nameres/collector.rs')
-rw-r--r--crates/hir_def/src/nameres/collector.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/crates/hir_def/src/nameres/collector.rs b/crates/hir_def/src/nameres/collector.rs
index 46a3c60cd..28b73c3a1 100644
--- a/crates/hir_def/src/nameres/collector.rs
+++ b/crates/hir_def/src/nameres/collector.rs
@@ -1467,12 +1467,13 @@ impl ModCollector<'_, '_> {
1467 }, 1467 },
1468 ) { 1468 ) {
1469 Ok(Ok(macro_call_id)) => { 1469 Ok(Ok(macro_call_id)) => {
1470 self.def_collector.unexpanded_macros.push(MacroDirective { 1470 // Legacy macros need to be expanded immediately, so that any macros they produce
1471 module_id: self.module_id, 1471 // are in scope.
1472 ast_id, 1472 self.def_collector.collect_macro_expansion(
1473 legacy: Some(macro_call_id), 1473 self.module_id,
1474 depth: self.macro_depth + 1, 1474 macro_call_id,
1475 }); 1475 self.macro_depth + 1,
1476 );
1476 1477
1477 return; 1478 return;
1478 } 1479 }