From 68ffa3362882e13838e70744880982d1d733716f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20K=C3=A5re=20Alsaker?= Date: Fri, 8 Sep 2023 10:22:15 +0200 Subject: [PATCH] Make the deadlock panic clearly refer to a deadlock --- compiler/rustc_query_system/src/query/job.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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(query_map: QueryMap, 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() {