From 8076414f89275786ae04035151d54bb5b47bde9f Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Mon, 30 Oct 2023 10:14:43 -0400 Subject: [PATCH] Don't emit delayed good-path bugs on panic --- compiler/rustc_errors/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index 5e3fdf170bc0c..dd462cc64865f 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -556,7 +556,7 @@ impl Drop for HandlerInner { // instead of "require some error happened". Sadly that isn't ideal, as // lints can be `#[allow]`'d, potentially leading to this triggering. // Also, "good path" should be replaced with a better naming. - if !self.has_any_message() && !self.suppressed_expected_diag { + if !self.has_any_message() && !self.suppressed_expected_diag && !std::thread::panicking() { let bugs = std::mem::replace(&mut self.delayed_good_path_bugs, Vec::new()); self.flush_delayed( bugs,