diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2023-11-04 17:35:28 +0000 |
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2023-11-26 18:02:47 +0000 |
| commit | d7e9a30941e6591a4671c3df59c815dc984fd786 (patch) | |
| tree | f276d24fc3b2c37b16c8cb61a75d31bdb43f69fe /compiler/rustc_interface/src | |
| parent | 365a580bc44ea63d28ce10778d73f91e0b0f4c15 (diff) | |
| download | rust-d7e9a30941e6591a4671c3df59c815dc984fd786.tar.gz rust-d7e9a30941e6591a4671c3df59c815dc984fd786.zip | |
Turn write_dep_info into a regular function
It has side-effects and as such can't be cached.
Diffstat (limited to 'compiler/rustc_interface/src')
| -rw-r--r-- | compiler/rustc_interface/src/passes.rs | 3 | ||||
| -rw-r--r-- | compiler/rustc_interface/src/queries.rs | 7 |
2 files changed, 8 insertions, 2 deletions
diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs index 6af97910b49..23034113f30 100644 --- a/compiler/rustc_interface/src/passes.rs +++ b/compiler/rustc_interface/src/passes.rs @@ -553,7 +553,7 @@ fn resolver_for_lowering<'tcx>( 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 // the side-effect of providing a complete set of all // accessed files and env vars. @@ -606,7 +606,6 @@ pub static DEFAULT_QUERY_PROVIDERS: LazyLock<Providers> = LazyLock::new(|| { let providers = &mut Providers::default(); providers.analysis = analysis; providers.hir_crate = rustc_ast_lowering::lower_to_hir; - providers.write_dep_info = write_dep_info; providers.resolver_for_lowering = resolver_for_lowering; providers.early_lint_checks = early_lint_checks; proc_macro_decls::provide(providers); diff --git a/compiler/rustc_interface/src/queries.rs b/compiler/rustc_interface/src/queries.rs index e352547a6c6..b7cd5468a00 100644 --- a/compiler/rustc_interface/src/queries.rs +++ b/compiler/rustc_interface/src/queries.rs @@ -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 /// to write UI tests that actually test that compilation succeeds without reporting /// an error. |
