From 7ede8e2a5912778ce01b6a520c954c4e105126e6 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Sat, 4 Nov 2023 16:06:23 +0000 Subject: [PATCH] Ensure macro expansion runs before writing the dep info --- compiler/rustc_interface/src/passes.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs index d1270427967..6af97910b49 100644 --- a/compiler/rustc_interface/src/passes.rs +++ b/compiler/rustc_interface/src/passes.rs @@ -554,6 +554,11 @@ fn resolver_for_lowering<'tcx>( } fn write_dep_info(tcx: TyCtxt<'_>, (): ()) { + // Make sure name resolution and macro expansion is run for + // the side-effect of providing a complete set of all + // accessed files and env vars. + let _ = tcx.resolver_for_lowering(()); + let sess = tcx.sess; let _timer = sess.timer("write_dep_info"); let crate_name = tcx.crate_name(LOCAL_CRATE);