Skip to content

Commit

Permalink
Unrolled build for rust-lang#117397
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#117397 - compiler-errors:dont-emit-good-path-on-panic, r=TaKO8Ki

Don't emit delayed good-path bugs on panic

This should fix rust-lang#117381, cc ``@RalfJung``

As opposed to delayed bugs, delayed *good path* bugs really don't make sense to show on panics.
  • Loading branch information
rust-timer authored Nov 1, 2023
2 parents d1611e3 + 8076414 commit 4fac141
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_errors/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4fac141

Please sign in to comment.