about summary refs log tree commit diff
path: root/compiler/rustc_driver_impl
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2024-10-31 16:05:59 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2024-11-09 18:43:29 +0000
commit3b02a3309e12906a455eb128a0aa74c6a6afc932 (patch)
tree865bed7da7c9f9ca6ed9c079992a69e0edda61dc /compiler/rustc_driver_impl
parent1eece7478d23b4530a5ecb604e4ea1aad3e4d62f (diff)
downloadrust-3b02a3309e12906a455eb128a0aa74c6a6afc932.tar.gz
rust-3b02a3309e12906a455eb128a0aa74c6a6afc932.zip
Pass TyCtxt instead of Queries to the after_analysis callbacks
There is no other query that may need to be called at that point anyway.
Diffstat (limited to 'compiler/rustc_driver_impl')
-rw-r--r--compiler/rustc_driver_impl/src/lib.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/compiler/rustc_driver_impl/src/lib.rs b/compiler/rustc_driver_impl/src/lib.rs
index 7d0c8644dbf..1f145185caa 100644
--- a/compiler/rustc_driver_impl/src/lib.rs
+++ b/compiler/rustc_driver_impl/src/lib.rs
@@ -50,6 +50,7 @@ use rustc_interface::{Linker, Queries, interface, passes};
 use rustc_lint::unerased_lint_store;
 use rustc_metadata::creader::MetadataLoader;
 use rustc_metadata::locator;
+use rustc_middle::ty::TyCtxt;
 use rustc_parse::{new_parser_from_file, new_parser_from_source_str, unwrap_or_emit_fatal};
 use rustc_session::config::{
     CG_OPTIONS, ErrorOutputType, Input, OutFileName, OutputType, UnstableOptions, Z_OPTIONS,
@@ -179,7 +180,7 @@ pub trait Callbacks {
     fn after_analysis<'tcx>(
         &mut self,
         _compiler: &interface::Compiler,
-        _queries: &'tcx Queries<'tcx>,
+        _tcx: TyCtxt<'tcx>,
     ) -> Compilation {
         Compilation::Continue
     }
@@ -437,13 +438,11 @@ fn run_compiler(
                 }
 
                 tcx.analysis(())?;
-            })?;
 
-            if callbacks.after_analysis(compiler, queries) == Compilation::Stop {
-                return early_exit();
-            }
+                if callbacks.after_analysis(compiler, tcx) == Compilation::Stop {
+                    return early_exit();
+                }
 
-            queries.global_ctxt()?.enter(|tcx| {
                 Ok(Some(Linker::codegen_and_build_linker(tcx, &*compiler.codegen_backend)?))
             })
         })?;