Skip to content

Commit b795264

Browse files
committed
Pass TyCtxt rather than Queries to after_expansion
1 parent 5a6036a commit b795264

File tree

1 file changed

+10
-10
lines changed
  • compiler/rustc_driver_impl/src

1 file changed

+10
-10
lines changed

Diff for: compiler/rustc_driver_impl/src/lib.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ pub trait Callbacks {
173173
fn after_expansion<'tcx>(
174174
&mut self,
175175
_compiler: &interface::Compiler,
176-
_queries: &'tcx Queries<'tcx>,
176+
_tcx: TyCtxt<'tcx>,
177177
) -> Compilation {
178178
Compilation::Continue
179179
}
@@ -425,18 +425,18 @@ fn run_compiler(
425425
return early_exit();
426426
}
427427

428-
// Make sure name resolution and macro expansion is run.
429-
queries.global_ctxt().enter(|tcx| tcx.resolver_for_lowering());
428+
queries.global_ctxt().enter(|tcx| {
429+
// Make sure name resolution and macro expansion is run.
430+
let _ = tcx.resolver_for_lowering();
430431

431-
if let Some(metrics_dir) = &sess.opts.unstable_opts.metrics_dir {
432-
queries.global_ctxt().enter(|tcxt| dump_feature_usage_metrics(tcxt, metrics_dir));
433-
}
432+
if let Some(metrics_dir) = &sess.opts.unstable_opts.metrics_dir {
433+
dump_feature_usage_metrics(tcx, metrics_dir);
434+
}
434435

435-
if callbacks.after_expansion(compiler, queries) == Compilation::Stop {
436-
return early_exit();
437-
}
436+
if callbacks.after_expansion(compiler, tcx) == Compilation::Stop {
437+
return early_exit();
438+
}
438439

439-
queries.global_ctxt().enter(|tcx| {
440440
passes::write_dep_info(tcx);
441441

442442
if sess.opts.output_types.contains_key(&OutputType::DepInfo)

0 commit comments

Comments
 (0)