about summary refs log tree commit diff
path: root/compiler/rustc_errors/src
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2023-10-30 10:14:43 -0400
committerMichael Goulet <michael@errs.io>2023-10-30 10:14:43 -0400
commit8076414f89275786ae04035151d54bb5b47bde9f (patch)
tree5134753654f8c64d40e321026b2bdebbc6e1cfa7 /compiler/rustc_errors/src
parentec2b311914a4880235862f3cd65fe24e92e6d3a5 (diff)
downloadrust-8076414f89275786ae04035151d54bb5b47bde9f.tar.gz
rust-8076414f89275786ae04035151d54bb5b47bde9f.zip
Don't emit delayed good-path bugs on panic
Diffstat (limited to 'compiler/rustc_errors/src')
-rw-r--r--compiler/rustc_errors/src/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs
index 5e3fdf170bc..dd462cc6486 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,