about summary refs log tree commit diff
path: root/compiler/rustc_interface/src
diff options
context:
space:
mode:
authorJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2025-03-21 08:09:42 +0100
committerJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2025-03-21 08:14:27 +0100
commit34244c1477e4b485c51872fc3c6d846b4a3c6ffa (patch)
tree4284de5056f3ddd27943c18b8e189cc4bf6650f8 /compiler/rustc_interface/src
parent157008d7117ec9ca13b70c38058639524437112f (diff)
downloadrust-34244c1477e4b485c51872fc3c6d846b4a3c6ffa.tar.gz
rust-34244c1477e4b485c51872fc3c6d846b4a3c6ffa.zip
Address comments
Diffstat (limited to 'compiler/rustc_interface/src')
-rw-r--r--compiler/rustc_interface/src/util.rs17
1 files changed, 9 insertions, 8 deletions
diff --git a/compiler/rustc_interface/src/util.rs b/compiler/rustc_interface/src/util.rs
index 249b80bb31d..333786f0ca3 100644
--- a/compiler/rustc_interface/src/util.rs
+++ b/compiler/rustc_interface/src/util.rs
@@ -193,15 +193,16 @@ pub(crate) fn run_in_thread_pool_with_globals<F: FnOnce(CurrentGcx) -> R + Send,
             let query_map = current_gcx2.access(|gcx| {
                 tls::enter_context(&tls::ImplicitCtxt::new(gcx), || {
                     tls::with(|tcx| {
-                        let (query_map, complete) = QueryCtxt::new(tcx).collect_active_jobs();
-                        if !complete {
-                            // There was an unexpected error collecting all active jobs, which we need
-                            // to find cycles to break.
-                            // We want to avoid panicking in the deadlock handler, so we abort instead.
-                            eprintln!("internal compiler error: failed to get query map in deadlock handler, aborting process");
-                            process::abort();
+                        match QueryCtxt::new(tcx).collect_active_jobs() {
+                            Ok(query_map) => query_map,
+                            Err(_) => {
+                                // There was an unexpected error collecting all active jobs, which we need
+                                // to find cycles to break.
+                                // We want to avoid panicking in the deadlock handler, so we abort instead.
+                                eprintln!("internal compiler error: failed to get query map in deadlock handler, aborting process");
+                                process::abort();
+                            }
                         }
-                        query_map
                     })
                 })
             });