From 139929a633443ea2be49b8f7d6581e892c513c91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20K=C3=A5re=20Alsaker?= Date: Fri, 15 Mar 2024 19:09:24 +0100 Subject: [PATCH] Try to write the panic message with a single `write_all` call --- library/std/src/panicking.rs | 16 ++++++++- .../generic_const_exprs/issue-80742.stderr | 2 ++ .../const-eval/const-eval-query-stack.stderr | 2 ++ .../extern-types-field-offset.run.stderr | 2 ++ .../extern-types-size_of_val.align.run.stderr | 2 ++ .../extern-types-size_of_val.size.run.stderr | 2 ++ .../trait-bounds/future.current.stderr | 2 ++ tests/ui/hygiene/panic-location.run.stderr | 2 ++ ...const-eval-select-backtrace-std.run.stderr | 2 ++ .../const-eval-select-backtrace.run.stderr | 2 ++ tests/ui/intrinsics/not-overridden.stderr | 2 ++ tests/ui/issues/issue-87707.run.stderr | 4 +++ tests/ui/layout/valid_range_oob.stderr | 2 ++ .../macros/assert-long-condition.run.stderr | 2 ++ tests/ui/mir/lint/storage-live.stderr | 2 ++ tests/ui/panics/fmt-only-once.run.stderr | 2 ++ ...location-detail-panic-no-column.run.stderr | 2 ++ .../location-detail-panic-no-file.run.stderr | 2 ++ .../location-detail-panic-no-line.run.stderr | 2 ++ ...n-detail-panic-no-location-info.run.stderr | 2 ++ .../location-detail-unwrap-no-file.run.stderr | 2 ++ tests/ui/panics/panic-in-ffi.run.stderr | 4 +++ .../ui/proc-macro/load-panic-backtrace.stderr | 2 ++ tests/ui/process/multi-panic.rs | 34 +++++++++++++------ ...tiple_definitions_attribute_merging.stderr | 4 ++- .../proc_macro_generated_packed.stderr | 4 ++- tests/ui/test-attrs/terse.run.stdout | 6 ++++ .../test-panic-abort-nocapture.run.stderr | 4 +++ .../ui/test-attrs/test-panic-abort.run.stdout | 2 ++ .../test-attrs/test-thread-capture.run.stdout | 2 ++ .../test-thread-nocapture.run.stderr | 2 ++ tests/ui/track-diagnostics/track.stderr | 2 ++ tests/ui/treat-err-as-bug/err.stderr | 2 ++ .../treat-err-as-bug/span_delayed_bug.stderr | 2 ++ 34 files changed, 114 insertions(+), 14 deletions(-) diff --git a/library/std/src/panicking.rs b/library/std/src/panicking.rs index 464a46264cbdd..1671c583296b7 100644 --- a/library/std/src/panicking.rs +++ b/library/std/src/panicking.rs @@ -260,7 +260,21 @@ fn default_hook(info: &PanicInfo<'_>) { let name = thread.as_ref().and_then(|t| t.name()).unwrap_or(""); let write = |err: &mut dyn crate::io::Write| { - let _ = writeln!(err, "thread '{name}' panicked at {location}:\n{msg}"); + // Try to write the panic message to a buffer first to prevent other concurrent outputs + // interleaving with it. + let mut buffer = [0u8; 512]; + let mut cursor = crate::io::Cursor::new(&mut buffer[..]); + + let write_msg = |dst: &mut dyn crate::io::Write| { + writeln!(dst, "\nthread '{name}' panicked at {location}:\n{msg}\n") + }; + + let _ = if write_msg(&mut cursor).is_ok() { + let pos = cursor.position() as usize; + err.write_all(&buffer[0..pos]) + } else { + write_msg(err) + }; static FIRST_PANIC: AtomicBool = AtomicBool::new(true); diff --git a/tests/ui/const-generics/generic_const_exprs/issue-80742.stderr b/tests/ui/const-generics/generic_const_exprs/issue-80742.stderr index 8d59235e2f448..ce9ce22069409 100644 --- a/tests/ui/const-generics/generic_const_exprs/issue-80742.stderr +++ b/tests/ui/const-generics/generic_const_exprs/issue-80742.stderr @@ -1,7 +1,9 @@ error: internal compiler error: compiler/rustc_const_eval/src/interpret/step.rs:LL:CC: SizeOf MIR operator called for unsized type dyn Debug --> $SRC_DIR/core/src/mem/mod.rs:LL:COL + Box + query stack during panic: #0 [eval_to_allocation_raw] const-evaluating + checking `::{constant#0}` #1 [eval_to_valtree] evaluating type-level constant diff --git a/tests/ui/consts/const-eval/const-eval-query-stack.stderr b/tests/ui/consts/const-eval/const-eval-query-stack.stderr index 96fd9ed5f043b..b15388dec9884 100644 --- a/tests/ui/consts/const-eval/const-eval-query-stack.stderr +++ b/tests/ui/consts/const-eval/const-eval-query-stack.stderr @@ -4,6 +4,8 @@ error: internal compiler error[E0080]: evaluation of constant value failed LL | const X: i32 = 1 / 0; | ^^^^^ attempt to divide `1_i32` by zero + + query stack during panic: #0 [eval_to_allocation_raw] const-evaluating + checking `X` #1 [eval_to_const_value_raw] simplifying constant for the type system `X` diff --git a/tests/ui/extern/extern-types-field-offset.run.stderr b/tests/ui/extern/extern-types-field-offset.run.stderr index 1b04b860db5a6..eab6dc4a122b7 100644 --- a/tests/ui/extern/extern-types-field-offset.run.stderr +++ b/tests/ui/extern/extern-types-field-offset.run.stderr @@ -1,4 +1,6 @@ + thread 'main' panicked at library/core/src/panicking.rs:$LINE:$COL: attempted to compute the size or alignment of extern type `Opaque` + note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace thread caused non-unwinding panic. aborting. diff --git a/tests/ui/extern/extern-types-size_of_val.align.run.stderr b/tests/ui/extern/extern-types-size_of_val.align.run.stderr index 20c4d8785e846..c5aea374e7a2d 100644 --- a/tests/ui/extern/extern-types-size_of_val.align.run.stderr +++ b/tests/ui/extern/extern-types-size_of_val.align.run.stderr @@ -1,4 +1,6 @@ + thread 'main' panicked at library/core/src/panicking.rs:$LINE:$COL: attempted to compute the size or alignment of extern type `A` + note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace thread caused non-unwinding panic. aborting. diff --git a/tests/ui/extern/extern-types-size_of_val.size.run.stderr b/tests/ui/extern/extern-types-size_of_val.size.run.stderr index 20c4d8785e846..c5aea374e7a2d 100644 --- a/tests/ui/extern/extern-types-size_of_val.size.run.stderr +++ b/tests/ui/extern/extern-types-size_of_val.size.run.stderr @@ -1,4 +1,6 @@ + thread 'main' panicked at library/core/src/panicking.rs:$LINE:$COL: attempted to compute the size or alignment of extern type `A` + note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace thread caused non-unwinding panic. aborting. diff --git a/tests/ui/higher-ranked/trait-bounds/future.current.stderr b/tests/ui/higher-ranked/trait-bounds/future.current.stderr index 5a6381ad28eb3..f1af12747d11e 100644 --- a/tests/ui/higher-ranked/trait-bounds/future.current.stderr +++ b/tests/ui/higher-ranked/trait-bounds/future.current.stderr @@ -1,3 +1,5 @@ + + error: the compiler unexpectedly panicked. this is a bug. query stack during panic: diff --git a/tests/ui/hygiene/panic-location.run.stderr b/tests/ui/hygiene/panic-location.run.stderr index 5c1778bc485f9..3bdfa56410b15 100644 --- a/tests/ui/hygiene/panic-location.run.stderr +++ b/tests/ui/hygiene/panic-location.run.stderr @@ -1,3 +1,5 @@ + thread 'main' panicked at library/alloc/src/raw_vec.rs:LL:CC: capacity overflow + note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/intrinsics/const-eval-select-backtrace-std.run.stderr b/tests/ui/intrinsics/const-eval-select-backtrace-std.run.stderr index a0024c0920ff7..20283138f5ebb 100644 --- a/tests/ui/intrinsics/const-eval-select-backtrace-std.run.stderr +++ b/tests/ui/intrinsics/const-eval-select-backtrace-std.run.stderr @@ -1,3 +1,5 @@ + thread 'main' panicked at $DIR/const-eval-select-backtrace-std.rs:6:8: byte index 1 is out of bounds of `` + note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/intrinsics/const-eval-select-backtrace.run.stderr b/tests/ui/intrinsics/const-eval-select-backtrace.run.stderr index 8f38d54146b88..8a9ffedbb4dde 100644 --- a/tests/ui/intrinsics/const-eval-select-backtrace.run.stderr +++ b/tests/ui/intrinsics/const-eval-select-backtrace.run.stderr @@ -1,3 +1,5 @@ + thread 'main' panicked at $DIR/const-eval-select-backtrace.rs:15:5: Aaah! + note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/intrinsics/not-overridden.stderr b/tests/ui/intrinsics/not-overridden.stderr index 9b8849cea1ced..38df45474d029 100644 --- a/tests/ui/intrinsics/not-overridden.stderr +++ b/tests/ui/intrinsics/not-overridden.stderr @@ -4,6 +4,8 @@ error: must be overridden by codegen backend, but isn't LL | unsafe { const_deallocate(std::ptr::null_mut(), 0, 0) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + query stack during panic: end of query stack error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-87707.run.stderr b/tests/ui/issues/issue-87707.run.stderr index 255a77a6ab12c..1757b83e9bf9c 100644 --- a/tests/ui/issues/issue-87707.run.stderr +++ b/tests/ui/issues/issue-87707.run.stderr @@ -1,5 +1,9 @@ + thread 'main' panicked at $DIR/issue-87707.rs:14:24: Here Once instance is poisoned. + note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace + thread 'main' panicked at $DIR/issue-87707.rs:16:7: Once instance has previously been poisoned + diff --git a/tests/ui/layout/valid_range_oob.stderr b/tests/ui/layout/valid_range_oob.stderr index d56804a35a7f4..326313450d9f4 100644 --- a/tests/ui/layout/valid_range_oob.stderr +++ b/tests/ui/layout/valid_range_oob.stderr @@ -1,4 +1,6 @@ + 257 > 255 + error: the compiler unexpectedly panicked. this is a bug. query stack during panic: diff --git a/tests/ui/macros/assert-long-condition.run.stderr b/tests/ui/macros/assert-long-condition.run.stderr index 5c0ff357cb7a7..70d2015e851bf 100644 --- a/tests/ui/macros/assert-long-condition.run.stderr +++ b/tests/ui/macros/assert-long-condition.run.stderr @@ -1,4 +1,6 @@ + thread 'main' panicked at $DIR/assert-long-condition.rs:7:5: assertion failed: 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 == 0 + note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/mir/lint/storage-live.stderr b/tests/ui/mir/lint/storage-live.stderr index 2eb8d8e700010..3592b7567aaaa 100644 --- a/tests/ui/mir/lint/storage-live.stderr +++ b/tests/ui/mir/lint/storage-live.stderr @@ -11,7 +11,9 @@ note: delayed at compiler/rustc_mir_transform/src/lint.rs:97:26 - disabled backt LL | StorageLive(a); | ^^^^^^^^^^^^^^ + aborting due to `-Z treat-err-as-bug=1` + error: the compiler unexpectedly panicked. this is a bug. query stack during panic: diff --git a/tests/ui/panics/fmt-only-once.run.stderr b/tests/ui/panics/fmt-only-once.run.stderr index a991706d34e1a..81f78d5a2184a 100644 --- a/tests/ui/panics/fmt-only-once.run.stderr +++ b/tests/ui/panics/fmt-only-once.run.stderr @@ -1,4 +1,6 @@ fmt + thread 'main' panicked at $DIR/fmt-only-once.rs:20:5: PrintOnFmt + note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/location-detail-panic-no-column.run.stderr b/tests/ui/panics/location-detail-panic-no-column.run.stderr index 6d8d02a3a55fe..337ca80130130 100644 --- a/tests/ui/panics/location-detail-panic-no-column.run.stderr +++ b/tests/ui/panics/location-detail-panic-no-column.run.stderr @@ -1,3 +1,5 @@ + thread 'main' panicked at $DIR/location-detail-panic-no-column.rs:7:0: column-redacted + note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/location-detail-panic-no-file.run.stderr b/tests/ui/panics/location-detail-panic-no-file.run.stderr index 492ad37f5c7c3..e9a8a9788445a 100644 --- a/tests/ui/panics/location-detail-panic-no-file.run.stderr +++ b/tests/ui/panics/location-detail-panic-no-file.run.stderr @@ -1,3 +1,5 @@ + thread 'main' panicked at :7:5: file-redacted + note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/location-detail-panic-no-line.run.stderr b/tests/ui/panics/location-detail-panic-no-line.run.stderr index fdbc43c4311d3..80b1aef34399c 100644 --- a/tests/ui/panics/location-detail-panic-no-line.run.stderr +++ b/tests/ui/panics/location-detail-panic-no-line.run.stderr @@ -1,3 +1,5 @@ + thread 'main' panicked at $DIR/location-detail-panic-no-line.rs:0:5: line-redacted + note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/location-detail-panic-no-location-info.run.stderr b/tests/ui/panics/location-detail-panic-no-location-info.run.stderr index 1e9002df95585..fa2f4f29dc8d2 100644 --- a/tests/ui/panics/location-detail-panic-no-location-info.run.stderr +++ b/tests/ui/panics/location-detail-panic-no-location-info.run.stderr @@ -1,3 +1,5 @@ + thread 'main' panicked at :0:0: no location info + note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/location-detail-unwrap-no-file.run.stderr b/tests/ui/panics/location-detail-unwrap-no-file.run.stderr index 52019f6223329..4dc7ba08cf419 100644 --- a/tests/ui/panics/location-detail-unwrap-no-file.run.stderr +++ b/tests/ui/panics/location-detail-unwrap-no-file.run.stderr @@ -1,3 +1,5 @@ + thread 'main' panicked at :8:9: called `Option::unwrap()` on a `None` value + note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/panic-in-ffi.run.stderr b/tests/ui/panics/panic-in-ffi.run.stderr index a92a66c57fd7d..56da72bfdb2b5 100644 --- a/tests/ui/panics/panic-in-ffi.run.stderr +++ b/tests/ui/panics/panic-in-ffi.run.stderr @@ -1,7 +1,11 @@ + thread 'main' panicked at $DIR/panic-in-ffi.rs:13:5: Test + note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace + thread 'main' panicked at library/core/src/panicking.rs:$LINE:$COL: panic in a function that cannot unwind + stack backtrace: thread caused non-unwinding panic. aborting. diff --git a/tests/ui/proc-macro/load-panic-backtrace.stderr b/tests/ui/proc-macro/load-panic-backtrace.stderr index 18f5135867262..bb8cbbe293b17 100644 --- a/tests/ui/proc-macro/load-panic-backtrace.stderr +++ b/tests/ui/proc-macro/load-panic-backtrace.stderr @@ -1,5 +1,7 @@ + at $DIR/auxiliary/test-macros.rs:43:5: panic-derive + error: proc-macro derive panicked --> $DIR/load-panic-backtrace.rs:11:10 | diff --git a/tests/ui/process/multi-panic.rs b/tests/ui/process/multi-panic.rs index 02b699036541d..e1e4b0b0d2c83 100644 --- a/tests/ui/process/multi-panic.rs +++ b/tests/ui/process/multi-panic.rs @@ -8,12 +8,21 @@ fn check_for_no_backtrace(test: std::process::Output) { let err = String::from_utf8_lossy(&test.stderr); let mut it = err.lines(); + assert_eq!(it.next().map(|l| l.is_empty()), Some(true)); assert_eq!(it.next().map(|l| l.starts_with("thread '' panicked")), Some(true)); assert_eq!(it.next().is_some(), true); - assert_eq!(it.next(), Some("note: run with `RUST_BACKTRACE=1` \ - environment variable to display a backtrace")); + assert_eq!(it.next().map(|l| l.is_empty()), Some(true)); + assert_eq!( + it.next(), + Some( + "note: run with `RUST_BACKTRACE=1` \ + environment variable to display a backtrace" + ) + ); + assert_eq!(it.next().map(|l| l.is_empty()), Some(true)); assert_eq!(it.next().map(|l| l.starts_with("thread 'main' panicked at")), Some(true)); assert_eq!(it.next().is_some(), true); + assert_eq!(it.next().map(|l| l.is_empty()), Some(true)); assert_eq!(it.next(), None); } @@ -22,19 +31,22 @@ fn main() { if args.len() > 1 && args[1] == "run_test" { let _ = std::thread::spawn(|| { panic!(); - }).join(); + }) + .join(); panic!(); } else { - let test = std::process::Command::new(&args[0]).arg("run_test") - .env_remove("RUST_BACKTRACE") - .output() - .unwrap(); + let test = std::process::Command::new(&args[0]) + .arg("run_test") + .env_remove("RUST_BACKTRACE") + .output() + .unwrap(); check_for_no_backtrace(test); - let test = std::process::Command::new(&args[0]).arg("run_test") - .env("RUST_BACKTRACE","0") - .output() - .unwrap(); + let test = std::process::Command::new(&args[0]) + .arg("run_test") + .env("RUST_BACKTRACE", "0") + .output() + .unwrap(); check_for_no_backtrace(test); } } diff --git a/tests/ui/resolve/multiple_definitions_attribute_merging.stderr b/tests/ui/resolve/multiple_definitions_attribute_merging.stderr index b2d20af883abb..0cb710907afb0 100644 --- a/tests/ui/resolve/multiple_definitions_attribute_merging.stderr +++ b/tests/ui/resolve/multiple_definitions_attribute_merging.stderr @@ -16,7 +16,9 @@ LL | #[repr(C)] LL | struct Dealigned(u8, T); | ^ | - = Box + = +Box + query stack during panic: #0 [mir_const] preparing `::eq` for borrow checking #1 [mir_promoted] promoting constants in MIR for `::eq` diff --git a/tests/ui/resolve/proc_macro_generated_packed.stderr b/tests/ui/resolve/proc_macro_generated_packed.stderr index 507e5867c904b..6e8a02de6855b 100644 --- a/tests/ui/resolve/proc_macro_generated_packed.stderr +++ b/tests/ui/resolve/proc_macro_generated_packed.stderr @@ -7,7 +7,9 @@ LL | #[derive(PartialEq)] LL | struct Dealigned(u8, T); | ^ | - = Box + = +Box + query stack during panic: #0 [mir_const] preparing `::eq` for borrow checking #1 [mir_promoted] promoting constants in MIR for `::eq` diff --git a/tests/ui/test-attrs/terse.run.stdout b/tests/ui/test-attrs/terse.run.stdout index 2b361361ae888..644b68232585d 100644 --- a/tests/ui/test-attrs/terse.run.stdout +++ b/tests/ui/test-attrs/terse.run.stdout @@ -9,19 +9,25 @@ foo2 --- FAILED failures: ---- abc stdout ---- + thread 'abc' panicked at $DIR/terse.rs:12:5: explicit panic + note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ---- foo stdout ---- + thread 'foo' panicked at $DIR/terse.rs:17:5: explicit panic + ---- foo2 stdout ---- + thread 'foo2' panicked at $DIR/terse.rs:22:5: explicit panic + failures: abc foo diff --git a/tests/ui/test-attrs/test-panic-abort-nocapture.run.stderr b/tests/ui/test-attrs/test-panic-abort-nocapture.run.stderr index 16001b3eecd4d..c242527bbdd98 100644 --- a/tests/ui/test-attrs/test-panic-abort-nocapture.run.stderr +++ b/tests/ui/test-attrs/test-panic-abort-nocapture.run.stderr @@ -1,11 +1,15 @@ + thread 'main' panicked at $DIR/test-panic-abort-nocapture.rs:34:5: assertion `left == right` failed left: 2 right: 4 + note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace + thread 'main' panicked at $DIR/test-panic-abort-nocapture.rs:28:5: assertion `left == right` failed left: 2 right: 4 + note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace testing321 diff --git a/tests/ui/test-attrs/test-panic-abort.run.stdout b/tests/ui/test-attrs/test-panic-abort.run.stdout index f5d14e77da963..50976bcac1a3e 100644 --- a/tests/ui/test-attrs/test-panic-abort.run.stdout +++ b/tests/ui/test-attrs/test-panic-abort.run.stdout @@ -17,10 +17,12 @@ hello, world testing123 ---- it_fails stderr ---- testing321 + thread 'main' panicked at $DIR/test-panic-abort.rs:39:5: assertion `left == right` failed left: 2 right: 5 + note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/test-attrs/test-thread-capture.run.stdout b/tests/ui/test-attrs/test-thread-capture.run.stdout index 31261aaa23065..74d03610b1a5b 100644 --- a/tests/ui/test-attrs/test-thread-capture.run.stdout +++ b/tests/ui/test-attrs/test-thread-capture.run.stdout @@ -10,8 +10,10 @@ fee fie foe fum + thread 'thready_fail' panicked at $DIR/test-thread-capture.rs:32:5: explicit panic + note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/test-attrs/test-thread-nocapture.run.stderr b/tests/ui/test-attrs/test-thread-nocapture.run.stderr index 9266fe84197ba..080046abcf74d 100644 --- a/tests/ui/test-attrs/test-thread-nocapture.run.stderr +++ b/tests/ui/test-attrs/test-thread-nocapture.run.stderr @@ -1,3 +1,5 @@ + thread 'thready_fail' panicked at $DIR/test-thread-nocapture.rs:32:5: explicit panic + note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/track-diagnostics/track.stderr b/tests/ui/track-diagnostics/track.stderr index 54b1ea2764a5f..b7ae1a1289756 100644 --- a/tests/ui/track-diagnostics/track.stderr +++ b/tests/ui/track-diagnostics/track.stderr @@ -24,8 +24,10 @@ LL | break rust = note: rustc $VERSION running on $TARGET = note: compiler flags: ... -Z ui-testing ... -Z track-diagnostics + thread 'rustc' panicked at compiler/rustc_hir_typeck/src/lib.rs:LL:CC: Box + note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md diff --git a/tests/ui/treat-err-as-bug/err.stderr b/tests/ui/treat-err-as-bug/err.stderr index eb7b50b421033..1e3eaadafe4a9 100644 --- a/tests/ui/treat-err-as-bug/err.stderr +++ b/tests/ui/treat-err-as-bug/err.stderr @@ -4,6 +4,8 @@ error: internal compiler error[E0080]: could not evaluate static initializer LL | pub static C: u32 = 0 - 1; | ^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow + + error: the compiler unexpectedly panicked. this is a bug. query stack during panic: diff --git a/tests/ui/treat-err-as-bug/span_delayed_bug.stderr b/tests/ui/treat-err-as-bug/span_delayed_bug.stderr index f0e8cd0ddb961..74e3b1a1514cb 100644 --- a/tests/ui/treat-err-as-bug/span_delayed_bug.stderr +++ b/tests/ui/treat-err-as-bug/span_delayed_bug.stderr @@ -4,6 +4,8 @@ error: internal compiler error: delayed bug triggered by #[rustc_error(delayed_b LL | fn main() {} | ^^^^^^^^^ + + error: the compiler unexpectedly panicked. this is a bug. query stack during panic: