about summary refs log tree commit diff
path: root/compiler/rustc_query_system
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-09-10 03:23:02 +0000
committerbors <bors@rust-lang.org>2023-09-10 03:23:02 +0000
commitffe131f841cc8bd44081a938f58309f5052b0f0b (patch)
tree4626f24f74594926d6e3138a51f484131d4f03b6 /compiler/rustc_query_system
parent0d0ad42e274bbee835aa390ceae84d5857164e0a (diff)
parent68ffa3362882e13838e70744880982d1d733716f (diff)
downloadrust-ffe131f841cc8bd44081a938f58309f5052b0f0b.tar.gz
rust-ffe131f841cc8bd44081a938f58309f5052b0f0b.zip
Auto merge of #115668 - Zoxc:deadlock-msg, r=jackh726
Make the deadlock panic clearly refer to a deadlock
Diffstat (limited to 'compiler/rustc_query_system')
-rw-r--r--compiler/rustc_query_system/src/query/job.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_query_system/src/query/job.rs b/compiler/rustc_query_system/src/query/job.rs
index 9cba549a3b5..6c01dc3c00d 100644
--- a/compiler/rustc_query_system/src/query/job.rs
+++ b/compiler/rustc_query_system/src/query/job.rs
@@ -552,7 +552,9 @@ pub fn deadlock<D: DepKind>(query_map: QueryMap<D>, registry: &rayon_core::Regis
     // which in turn will wait on X causing a deadlock. We have a false dependency from
     // X to Y due to Rayon waiting and a true dependency from Y to X. The algorithm here
     // only considers the true dependency and won't detect a cycle.
-    assert!(found_cycle);
+    if !found_cycle {
+        panic!("deadlock detected");
+    }
 
     // FIXME: Ensure this won't cause a deadlock before we return
     for waiter in wakelist.into_iter() {