about summary refs log tree commit diff
path: root/compiler/rustc_query_impl/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-08-19 20:42:45 +0000
committerbors <bors@rust-lang.org>2024-08-19 20:42:45 +0000
commit636d7ff91b9847d6d43c7bbe023568828f6e3246 (patch)
tree1465b175c7f5fa0e6ce1c772b4ebc308302a46ed /compiler/rustc_query_impl/src
parent5601d14249818d952da612fec481b7af3ed03a39 (diff)
parent77303568c049c5cb53d2cb8e67c8f34c819d3f5e (diff)
downloadrust-636d7ff91b9847d6d43c7bbe023568828f6e3246.tar.gz
rust-636d7ff91b9847d6d43c7bbe023568828f6e3246.zip
Auto merge of #129275 - matthiaskrgr:rollup-qv64hg6, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #129194 (Fix bootstrap test `detect_src_and_out` on Windows)
 - #129217 (safe transmute: check lifetimes)
 - #129223 ( Fix wrong argument for `get_fn_decl`)
 - #129235 (Check that `#[may_dangle]` is properly applied)
 - #129245 (Fix a typo in `rustc_hir` doc comment)
 - #129271 (Prevent double panic in query system, improve diagnostics)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_query_impl/src')
-rw-r--r--compiler/rustc_query_impl/src/plumbing.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler/rustc_query_impl/src/plumbing.rs b/compiler/rustc_query_impl/src/plumbing.rs
index b9e700c1938..c064b2bd6c1 100644
--- a/compiler/rustc_query_impl/src/plumbing.rs
+++ b/compiler/rustc_query_impl/src/plumbing.rs
@@ -702,11 +702,17 @@ macro_rules! define_queries {
                     let name = stringify!($name);
                     $crate::plumbing::create_query_frame(tcx, rustc_middle::query::descs::$name, key, kind, name)
                 };
-                tcx.query_system.states.$name.try_collect_active_jobs(
+                let res = tcx.query_system.states.$name.try_collect_active_jobs(
                     tcx,
                     make_query,
                     qmap,
-                ).unwrap();
+                );
+                // this can be called during unwinding, and the function has a `try_`-prefix, so
+                // don't `unwrap()` here, just manually check for `None` and do best-effort error
+                // reporting.
+                if res.is_none() {
+                    tracing::warn!("Failed to collect active jobs for query with name `{}`!", stringify!($name));
+                }
             }
 
             pub fn alloc_self_profile_query_strings<'tcx>(tcx: TyCtxt<'tcx>, string_cache: &mut QueryKeyStringCache) {