Turn write_dep_info into a regular function
It has side-effects and as such can't be cached.
This commit is contained in:
parent
365a580bc4
commit
d7e9a30941
@ -401,9 +401,7 @@ fn run_compiler(
|
|||||||
Ok(())
|
Ok(())
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
// Make sure the `write_dep_info` query is run for its side
|
queries.write_dep_info()?;
|
||||||
// effects of writing the dep-info and reporting errors.
|
|
||||||
queries.global_ctxt()?.enter(|tcx| tcx.write_dep_info(()));
|
|
||||||
} else {
|
} else {
|
||||||
let krate = queries.parse()?;
|
let krate = queries.parse()?;
|
||||||
pretty::print(
|
pretty::print(
|
||||||
@ -431,9 +429,7 @@ fn run_compiler(
|
|||||||
return early_exit();
|
return early_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure the `write_dep_info` query is run for its side
|
queries.write_dep_info()?;
|
||||||
// effects of writing the dep-info and reporting errors.
|
|
||||||
queries.global_ctxt()?.enter(|tcx| tcx.write_dep_info(()));
|
|
||||||
|
|
||||||
if sess.opts.output_types.contains_key(&OutputType::DepInfo)
|
if sess.opts.output_types.contains_key(&OutputType::DepInfo)
|
||||||
&& sess.opts.output_types.len() == 1
|
&& sess.opts.output_types.len() == 1
|
||||||
|
@ -553,7 +553,7 @@ fn resolver_for_lowering<'tcx>(
|
|||||||
tcx.arena.alloc(Steal::new((untracked_resolver_for_lowering, Lrc::new(krate))))
|
tcx.arena.alloc(Steal::new((untracked_resolver_for_lowering, Lrc::new(krate))))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn write_dep_info(tcx: TyCtxt<'_>, (): ()) {
|
pub(crate) fn write_dep_info(tcx: TyCtxt<'_>) {
|
||||||
// Make sure name resolution and macro expansion is run for
|
// Make sure name resolution and macro expansion is run for
|
||||||
// the side-effect of providing a complete set of all
|
// the side-effect of providing a complete set of all
|
||||||
// accessed files and env vars.
|
// accessed files and env vars.
|
||||||
@ -606,7 +606,6 @@ pub static DEFAULT_QUERY_PROVIDERS: LazyLock<Providers> = LazyLock::new(|| {
|
|||||||
let providers = &mut Providers::default();
|
let providers = &mut Providers::default();
|
||||||
providers.analysis = analysis;
|
providers.analysis = analysis;
|
||||||
providers.hir_crate = rustc_ast_lowering::lower_to_hir;
|
providers.hir_crate = rustc_ast_lowering::lower_to_hir;
|
||||||
providers.write_dep_info = write_dep_info;
|
|
||||||
providers.resolver_for_lowering = resolver_for_lowering;
|
providers.resolver_for_lowering = resolver_for_lowering;
|
||||||
providers.early_lint_checks = early_lint_checks;
|
providers.early_lint_checks = early_lint_checks;
|
||||||
proc_macro_decls::provide(providers);
|
proc_macro_decls::provide(providers);
|
||||||
|
@ -176,6 +176,13 @@ impl<'tcx> Queries<'tcx> {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn write_dep_info(&'tcx self) -> Result<()> {
|
||||||
|
self.global_ctxt()?.enter(|tcx| {
|
||||||
|
passes::write_dep_info(tcx);
|
||||||
|
});
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
/// Check for the `#[rustc_error]` annotation, which forces an error in codegen. This is used
|
/// Check for the `#[rustc_error]` annotation, which forces an error in codegen. This is used
|
||||||
/// to write UI tests that actually test that compilation succeeds without reporting
|
/// to write UI tests that actually test that compilation succeeds without reporting
|
||||||
/// an error.
|
/// an error.
|
||||||
|
@ -1916,11 +1916,6 @@ rustc_queries! {
|
|||||||
arena_cache
|
arena_cache
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Write the dep-info file.
|
|
||||||
query write_dep_info(_: ()) -> () {
|
|
||||||
desc { "writing the dep-info file" }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Do not call this query directly: invoke `normalize` instead.
|
/// Do not call this query directly: invoke `normalize` instead.
|
||||||
query normalize_projection_ty(
|
query normalize_projection_ty(
|
||||||
goal: CanonicalProjectionGoal<'tcx>
|
goal: CanonicalProjectionGoal<'tcx>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user