From 0e729404da1e741e26a398192fcd1614514117cf Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Tue, 20 Jun 2023 19:16:18 +0200 Subject: [PATCH] Change default panic handler message format. --- library/core/src/error.md | 6 ++-- library/core/src/panic/panic_info.rs | 10 +++--- library/std/src/error.rs | 3 +- library/std/src/panicking.rs | 2 +- .../concurrency/unwind_top_of_stack.stderr | 3 +- .../exported_symbol_bad_unwind1.stderr | 3 +- .../exported_symbol_bad_unwind2.both.stderr | 3 +- ...orted_symbol_bad_unwind2.definition.stderr | 3 +- ...ted_symbol_bad_unwind2.extern_block.stderr | 3 +- .../miri/tests/fail/panic/bad_unwind.stderr | 3 +- .../miri/tests/fail/panic/double_panic.stderr | 6 ++-- src/tools/miri/tests/fail/panic/no_std.stderr | 3 +- .../miri/tests/fail/panic/panic_abort1.stderr | 3 +- .../miri/tests/fail/panic/panic_abort2.stderr | 3 +- .../miri/tests/fail/panic/panic_abort3.stderr | 3 +- .../miri/tests/fail/panic/panic_abort4.stderr | 3 +- .../tests/fail/terminate-terminator.stderr | 3 +- .../tests/fail/unwind-action-terminate.stderr | 3 +- .../miri/tests/panic/div-by-zero-2.stderr | 3 +- .../exported_symbol_good_unwind.stderr | 9 +++-- .../miri/tests/panic/oob_subslice.stderr | 3 +- .../tests/panic/overflowing-lsh-neg.stderr | 3 +- .../miri/tests/panic/overflowing-rsh-1.stderr | 3 +- .../miri/tests/panic/overflowing-rsh-2.stderr | 3 +- src/tools/miri/tests/panic/panic1.stderr | 3 +- src/tools/miri/tests/panic/panic2.stderr | 3 +- src/tools/miri/tests/panic/panic3.stderr | 3 +- src/tools/miri/tests/panic/panic4.stderr | 3 +- .../miri/tests/panic/transmute_fat2.stderr | 3 +- .../panic/unsupported_foreign_function.stderr | 3 +- .../tests/panic/unsupported_syscall.stderr | 3 +- .../miri/tests/pass/concurrency/simple.stderr | 6 ++-- .../miri/tests/pass/panic/catch_panic.stderr | 33 ++++++++++++------- .../tests/pass/panic/concurrent-panic.stderr | 6 ++-- .../pass/panic/nested_panic_caught.stderr | 6 ++-- .../run-make/libtest-json/output-default.json | 2 +- .../libtest-json/output-stdout-success.json | 4 +-- .../run-make/libtest-junit/output-default.xml | 2 +- .../libtest-junit/output-stdout-success.xml | 2 +- .../doctest/failed-doctest-output.stdout | 3 +- tests/rustdoc-ui/ice-bug-report-url.stderr | 3 +- ...-65419-async-fn-resume-after-completion.rs | 3 +- ...issue-65419-async-fn-resume-after-panic.rs | 3 +- .../late-bound-vars/in_closure.rs | 2 +- .../const-generics/late-bound-vars/simple.rs | 2 +- .../const-eval/const-eval-query-stack.rs | 2 +- .../issue-90014-tait2.rs | 2 +- tests/ui/higher-ranked/trait-bounds/future.rs | 2 +- tests/ui/hygiene/panic-location.run.stderr | 3 +- tests/ui/impl-trait/issues/issue-86800.rs | 2 +- ...const-eval-select-backtrace-std.run.stderr | 3 +- .../const-eval-select-backtrace.run.stderr | 3 +- tests/ui/issues/issue-87707.run.stderr | 6 ++-- tests/ui/layout/valid_range_oob.stderr | 1 + tests/ui/macros/assert-eq-macro-msg.rs | 4 +-- tests/ui/macros/assert-macro-explicit.rs | 2 +- tests/ui/macros/assert-macro-fmt.rs | 3 +- tests/ui/macros/assert-macro-owned.rs | 3 +- tests/ui/macros/assert-macro-static.rs | 3 +- tests/ui/macros/assert-matches-macro-msg.rs | 4 +-- tests/ui/macros/assert-ne-macro-msg.rs | 4 +-- tests/ui/mir/validate/storage-live.stderr | 1 + tests/ui/nll/issue-51345-2.rs | 3 +- .../ui/numbers-arithmetic/overflowing-add.rs | 3 +- .../ui/numbers-arithmetic/overflowing-mul.rs | 3 +- .../overflowing-neg-nonzero.rs | 2 +- .../ui/numbers-arithmetic/overflowing-neg.rs | 2 +- .../overflowing-pow-signed.rs | 3 +- .../overflowing-pow-unsigned.rs | 3 +- .../ui/numbers-arithmetic/overflowing-sub.rs | 3 +- tests/ui/panics/default-backtrace-ice.stderr | 1 + tests/ui/panics/fmt-only-once.run.stderr | 3 +- ...e-47429-short-backtraces.legacy.run.stderr | 3 +- ...issue-47429-short-backtraces.v0.run.stderr | 3 +- ...location-detail-panic-no-column.run.stderr | 3 +- .../location-detail-panic-no-file.run.stderr | 3 +- .../location-detail-panic-no-line.run.stderr | 3 +- ...n-detail-panic-no-location-info.run.stderr | 3 +- .../location-detail-unwrap-no-file.run.stderr | 3 +- tests/ui/panics/panic-macro-any-wrapped.rs | 3 +- tests/ui/panics/panic-macro-any.rs | 3 +- tests/ui/panics/panic-macro-explicit.rs | 3 +- tests/ui/panics/panic-macro-fmt.rs | 3 +- tests/ui/panics/panic-macro-owned.rs | 3 +- tests/ui/panics/panic-macro-static.rs | 3 +- tests/ui/panics/panic-set-unset-handler.rs | 3 +- tests/ui/panics/panic-take-handler-nop.rs | 3 +- tests/ui/panics/panic-task-name-none.rs | 3 +- tests/ui/panics/panic-task-name-owned.rs | 3 +- .../panics/runtime-switch.legacy.run.stderr | 3 +- tests/ui/panics/runtime-switch.v0.run.stderr | 3 +- ...hort-ice-remove-middle-frames-2.run.stderr | 3 +- .../short-ice-remove-middle-frames.run.stderr | 3 +- .../ui/proc-macro/load-panic-backtrace.stderr | 3 +- tests/ui/process/multi-panic.rs | 4 ++- .../test-panic-abort-nocapture.run.stderr | 10 +++--- .../ui/test-attrs/test-panic-abort.run.stdout | 5 +-- .../test-attrs/test-thread-capture.run.stdout | 3 +- .../test-thread-nocapture.run.stderr | 3 +- tests/ui/threads-sendsync/issue-24313.rs | 2 +- tests/ui/treat-err-as-bug/delay_span_bug.rs | 2 +- tests/ui/treat-err-as-bug/err.rs | 2 +- 102 files changed, 231 insertions(+), 128 deletions(-) diff --git a/library/core/src/error.md b/library/core/src/error.md index 78808d489b25..7771b8adc920 100644 --- a/library/core/src/error.md +++ b/library/core/src/error.md @@ -93,7 +93,8 @@ information that is already communicated by the source error being unwrapped: ```text -thread 'main' panicked at 'env variable `IMPORTANT_PATH` is not set: NotPresent', src/main.rs:4:6 +thread 'main' panicked at src/main.rs:4:6: +env variable `IMPORTANT_PATH` is not set: NotPresent ``` In this example we end up mentioning that an env variable is not set, @@ -109,7 +110,8 @@ prevent the source error, we end up introducing new information that is independent from our source error. ```text -thread 'main' panicked at 'env variable `IMPORTANT_PATH` should be set by `wrapper_script.sh`: NotPresent', src/main.rs:4:6 +thread 'main' panicked at src/main.rs:4:6: +env variable `IMPORTANT_PATH` should be set by `wrapper_script.sh`: NotPresent ``` In this example we are communicating not only the name of the diff --git a/library/core/src/panic/panic_info.rs b/library/core/src/panic/panic_info.rs index 5576adde84b0..c7f04f11ef61 100644 --- a/library/core/src/panic/panic_info.rs +++ b/library/core/src/panic/panic_info.rs @@ -147,16 +147,18 @@ pub fn can_unwind(&self) -> bool { impl fmt::Display for PanicInfo<'_> { fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { formatter.write_str("panicked at ")?; + self.location.fmt(formatter)?; if let Some(message) = self.message { - write!(formatter, "'{}', ", message)? + formatter.write_str(":\n")?; + formatter.write_fmt(*message)?; } else if let Some(payload) = self.payload.downcast_ref::<&'static str>() { - write!(formatter, "'{}', ", payload)? + formatter.write_str(":\n")?; + formatter.write_str(payload)?; } // NOTE: we cannot use downcast_ref::() here // since String is not available in core! // The payload is a String when `std::panic!` is called with multiple arguments, // but in that case the message is also available. - - self.location.fmt(formatter) + Ok(()) } } diff --git a/library/std/src/error.rs b/library/std/src/error.rs index 05f8fd8de327..ee5eddebfaf7 100644 --- a/library/std/src/error.rs +++ b/library/std/src/error.rs @@ -121,7 +121,8 @@ mod private { /// This example produces the following output: /// /// ```console -/// thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: SuperError is here!: SuperErrorSideKick is here!', src/error.rs:34:40 +/// thread 'main' panicked at src/error.rs:34:40: +/// called `Result::unwrap()` on an `Err` value: SuperError is here!: SuperErrorSideKick is here! /// note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace /// ``` /// diff --git a/library/std/src/panicking.rs b/library/std/src/panicking.rs index 15285465c713..6ff7b19f293d 100644 --- a/library/std/src/panicking.rs +++ b/library/std/src/panicking.rs @@ -266,7 +266,7 @@ pub fn panic_hook_with_disk_dump(info: &PanicInfo<'_>, path: Option<&crate::path let name = thread.as_ref().and_then(|t| t.name()).unwrap_or(""); let write = |err: &mut dyn crate::io::Write, backtrace: Option| { - let _ = writeln!(err, "thread '{name}' panicked at '{msg}', {location}"); + let _ = writeln!(err, "thread '{name}' panicked at {location}:\n{msg}"); static FIRST_PANIC: AtomicBool = AtomicBool::new(true); diff --git a/src/tools/miri/tests/fail/concurrency/unwind_top_of_stack.stderr b/src/tools/miri/tests/fail/concurrency/unwind_top_of_stack.stderr index 98db33e3206b..ceb5955922a3 100644 --- a/src/tools/miri/tests/fail/concurrency/unwind_top_of_stack.stderr +++ b/src/tools/miri/tests/fail/concurrency/unwind_top_of_stack.stderr @@ -1,4 +1,5 @@ -thread '' panicked at 'explicit panic', $DIR/unwind_top_of_stack.rs:LL:CC +thread '' panicked at $DIR/unwind_top_of_stack.rs:LL:CC: +explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace error: Undefined Behavior: unwinding past the topmost frame of the stack --> $DIR/unwind_top_of_stack.rs:LL:CC diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind1.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind1.stderr index 7f87ec6f3bb6..f181f90abd3b 100644 --- a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind1.stderr +++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind1.stderr @@ -1,4 +1,5 @@ -thread 'main' panicked at 'explicit panic', $DIR/exported_symbol_bad_unwind1.rs:LL:CC +thread 'main' panicked at $DIR/exported_symbol_bad_unwind1.rs:LL:CC: +explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace error: Undefined Behavior: unwinding past a stack frame that does not allow unwinding --> $DIR/exported_symbol_bad_unwind1.rs:LL:CC diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr index e1631471ae2b..bf5199307f6c 100644 --- a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr +++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr @@ -1,4 +1,5 @@ -thread 'main' panicked at 'explicit panic', $DIR/exported_symbol_bad_unwind2.rs:LL:CC +thread 'main' panicked at $DIR/exported_symbol_bad_unwind2.rs:LL:CC: +explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace error: abnormal termination: panic in a function that cannot unwind --> $DIR/exported_symbol_bad_unwind2.rs:LL:CC diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr index e1631471ae2b..bf5199307f6c 100644 --- a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr +++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr @@ -1,4 +1,5 @@ -thread 'main' panicked at 'explicit panic', $DIR/exported_symbol_bad_unwind2.rs:LL:CC +thread 'main' panicked at $DIR/exported_symbol_bad_unwind2.rs:LL:CC: +explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace error: abnormal termination: panic in a function that cannot unwind --> $DIR/exported_symbol_bad_unwind2.rs:LL:CC diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.extern_block.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.extern_block.stderr index b23c05a53035..c774bd4dd911 100644 --- a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.extern_block.stderr +++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.extern_block.stderr @@ -1,4 +1,5 @@ -thread 'main' panicked at 'explicit panic', $DIR/exported_symbol_bad_unwind2.rs:LL:CC +thread 'main' panicked at $DIR/exported_symbol_bad_unwind2.rs:LL:CC: +explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace error: Undefined Behavior: unwinding past a stack frame that does not allow unwinding --> $DIR/exported_symbol_bad_unwind2.rs:LL:CC diff --git a/src/tools/miri/tests/fail/panic/bad_unwind.stderr b/src/tools/miri/tests/fail/panic/bad_unwind.stderr index 5d7f01f47865..18438c13b211 100644 --- a/src/tools/miri/tests/fail/panic/bad_unwind.stderr +++ b/src/tools/miri/tests/fail/panic/bad_unwind.stderr @@ -1,4 +1,5 @@ -thread 'main' panicked at 'explicit panic', $DIR/bad_unwind.rs:LL:CC +thread 'main' panicked at $DIR/bad_unwind.rs:LL:CC: +explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace error: Undefined Behavior: unwinding past a stack frame that does not allow unwinding --> $DIR/bad_unwind.rs:LL:CC diff --git a/src/tools/miri/tests/fail/panic/double_panic.stderr b/src/tools/miri/tests/fail/panic/double_panic.stderr index b6ac56f15d4b..8e008da75ee8 100644 --- a/src/tools/miri/tests/fail/panic/double_panic.stderr +++ b/src/tools/miri/tests/fail/panic/double_panic.stderr @@ -1,6 +1,8 @@ -thread 'main' panicked at 'first', $DIR/double_panic.rs:LL:CC +thread 'main' panicked at $DIR/double_panic.rs:LL:CC: +first note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace -thread 'main' panicked at 'second', $DIR/double_panic.rs:LL:CC +thread 'main' panicked at $DIR/double_panic.rs:LL:CC: +second stack backtrace: error: abnormal termination: panic in a function that cannot unwind --> $DIR/double_panic.rs:LL:CC diff --git a/src/tools/miri/tests/fail/panic/no_std.stderr b/src/tools/miri/tests/fail/panic/no_std.stderr index f8307c0c23bf..47ec710052a2 100644 --- a/src/tools/miri/tests/fail/panic/no_std.stderr +++ b/src/tools/miri/tests/fail/panic/no_std.stderr @@ -1,4 +1,5 @@ -panicked at 'blarg I am dead', $DIR/no_std.rs:LL:CC +panicked at $DIR/no_std.rs:LL:CC: +blarg I am dead error: abnormal termination: the program aborted execution --> $DIR/no_std.rs:LL:CC | diff --git a/src/tools/miri/tests/fail/panic/panic_abort1.stderr b/src/tools/miri/tests/fail/panic/panic_abort1.stderr index d9303fd0d068..404777344d7a 100644 --- a/src/tools/miri/tests/fail/panic/panic_abort1.stderr +++ b/src/tools/miri/tests/fail/panic/panic_abort1.stderr @@ -1,4 +1,5 @@ -thread 'main' panicked at 'panicking from libstd', $DIR/panic_abort1.rs:LL:CC +thread 'main' panicked at $DIR/panic_abort1.rs:LL:CC: +panicking from libstd note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace error: abnormal termination: the program aborted execution --> RUSTLIB/panic_abort/src/lib.rs:LL:CC diff --git a/src/tools/miri/tests/fail/panic/panic_abort2.stderr b/src/tools/miri/tests/fail/panic/panic_abort2.stderr index 54cbc9b5f6d9..5512d145c6b7 100644 --- a/src/tools/miri/tests/fail/panic/panic_abort2.stderr +++ b/src/tools/miri/tests/fail/panic/panic_abort2.stderr @@ -1,4 +1,5 @@ -thread 'main' panicked at '42-panicking from libstd', $DIR/panic_abort2.rs:LL:CC +thread 'main' panicked at $DIR/panic_abort2.rs:LL:CC: +42-panicking from libstd note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace error: abnormal termination: the program aborted execution --> RUSTLIB/panic_abort/src/lib.rs:LL:CC diff --git a/src/tools/miri/tests/fail/panic/panic_abort3.stderr b/src/tools/miri/tests/fail/panic/panic_abort3.stderr index 64eea47b14b4..9fdccd4e59e4 100644 --- a/src/tools/miri/tests/fail/panic/panic_abort3.stderr +++ b/src/tools/miri/tests/fail/panic/panic_abort3.stderr @@ -1,4 +1,5 @@ -thread 'main' panicked at 'panicking from libcore', $DIR/panic_abort3.rs:LL:CC +thread 'main' panicked at $DIR/panic_abort3.rs:LL:CC: +panicking from libcore note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace error: abnormal termination: the program aborted execution --> RUSTLIB/panic_abort/src/lib.rs:LL:CC diff --git a/src/tools/miri/tests/fail/panic/panic_abort4.stderr b/src/tools/miri/tests/fail/panic/panic_abort4.stderr index 21beb1006459..3c9557ca4ab6 100644 --- a/src/tools/miri/tests/fail/panic/panic_abort4.stderr +++ b/src/tools/miri/tests/fail/panic/panic_abort4.stderr @@ -1,4 +1,5 @@ -thread 'main' panicked at '42-panicking from libcore', $DIR/panic_abort4.rs:LL:CC +thread 'main' panicked at $DIR/panic_abort4.rs:LL:CC: +42-panicking from libcore note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace error: abnormal termination: the program aborted execution --> RUSTLIB/panic_abort/src/lib.rs:LL:CC diff --git a/src/tools/miri/tests/fail/terminate-terminator.stderr b/src/tools/miri/tests/fail/terminate-terminator.stderr index d73e23a53d0d..4f73b599a3f9 100644 --- a/src/tools/miri/tests/fail/terminate-terminator.stderr +++ b/src/tools/miri/tests/fail/terminate-terminator.stderr @@ -1,6 +1,7 @@ warning: You have explicitly enabled MIR optimizations, overriding Miri's default which is to completely disable them. Any optimizations may hide UB that Miri would otherwise detect, and it is not necessarily possible to predict what kind of UB will be missed. If you are enabling optimizations to make Miri run faster, we advise using cfg(miri) to shrink your workload instead. The performance benefit of enabling MIR optimizations is usually marginal at best. -thread 'main' panicked at 'explicit panic', $DIR/terminate-terminator.rs:LL:CC +thread 'main' panicked at $DIR/terminate-terminator.rs:LL:CC: +explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace error: abnormal termination: panic in a function that cannot unwind --> $DIR/terminate-terminator.rs:LL:CC diff --git a/src/tools/miri/tests/fail/unwind-action-terminate.stderr b/src/tools/miri/tests/fail/unwind-action-terminate.stderr index 52a1879cb5fe..daa4a808df9c 100644 --- a/src/tools/miri/tests/fail/unwind-action-terminate.stderr +++ b/src/tools/miri/tests/fail/unwind-action-terminate.stderr @@ -1,4 +1,5 @@ -thread 'main' panicked at 'explicit panic', $DIR/unwind-action-terminate.rs:LL:CC +thread 'main' panicked at $DIR/unwind-action-terminate.rs:LL:CC: +explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace error: abnormal termination: panic in a function that cannot unwind --> $DIR/unwind-action-terminate.rs:LL:CC diff --git a/src/tools/miri/tests/panic/div-by-zero-2.stderr b/src/tools/miri/tests/panic/div-by-zero-2.stderr index 538d87113654..0f088ddd1a54 100644 --- a/src/tools/miri/tests/panic/div-by-zero-2.stderr +++ b/src/tools/miri/tests/panic/div-by-zero-2.stderr @@ -1,2 +1,3 @@ -thread 'main' panicked at 'attempt to divide by zero', $DIR/div-by-zero-2.rs:LL:CC +thread 'main' panicked at $DIR/div-by-zero-2.rs:LL:CC: +attempt to divide by zero note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/src/tools/miri/tests/panic/function_calls/exported_symbol_good_unwind.stderr b/src/tools/miri/tests/panic/function_calls/exported_symbol_good_unwind.stderr index bff897775e8f..acc0e58885f2 100644 --- a/src/tools/miri/tests/panic/function_calls/exported_symbol_good_unwind.stderr +++ b/src/tools/miri/tests/panic/function_calls/exported_symbol_good_unwind.stderr @@ -1,4 +1,7 @@ -thread 'main' panicked at 'explicit panic', $DIR/exported_symbol_good_unwind.rs:LL:CC +thread 'main' panicked at $DIR/exported_symbol_good_unwind.rs:LL:CC: +explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace -thread 'main' panicked at 'explicit panic', $DIR/exported_symbol_good_unwind.rs:LL:CC -thread 'main' panicked at 'explicit panic', $DIR/exported_symbol_good_unwind.rs:LL:CC +thread 'main' panicked at $DIR/exported_symbol_good_unwind.rs:LL:CC: +explicit panic +thread 'main' panicked at $DIR/exported_symbol_good_unwind.rs:LL:CC: +explicit panic diff --git a/src/tools/miri/tests/panic/oob_subslice.stderr b/src/tools/miri/tests/panic/oob_subslice.stderr index 4c6deaeccf61..2bccb60352e0 100644 --- a/src/tools/miri/tests/panic/oob_subslice.stderr +++ b/src/tools/miri/tests/panic/oob_subslice.stderr @@ -1,2 +1,3 @@ -thread 'main' panicked at 'range end index 5 out of range for slice of length 4', $DIR/oob_subslice.rs:LL:CC +thread 'main' panicked at $DIR/oob_subslice.rs:LL:CC: +range end index 5 out of range for slice of length 4 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/src/tools/miri/tests/panic/overflowing-lsh-neg.stderr b/src/tools/miri/tests/panic/overflowing-lsh-neg.stderr index 21e434d873f7..2cff81c58af1 100644 --- a/src/tools/miri/tests/panic/overflowing-lsh-neg.stderr +++ b/src/tools/miri/tests/panic/overflowing-lsh-neg.stderr @@ -1,2 +1,3 @@ -thread 'main' panicked at 'attempt to shift left with overflow', $DIR/overflowing-lsh-neg.rs:LL:CC +thread 'main' panicked at $DIR/overflowing-lsh-neg.rs:LL:CC: +attempt to shift left with overflow note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/src/tools/miri/tests/panic/overflowing-rsh-1.stderr b/src/tools/miri/tests/panic/overflowing-rsh-1.stderr index fd04bf1bd4ec..13117df5fc39 100644 --- a/src/tools/miri/tests/panic/overflowing-rsh-1.stderr +++ b/src/tools/miri/tests/panic/overflowing-rsh-1.stderr @@ -1,2 +1,3 @@ -thread 'main' panicked at 'attempt to shift right with overflow', $DIR/overflowing-rsh-1.rs:LL:CC +thread 'main' panicked at $DIR/overflowing-rsh-1.rs:LL:CC: +attempt to shift right with overflow note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/src/tools/miri/tests/panic/overflowing-rsh-2.stderr b/src/tools/miri/tests/panic/overflowing-rsh-2.stderr index eb568e4d742b..986a66f89918 100644 --- a/src/tools/miri/tests/panic/overflowing-rsh-2.stderr +++ b/src/tools/miri/tests/panic/overflowing-rsh-2.stderr @@ -1,2 +1,3 @@ -thread 'main' panicked at 'attempt to shift right with overflow', $DIR/overflowing-rsh-2.rs:LL:CC +thread 'main' panicked at $DIR/overflowing-rsh-2.rs:LL:CC: +attempt to shift right with overflow note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/src/tools/miri/tests/panic/panic1.stderr b/src/tools/miri/tests/panic/panic1.stderr index 0f4535e6792e..4eb4244d7472 100644 --- a/src/tools/miri/tests/panic/panic1.stderr +++ b/src/tools/miri/tests/panic/panic1.stderr @@ -1,4 +1,5 @@ -thread 'main' panicked at 'panicking from libstd', $DIR/panic1.rs:LL:CC +thread 'main' panicked at $DIR/panic1.rs:LL:CC: +panicking from libstd stack backtrace: 0: std::panicking::begin_panic_handler at RUSTLIB/std/src/panicking.rs:LL:CC diff --git a/src/tools/miri/tests/panic/panic2.stderr b/src/tools/miri/tests/panic/panic2.stderr index c192ca3f64c3..bee1af2bef66 100644 --- a/src/tools/miri/tests/panic/panic2.stderr +++ b/src/tools/miri/tests/panic/panic2.stderr @@ -1,2 +1,3 @@ -thread 'main' panicked at '42-panicking from libstd', $DIR/panic2.rs:LL:CC +thread 'main' panicked at $DIR/panic2.rs:LL:CC: +42-panicking from libstd note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/src/tools/miri/tests/panic/panic3.stderr b/src/tools/miri/tests/panic/panic3.stderr index 0ce4a37fd519..8dac000d291b 100644 --- a/src/tools/miri/tests/panic/panic3.stderr +++ b/src/tools/miri/tests/panic/panic3.stderr @@ -1,2 +1,3 @@ -thread 'main' panicked at 'panicking from libcore', $DIR/panic3.rs:LL:CC +thread 'main' panicked at $DIR/panic3.rs:LL:CC: +panicking from libcore note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/src/tools/miri/tests/panic/panic4.stderr b/src/tools/miri/tests/panic/panic4.stderr index 82df953b61c0..13437fe7f075 100644 --- a/src/tools/miri/tests/panic/panic4.stderr +++ b/src/tools/miri/tests/panic/panic4.stderr @@ -1,2 +1,3 @@ -thread 'main' panicked at '42-panicking from libcore', $DIR/panic4.rs:LL:CC +thread 'main' panicked at $DIR/panic4.rs:LL:CC: +42-panicking from libcore note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/src/tools/miri/tests/panic/transmute_fat2.stderr b/src/tools/miri/tests/panic/transmute_fat2.stderr index f497ab672550..1f09a2c1a082 100644 --- a/src/tools/miri/tests/panic/transmute_fat2.stderr +++ b/src/tools/miri/tests/panic/transmute_fat2.stderr @@ -1,2 +1,3 @@ -thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', $DIR/transmute_fat2.rs:LL:CC +thread 'main' panicked at $DIR/transmute_fat2.rs:LL:CC: +index out of bounds: the len is 0 but the index is 0 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/src/tools/miri/tests/panic/unsupported_foreign_function.stderr b/src/tools/miri/tests/panic/unsupported_foreign_function.stderr index a49dbdae58a6..4db1e2909618 100644 --- a/src/tools/miri/tests/panic/unsupported_foreign_function.stderr +++ b/src/tools/miri/tests/panic/unsupported_foreign_function.stderr @@ -1,2 +1,3 @@ -thread 'main' panicked at 'unsupported Miri functionality: can't call foreign function `foo` on $OS', $DIR/unsupported_foreign_function.rs:LL:CC +thread 'main' panicked at $DIR/unsupported_foreign_function.rs:LL:CC: +unsupported Miri functionality: can't call foreign function `foo` on $OS note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/src/tools/miri/tests/panic/unsupported_syscall.stderr b/src/tools/miri/tests/panic/unsupported_syscall.stderr index 90aa5a907363..40ba6671d5b6 100644 --- a/src/tools/miri/tests/panic/unsupported_syscall.stderr +++ b/src/tools/miri/tests/panic/unsupported_syscall.stderr @@ -1,2 +1,3 @@ -thread 'main' panicked at 'unsupported Miri functionality: can't execute syscall with ID 0', $DIR/unsupported_syscall.rs:LL:CC +thread 'main' panicked at $DIR/unsupported_syscall.rs:LL:CC: +unsupported Miri functionality: can't execute syscall with ID 0 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/src/tools/miri/tests/pass/concurrency/simple.stderr b/src/tools/miri/tests/pass/concurrency/simple.stderr index 028cc0fb736f..33d6b6841ade 100644 --- a/src/tools/miri/tests/pass/concurrency/simple.stderr +++ b/src/tools/miri/tests/pass/concurrency/simple.stderr @@ -1,3 +1,5 @@ -thread '' panicked at 'Hello!', $DIR/simple.rs:LL:CC +thread '' panicked at $DIR/simple.rs:LL:CC: +Hello! note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace -thread 'childthread' panicked at 'Hello, world!', $DIR/simple.rs:LL:CC +thread 'childthread' panicked at $DIR/simple.rs:LL:CC: +Hello, world! diff --git a/src/tools/miri/tests/pass/panic/catch_panic.stderr b/src/tools/miri/tests/pass/panic/catch_panic.stderr index f43434582a29..aa005590db3e 100644 --- a/src/tools/miri/tests/pass/panic/catch_panic.stderr +++ b/src/tools/miri/tests/pass/panic/catch_panic.stderr @@ -1,24 +1,35 @@ -thread 'main' panicked at 'Hello from panic: std', $DIR/catch_panic.rs:LL:CC +thread 'main' panicked at $DIR/catch_panic.rs:LL:CC: +Hello from panic: std note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace Caught panic message (&str): Hello from panic: std -thread 'main' panicked at 'Hello from panic: 1', $DIR/catch_panic.rs:LL:CC +thread 'main' panicked at $DIR/catch_panic.rs:LL:CC: +Hello from panic: 1 Caught panic message (String): Hello from panic: 1 -thread 'main' panicked at 'Hello from panic: 2', $DIR/catch_panic.rs:LL:CC +thread 'main' panicked at $DIR/catch_panic.rs:LL:CC: +Hello from panic: 2 Caught panic message (String): Hello from panic: 2 -thread 'main' panicked at 'Box', $DIR/catch_panic.rs:LL:CC +thread 'main' panicked at $DIR/catch_panic.rs:LL:CC: +Box Failed to get caught panic message. -thread 'main' panicked at 'Hello from panic: core', $DIR/catch_panic.rs:LL:CC +thread 'main' panicked at $DIR/catch_panic.rs:LL:CC: +Hello from panic: core Caught panic message (&str): Hello from panic: core -thread 'main' panicked at 'Hello from panic: 5', $DIR/catch_panic.rs:LL:CC +thread 'main' panicked at $DIR/catch_panic.rs:LL:CC: +Hello from panic: 5 Caught panic message (String): Hello from panic: 5 -thread 'main' panicked at 'index out of bounds: the len is 3 but the index is 4', $DIR/catch_panic.rs:LL:CC +thread 'main' panicked at $DIR/catch_panic.rs:LL:CC: +index out of bounds: the len is 3 but the index is 4 Caught panic message (String): index out of bounds: the len is 3 but the index is 4 -thread 'main' panicked at 'attempt to divide by zero', $DIR/catch_panic.rs:LL:CC +thread 'main' panicked at $DIR/catch_panic.rs:LL:CC: +attempt to divide by zero Caught panic message (&str): attempt to divide by zero -thread 'main' panicked at 'align_offset: align is not a power-of-two', RUSTLIB/core/src/ptr/const_ptr.rs:LL:CC +thread 'main' panicked at RUSTLIB/core/src/ptr/const_ptr.rs:LL:CC: +align_offset: align is not a power-of-two Caught panic message (&str): align_offset: align is not a power-of-two -thread 'main' panicked at 'assertion failed: false', $DIR/catch_panic.rs:LL:CC +thread 'main' panicked at $DIR/catch_panic.rs:LL:CC: +assertion failed: false Caught panic message (&str): assertion failed: false -thread 'main' panicked at 'assertion failed: false', $DIR/catch_panic.rs:LL:CC +thread 'main' panicked at $DIR/catch_panic.rs:LL:CC: +assertion failed: false Caught panic message (&str): assertion failed: false Success! diff --git a/src/tools/miri/tests/pass/panic/concurrent-panic.stderr b/src/tools/miri/tests/pass/panic/concurrent-panic.stderr index fd8fabc89ccc..0bb3dcd8d248 100644 --- a/src/tools/miri/tests/pass/panic/concurrent-panic.stderr +++ b/src/tools/miri/tests/pass/panic/concurrent-panic.stderr @@ -1,10 +1,12 @@ Thread 1 starting, will block on mutex Thread 1 reported it has started -thread '' panicked at 'panic in thread 2', $DIR/concurrent-panic.rs:LL:CC +thread '' panicked at $DIR/concurrent-panic.rs:LL:CC: +panic in thread 2 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace Thread 2 blocking on thread 1 Thread 2 reported it has started Unlocking mutex -thread '' panicked at 'panic in thread 1', $DIR/concurrent-panic.rs:LL:CC +thread '' panicked at $DIR/concurrent-panic.rs:LL:CC: +panic in thread 1 Thread 1 has exited Thread 2 has exited diff --git a/src/tools/miri/tests/pass/panic/nested_panic_caught.stderr b/src/tools/miri/tests/pass/panic/nested_panic_caught.stderr index 4e2593242df7..4684beb33383 100644 --- a/src/tools/miri/tests/pass/panic/nested_panic_caught.stderr +++ b/src/tools/miri/tests/pass/panic/nested_panic_caught.stderr @@ -1,4 +1,6 @@ -thread 'main' panicked at 'once', $DIR/nested_panic_caught.rs:LL:CC +thread 'main' panicked at $DIR/nested_panic_caught.rs:LL:CC: +once note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace -thread 'main' panicked at 'twice', $DIR/nested_panic_caught.rs:LL:CC +thread 'main' panicked at $DIR/nested_panic_caught.rs:LL:CC: +twice stack backtrace: diff --git a/tests/run-make/libtest-json/output-default.json b/tests/run-make/libtest-json/output-default.json index ad22b66eda69..01710f59e5d7 100644 --- a/tests/run-make/libtest-json/output-default.json +++ b/tests/run-make/libtest-json/output-default.json @@ -2,7 +2,7 @@ { "type": "test", "event": "started", "name": "a" } { "type": "test", "name": "a", "event": "ok" } { "type": "test", "event": "started", "name": "b" } -{ "type": "test", "name": "b", "event": "failed", "stdout": "thread 'b' panicked at 'assertion failed: false', f.rs:9:5\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\n" } +{ "type": "test", "name": "b", "event": "failed", "stdout": "thread 'b' panicked at f.rs:9:5:\nassertion failed: false\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\n" } { "type": "test", "event": "started", "name": "c" } { "type": "test", "name": "c", "event": "ok" } { "type": "test", "event": "started", "name": "d" } diff --git a/tests/run-make/libtest-json/output-stdout-success.json b/tests/run-make/libtest-json/output-stdout-success.json index ec98172eb1c4..878eb6c7c260 100644 --- a/tests/run-make/libtest-json/output-stdout-success.json +++ b/tests/run-make/libtest-json/output-stdout-success.json @@ -2,9 +2,9 @@ { "type": "test", "event": "started", "name": "a" } { "type": "test", "name": "a", "event": "ok", "stdout": "print from successful test\n" } { "type": "test", "event": "started", "name": "b" } -{ "type": "test", "name": "b", "event": "failed", "stdout": "thread 'b' panicked at 'assertion failed: false', f.rs:9:5\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\n" } +{ "type": "test", "name": "b", "event": "failed", "stdout": "thread 'b' panicked at f.rs:9:5:\nassertion failed: false\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\n" } { "type": "test", "event": "started", "name": "c" } -{ "type": "test", "name": "c", "event": "ok", "stdout": "thread 'c' panicked at 'assertion failed: false', f.rs:15:5\n" } +{ "type": "test", "name": "c", "event": "ok", "stdout": "thread 'c' panicked at f.rs:15:5:\nassertion failed: false\n" } { "type": "test", "event": "started", "name": "d" } { "type": "test", "name": "d", "event": "ignored", "message": "msg" } { "type": "suite", "event": "failed", "passed": 2, "failed": 1, "ignored": 1, "measured": 0, "filtered_out": 0, "exec_time": $TIME } diff --git a/tests/run-make/libtest-junit/output-default.xml b/tests/run-make/libtest-junit/output-default.xml index d59e07b8ad89..58a9a28744f6 100644 --- a/tests/run-make/libtest-junit/output-default.xml +++ b/tests/run-make/libtest-junit/output-default.xml @@ -1 +1 @@ - + diff --git a/tests/run-make/libtest-junit/output-stdout-success.xml b/tests/run-make/libtest-junit/output-stdout-success.xml index 0c300611e1f7..723816a4acda 100644 --- a/tests/run-make/libtest-junit/output-stdout-success.xml +++ b/tests/run-make/libtest-junit/output-stdout-success.xml @@ -1 +1 @@ - + diff --git a/tests/rustdoc-ui/doctest/failed-doctest-output.stdout b/tests/rustdoc-ui/doctest/failed-doctest-output.stdout index 630198a561af..840c9c5084c2 100644 --- a/tests/rustdoc-ui/doctest/failed-doctest-output.stdout +++ b/tests/rustdoc-ui/doctest/failed-doctest-output.stdout @@ -26,7 +26,8 @@ stdout 2 stderr: stderr 1 stderr 2 -thread 'main' panicked at 'oh no', $DIR/failed-doctest-output.rs:7:1 +thread 'main' panicked at $DIR/failed-doctest-output.rs:7:1: +oh no note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/rustdoc-ui/ice-bug-report-url.stderr b/tests/rustdoc-ui/ice-bug-report-url.stderr index 7d9f05f8f4ed..d454e296b388 100644 --- a/tests/rustdoc-ui/ice-bug-report-url.stderr +++ b/tests/rustdoc-ui/ice-bug-report-url.stderr @@ -4,7 +4,8 @@ error: expected one of `->`, `where`, or `{`, found `` LL | fn wrong() | ^ expected one of `->`, `where`, or `{` -thread panicked at 'aborting due to `-Z treat-err-as-bug`' +thread 'rustc' panicked at compiler/rustc_errors/src/lib.rs:1711:30: +aborting due to `-Z treat-err-as-bug=1` stack backtrace: error: the compiler unexpectedly panicked. this is a bug. diff --git a/tests/ui/async-await/issues/issue-65419/issue-65419-async-fn-resume-after-completion.rs b/tests/ui/async-await/issues/issue-65419/issue-65419-async-fn-resume-after-completion.rs index ade386a605dc..725caddae0b2 100644 --- a/tests/ui/async-await/issues/issue-65419/issue-65419-async-fn-resume-after-completion.rs +++ b/tests/ui/async-await/issues/issue-65419/issue-65419-async-fn-resume-after-completion.rs @@ -2,7 +2,8 @@ // be talking about `async fn`s instead. // run-fail -// error-pattern: thread 'main' panicked at '`async fn` resumed after completion' +// error-pattern: thread 'main' panicked +// error-pattern: `async fn` resumed after completion // edition:2018 // ignore-wasm no panic or subprocess support // ignore-emscripten no panic or subprocess support diff --git a/tests/ui/async-await/issues/issue-65419/issue-65419-async-fn-resume-after-panic.rs b/tests/ui/async-await/issues/issue-65419/issue-65419-async-fn-resume-after-panic.rs index b4ea4c9f6866..5909c3a5ecc0 100644 --- a/tests/ui/async-await/issues/issue-65419/issue-65419-async-fn-resume-after-panic.rs +++ b/tests/ui/async-await/issues/issue-65419/issue-65419-async-fn-resume-after-panic.rs @@ -3,7 +3,8 @@ // run-fail // needs-unwind -// error-pattern: thread 'main' panicked at '`async fn` resumed after panicking' +// error-pattern: thread 'main' panicked +// error-pattern: `async fn` resumed after panicking // edition:2018 // ignore-wasm no panic or subprocess support diff --git a/tests/ui/const-generics/late-bound-vars/in_closure.rs b/tests/ui/const-generics/late-bound-vars/in_closure.rs index 00fb535f0487..772a821ca8ae 100644 --- a/tests/ui/const-generics/late-bound-vars/in_closure.rs +++ b/tests/ui/const-generics/late-bound-vars/in_closure.rs @@ -8,7 +8,7 @@ // normalize-stderr-test "note: we would appreciate a bug report.*\n\n" -> "" // normalize-stderr-test "note: compiler flags.*\n\n" -> "" // normalize-stderr-test "note: rustc.*running on.*\n\n" -> "" -// normalize-stderr-test "thread.*panicked.*\n" -> "" +// normalize-stderr-test "thread.*panicked.*:\n.*\n" -> "" // normalize-stderr-test "stack backtrace:\n" -> "" // normalize-stderr-test "\s\d{1,}: .*\n" -> "" // normalize-stderr-test "\s at .*\n" -> "" diff --git a/tests/ui/const-generics/late-bound-vars/simple.rs b/tests/ui/const-generics/late-bound-vars/simple.rs index 5d19aaf0b955..99a2c345c33b 100644 --- a/tests/ui/const-generics/late-bound-vars/simple.rs +++ b/tests/ui/const-generics/late-bound-vars/simple.rs @@ -8,7 +8,7 @@ // normalize-stderr-test "note: we would appreciate a bug report.*\n\n" -> "" // normalize-stderr-test "note: compiler flags.*\n\n" -> "" // normalize-stderr-test "note: rustc.*running on.*\n\n" -> "" -// normalize-stderr-test "thread.*panicked.*\n" -> "" +// normalize-stderr-test "thread.*panicked.*:\n.*\n" -> "" // normalize-stderr-test "stack backtrace:\n" -> "" // normalize-stderr-test "\s\d{1,}: .*\n" -> "" // normalize-stderr-test "\s at .*\n" -> "" diff --git a/tests/ui/consts/const-eval/const-eval-query-stack.rs b/tests/ui/consts/const-eval/const-eval-query-stack.rs index 81f28c1755de..266d15938af4 100644 --- a/tests/ui/consts/const-eval/const-eval-query-stack.rs +++ b/tests/ui/consts/const-eval/const-eval-query-stack.rs @@ -5,7 +5,7 @@ // normalize-stderr-test "note: we would appreciate a bug report.*\n\n" -> "" // normalize-stderr-test "note: compiler flags.*\n\n" -> "" // normalize-stderr-test "note: rustc.*running on.*\n\n" -> "" -// normalize-stderr-test "thread.*panicked.*\n" -> "" +// normalize-stderr-test "thread.*panicked.*:\n.*\n" -> "" // normalize-stderr-test "stack backtrace:\n" -> "" // normalize-stderr-test "\s\d{1,}: .*\n" -> "" // normalize-stderr-test "\s at .*\n" -> "" diff --git a/tests/ui/generic-associated-types/issue-90014-tait2.rs b/tests/ui/generic-associated-types/issue-90014-tait2.rs index dacbc93dec88..c7000b75e3b2 100644 --- a/tests/ui/generic-associated-types/issue-90014-tait2.rs +++ b/tests/ui/generic-associated-types/issue-90014-tait2.rs @@ -11,7 +11,7 @@ // normalize-stderr-test "note: we would appreciate a bug report.*\n\n" -> "" // normalize-stderr-test "note: compiler flags.*\n\n" -> "" // normalize-stderr-test "note: rustc.*running on.*\n\n" -> "" -// normalize-stderr-test "thread.*panicked.*\n" -> "" +// normalize-stderr-test "thread.*panicked.*:\n.*\n" -> "" // normalize-stderr-test "stack backtrace:\n" -> "" // normalize-stderr-test "\s\d{1,}: .*\n" -> "" // normalize-stderr-test "\s at .*\n" -> "" diff --git a/tests/ui/higher-ranked/trait-bounds/future.rs b/tests/ui/higher-ranked/trait-bounds/future.rs index da7ee0343291..61d86a9cb239 100644 --- a/tests/ui/higher-ranked/trait-bounds/future.rs +++ b/tests/ui/higher-ranked/trait-bounds/future.rs @@ -7,7 +7,7 @@ //[classic] build-fail //[classic] failure-status: 101 //[classic] normalize-stderr-test "note: .*\n\n" -> "" -//[classic] normalize-stderr-test "thread 'rustc' panicked.*\n" -> "" +//[classic] normalize-stderr-test "thread 'rustc' panicked.*\n.*\n" -> "" //[classic] normalize-stderr-test "(error: internal compiler error: [^:]+):\d+:\d+: " -> "$1:LL:CC: " //[classic] rustc-env:RUST_BACKTRACE=0 diff --git a/tests/ui/hygiene/panic-location.run.stderr b/tests/ui/hygiene/panic-location.run.stderr index 55923cc5f6f8..5ed0d9fcf1ef 100644 --- a/tests/ui/hygiene/panic-location.run.stderr +++ b/tests/ui/hygiene/panic-location.run.stderr @@ -1,2 +1,3 @@ -thread 'main' panicked at 'capacity overflow', library/alloc/src/raw_vec.rs:534:5 +thread 'main' panicked at library/alloc/src/raw_vec.rs:534:5: +capacity overflow note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/impl-trait/issues/issue-86800.rs b/tests/ui/impl-trait/issues/issue-86800.rs index ec4fda322d04..df70b324c5ec 100644 --- a/tests/ui/impl-trait/issues/issue-86800.rs +++ b/tests/ui/impl-trait/issues/issue-86800.rs @@ -5,7 +5,7 @@ // error-pattern: aborting due to `-Z treat-err-as-bug=1` // failure-status:101 // normalize-stderr-test ".*note: .*\n\n" -> "" -// normalize-stderr-test "thread 'rustc' panicked.*\n" -> "" +// normalize-stderr-test "thread 'rustc' panicked.*:\n.*\n" -> "" // rustc-env:RUST_BACKTRACE=0 use std::future::Future; 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 463cd52c5aa7..69c7491b2af5 100644 --- a/tests/ui/intrinsics/const-eval-select-backtrace-std.run.stderr +++ b/tests/ui/intrinsics/const-eval-select-backtrace-std.run.stderr @@ -1,2 +1,3 @@ -thread 'main' panicked at 'byte index 1 is out of bounds of ``', $DIR/const-eval-select-backtrace-std.rs:6:6 +thread 'main' panicked at $DIR/const-eval-select-backtrace-std.rs:6:6: +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 54e28db5e533..3f196bd8abc3 100644 --- a/tests/ui/intrinsics/const-eval-select-backtrace.run.stderr +++ b/tests/ui/intrinsics/const-eval-select-backtrace.run.stderr @@ -1,2 +1,3 @@ -thread 'main' panicked at 'Aaah!', $DIR/const-eval-select-backtrace.rs:17:9 +thread 'main' panicked at $DIR/const-eval-select-backtrace.rs:17:9: +Aaah! note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/issues/issue-87707.run.stderr b/tests/ui/issues/issue-87707.run.stderr index 527c78ba89e9..255a77a6ab12 100644 --- a/tests/ui/issues/issue-87707.run.stderr +++ b/tests/ui/issues/issue-87707.run.stderr @@ -1,3 +1,5 @@ -thread 'main' panicked at 'Here Once instance is poisoned.', $DIR/issue-87707.rs:14:24 +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 'Once instance has previously been poisoned', $DIR/issue-87707.rs:16:7 +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 a3a514fb8309..d56804a35a7f 100644 --- a/tests/ui/layout/valid_range_oob.stderr +++ b/tests/ui/layout/valid_range_oob.stderr @@ -1,3 +1,4 @@ +257 > 255 error: the compiler unexpectedly panicked. this is a bug. query stack during panic: diff --git a/tests/ui/macros/assert-eq-macro-msg.rs b/tests/ui/macros/assert-eq-macro-msg.rs index accbd2d1e7f5..cb21d5e7ed63 100644 --- a/tests/ui/macros/assert-eq-macro-msg.rs +++ b/tests/ui/macros/assert-eq-macro-msg.rs @@ -1,7 +1,7 @@ // run-fail -// error-pattern:panicked at 'assertion failed: `(left == right)` +// error-pattern:assertion failed: `(left == right)` // error-pattern: left: `2` -// error-pattern:right: `3`: 1 + 1 definitely should be 3' +// error-pattern:right: `3`: 1 + 1 definitely should be 3 // ignore-emscripten no processes fn main() { diff --git a/tests/ui/macros/assert-macro-explicit.rs b/tests/ui/macros/assert-macro-explicit.rs index 578ef5632780..3d1a9a6b1ad1 100644 --- a/tests/ui/macros/assert-macro-explicit.rs +++ b/tests/ui/macros/assert-macro-explicit.rs @@ -1,5 +1,5 @@ // run-fail -// error-pattern:panicked at 'assertion failed: false' +// error-pattern:assertion failed: false // ignore-emscripten no processes fn main() { diff --git a/tests/ui/macros/assert-macro-fmt.rs b/tests/ui/macros/assert-macro-fmt.rs index b8d319d85f40..ceec53ceb9f5 100644 --- a/tests/ui/macros/assert-macro-fmt.rs +++ b/tests/ui/macros/assert-macro-fmt.rs @@ -1,5 +1,6 @@ // run-fail -// error-pattern:panicked at 'test-assert-fmt 42 rust' +// error-pattern: panicked +// error-pattern: test-assert-fmt 42 rust // ignore-emscripten no processes fn main() { diff --git a/tests/ui/macros/assert-macro-owned.rs b/tests/ui/macros/assert-macro-owned.rs index 753675872b9c..fb4b389b80b8 100644 --- a/tests/ui/macros/assert-macro-owned.rs +++ b/tests/ui/macros/assert-macro-owned.rs @@ -1,5 +1,6 @@ // run-fail -// error-pattern:panicked at 'test-assert-owned' +// error-pattern:panicked +// error-pattern:test-assert-owned // ignore-emscripten no processes #![allow(non_fmt_panics)] diff --git a/tests/ui/macros/assert-macro-static.rs b/tests/ui/macros/assert-macro-static.rs index dc5274a7e888..fccc3259281f 100644 --- a/tests/ui/macros/assert-macro-static.rs +++ b/tests/ui/macros/assert-macro-static.rs @@ -1,5 +1,6 @@ // run-fail -// error-pattern:panicked at 'test-assert-static' +// error-pattern:panicked +// error-pattern:test-assert-static // ignore-emscripten no processes fn main() { diff --git a/tests/ui/macros/assert-matches-macro-msg.rs b/tests/ui/macros/assert-matches-macro-msg.rs index fd8cd5a1a056..0f63de6cfffb 100644 --- a/tests/ui/macros/assert-matches-macro-msg.rs +++ b/tests/ui/macros/assert-matches-macro-msg.rs @@ -1,7 +1,7 @@ // run-fail -// error-pattern:panicked at 'assertion failed: `(left matches right)` +// error-pattern:assertion failed: `(left matches right)` // error-pattern: left: `2` -// error-pattern:right: `3`: 1 + 1 definitely should be 3' +// error-pattern:right: `3`: 1 + 1 definitely should be 3 // ignore-emscripten no processes #![feature(assert_matches)] diff --git a/tests/ui/macros/assert-ne-macro-msg.rs b/tests/ui/macros/assert-ne-macro-msg.rs index fc0472b99b42..7e390d24a23e 100644 --- a/tests/ui/macros/assert-ne-macro-msg.rs +++ b/tests/ui/macros/assert-ne-macro-msg.rs @@ -1,7 +1,7 @@ // run-fail -// error-pattern:panicked at 'assertion failed: `(left != right)` +// error-pattern:assertion failed: `(left != right)` // error-pattern: left: `2` -// error-pattern:right: `2`: 1 + 1 definitely should not be 2' +// error-pattern:right: `2`: 1 + 1 definitely should not be 2 // ignore-emscripten no processes fn main() { diff --git a/tests/ui/mir/validate/storage-live.stderr b/tests/ui/mir/validate/storage-live.stderr index 720fb0a90b08..1037ddc88ef6 100644 --- a/tests/ui/mir/validate/storage-live.stderr +++ b/tests/ui/mir/validate/storage-live.stderr @@ -5,6 +5,7 @@ error: internal compiler error: broken MIR in Item(DefId(0:8 ~ storage_live[HASH 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/nll/issue-51345-2.rs b/tests/ui/nll/issue-51345-2.rs index 52f342a85005..77a944a7b7e2 100644 --- a/tests/ui/nll/issue-51345-2.rs +++ b/tests/ui/nll/issue-51345-2.rs @@ -1,5 +1,6 @@ // run-fail -// error-pattern: thread 'main' panicked at 'explicit panic' +// error-pattern:thread 'main' panicked +// error-pattern:explicit panic // ignore-emscripten no processes fn main() { diff --git a/tests/ui/numbers-arithmetic/overflowing-add.rs b/tests/ui/numbers-arithmetic/overflowing-add.rs index b0f22a74b4a8..c45b44966edb 100644 --- a/tests/ui/numbers-arithmetic/overflowing-add.rs +++ b/tests/ui/numbers-arithmetic/overflowing-add.rs @@ -1,5 +1,6 @@ // run-fail -// error-pattern:thread 'main' panicked at 'attempt to add with overflow' +// error-pattern:thread 'main' panicked +// error-pattern:attempt to add with overflow // compile-flags: -C debug-assertions // ignore-emscripten no processes diff --git a/tests/ui/numbers-arithmetic/overflowing-mul.rs b/tests/ui/numbers-arithmetic/overflowing-mul.rs index 34ab5d8fad5e..ec5279d321cd 100644 --- a/tests/ui/numbers-arithmetic/overflowing-mul.rs +++ b/tests/ui/numbers-arithmetic/overflowing-mul.rs @@ -1,5 +1,6 @@ // run-fail -// error-pattern:thread 'main' panicked at 'attempt to multiply with overflow' +// error-pattern:thread 'main' panicked +// error-pattern:attempt to multiply with overflow // ignore-emscripten no processes // compile-flags: -C debug-assertions diff --git a/tests/ui/numbers-arithmetic/overflowing-neg-nonzero.rs b/tests/ui/numbers-arithmetic/overflowing-neg-nonzero.rs index 565b7e86fc4b..dabb0d50cbb5 100644 --- a/tests/ui/numbers-arithmetic/overflowing-neg-nonzero.rs +++ b/tests/ui/numbers-arithmetic/overflowing-neg-nonzero.rs @@ -1,5 +1,5 @@ // run-fail -// error-pattern:thread 'main' panicked at 'attempt to negate with overflow' +// error-pattern:attempt to negate with overflow // ignore-emscripten no processes // compile-flags: -C debug-assertions diff --git a/tests/ui/numbers-arithmetic/overflowing-neg.rs b/tests/ui/numbers-arithmetic/overflowing-neg.rs index df1198053036..530243753934 100644 --- a/tests/ui/numbers-arithmetic/overflowing-neg.rs +++ b/tests/ui/numbers-arithmetic/overflowing-neg.rs @@ -1,5 +1,5 @@ // run-fail -// error-pattern:thread 'main' panicked at 'attempt to negate with overflow' +// error-pattern:attempt to negate with overflow // ignore-emscripten no processes // compile-flags: -C debug-assertions diff --git a/tests/ui/numbers-arithmetic/overflowing-pow-signed.rs b/tests/ui/numbers-arithmetic/overflowing-pow-signed.rs index b59efe6f2127..c2c8cad5f0b7 100644 --- a/tests/ui/numbers-arithmetic/overflowing-pow-signed.rs +++ b/tests/ui/numbers-arithmetic/overflowing-pow-signed.rs @@ -1,5 +1,6 @@ // run-fail -// error-pattern:thread 'main' panicked at 'attempt to multiply with overflow' +// error-pattern:thread 'main' panicked +// error-pattern:attempt to multiply with overflow // ignore-emscripten no processes // compile-flags: -C debug-assertions diff --git a/tests/ui/numbers-arithmetic/overflowing-pow-unsigned.rs b/tests/ui/numbers-arithmetic/overflowing-pow-unsigned.rs index f2643c164631..4a0f9abd982e 100644 --- a/tests/ui/numbers-arithmetic/overflowing-pow-unsigned.rs +++ b/tests/ui/numbers-arithmetic/overflowing-pow-unsigned.rs @@ -1,5 +1,6 @@ // run-fail -// error-pattern:thread 'main' panicked at 'attempt to multiply with overflow' +// error-pattern:thread 'main' panicked +// error-pattern:attempt to multiply with overflow // ignore-emscripten no processes // compile-flags: -C debug-assertions diff --git a/tests/ui/numbers-arithmetic/overflowing-sub.rs b/tests/ui/numbers-arithmetic/overflowing-sub.rs index 66685ac961a1..119d80748027 100644 --- a/tests/ui/numbers-arithmetic/overflowing-sub.rs +++ b/tests/ui/numbers-arithmetic/overflowing-sub.rs @@ -1,5 +1,6 @@ // run-fail -// error-pattern:thread 'main' panicked at 'attempt to subtract with overflow' +// error-pattern:thread 'main' panicked +// error-pattern:attempt to subtract with overflow // ignore-emscripten no processes // compile-flags: -C debug-assertions diff --git a/tests/ui/panics/default-backtrace-ice.stderr b/tests/ui/panics/default-backtrace-ice.stderr index 815ce4dd0152..4b00f1350475 100644 --- a/tests/ui/panics/default-backtrace-ice.stderr +++ b/tests/ui/panics/default-backtrace-ice.stderr @@ -5,6 +5,7 @@ LL | fn main() { missing_ident; } | ^^^^^^^^^^^^^ not found in this scope +aborting due to `-Z treat-err-as-bug=1` stack backtrace: (end_short_backtrace) (begin_short_backtrace) diff --git a/tests/ui/panics/fmt-only-once.run.stderr b/tests/ui/panics/fmt-only-once.run.stderr index 39bd06881ad0..a991706d34e1 100644 --- a/tests/ui/panics/fmt-only-once.run.stderr +++ b/tests/ui/panics/fmt-only-once.run.stderr @@ -1,3 +1,4 @@ fmt -thread 'main' panicked at 'PrintOnFmt', $DIR/fmt-only-once.rs:20:5 +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/issue-47429-short-backtraces.legacy.run.stderr b/tests/ui/panics/issue-47429-short-backtraces.legacy.run.stderr index ac4ed8225bd8..dce91ce59e3a 100644 --- a/tests/ui/panics/issue-47429-short-backtraces.legacy.run.stderr +++ b/tests/ui/panics/issue-47429-short-backtraces.legacy.run.stderr @@ -1,4 +1,5 @@ -thread 'main' panicked at 'explicit panic', $DIR/issue-47429-short-backtraces.rs:23:5 +thread 'main' panicked at $DIR/issue-47429-short-backtraces.rs:23:5: +explicit panic stack backtrace: 0: std::panicking::begin_panic 1: issue_47429_short_backtraces::main diff --git a/tests/ui/panics/issue-47429-short-backtraces.v0.run.stderr b/tests/ui/panics/issue-47429-short-backtraces.v0.run.stderr index 65401fe1c3d8..f458c7acb39f 100644 --- a/tests/ui/panics/issue-47429-short-backtraces.v0.run.stderr +++ b/tests/ui/panics/issue-47429-short-backtraces.v0.run.stderr @@ -1,4 +1,5 @@ -thread 'main' panicked at 'explicit panic', $DIR/issue-47429-short-backtraces.rs:23:5 +thread 'main' panicked at $DIR/issue-47429-short-backtraces.rs:23:5: +explicit panic stack backtrace: 0: std::panicking::begin_panic::<&str> 1: issue_47429_short_backtraces::main 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 46c9b8448d7e..6d8d02a3a55f 100644 --- a/tests/ui/panics/location-detail-panic-no-column.run.stderr +++ b/tests/ui/panics/location-detail-panic-no-column.run.stderr @@ -1,2 +1,3 @@ -thread 'main' panicked at 'column-redacted', $DIR/location-detail-panic-no-column.rs:7:0 +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 811f93bf3085..492ad37f5c7c 100644 --- a/tests/ui/panics/location-detail-panic-no-file.run.stderr +++ b/tests/ui/panics/location-detail-panic-no-file.run.stderr @@ -1,2 +1,3 @@ -thread 'main' panicked at 'file-redacted', :7: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 cc3f1624c49a..fdbc43c4311d 100644 --- a/tests/ui/panics/location-detail-panic-no-line.run.stderr +++ b/tests/ui/panics/location-detail-panic-no-line.run.stderr @@ -1,2 +1,3 @@ -thread 'main' panicked at 'line-redacted', $DIR/location-detail-panic-no-line.rs:0: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 d1c3108643c6..1e9002df9558 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,2 +1,3 @@ -thread 'main' panicked at 'no location info', :0:0 +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 7d8e1d93038a..52019f622332 100644 --- a/tests/ui/panics/location-detail-unwrap-no-file.run.stderr +++ b/tests/ui/panics/location-detail-unwrap-no-file.run.stderr @@ -1,2 +1,3 @@ -thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', :8:9 +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-macro-any-wrapped.rs b/tests/ui/panics/panic-macro-any-wrapped.rs index 663bf6713d09..1815a0d2c10f 100644 --- a/tests/ui/panics/panic-macro-any-wrapped.rs +++ b/tests/ui/panics/panic-macro-any-wrapped.rs @@ -1,5 +1,6 @@ // run-fail -// error-pattern:panicked at 'Box' +// error-pattern:panicked +// error-pattern:Box // ignore-emscripten no processes #![allow(non_fmt_panics)] diff --git a/tests/ui/panics/panic-macro-any.rs b/tests/ui/panics/panic-macro-any.rs index c7df5365474e..1bc3c336c3f3 100644 --- a/tests/ui/panics/panic-macro-any.rs +++ b/tests/ui/panics/panic-macro-any.rs @@ -1,5 +1,6 @@ // run-fail -// error-pattern:panicked at 'Box' +// error-pattern:panicked +// error-pattern:Box // ignore-emscripten no processes #![allow(non_fmt_panics)] diff --git a/tests/ui/panics/panic-macro-explicit.rs b/tests/ui/panics/panic-macro-explicit.rs index ac4d6f8128b8..b5b6c7675ac3 100644 --- a/tests/ui/panics/panic-macro-explicit.rs +++ b/tests/ui/panics/panic-macro-explicit.rs @@ -1,5 +1,6 @@ // run-fail -// error-pattern:panicked at 'explicit panic' +// error-pattern:panicked +// error-pattern:explicit panic // ignore-emscripten no processes fn main() { diff --git a/tests/ui/panics/panic-macro-fmt.rs b/tests/ui/panics/panic-macro-fmt.rs index a755ebc0f4e3..0796d33eae0c 100644 --- a/tests/ui/panics/panic-macro-fmt.rs +++ b/tests/ui/panics/panic-macro-fmt.rs @@ -1,5 +1,6 @@ // run-fail -// error-pattern:panicked at 'test-fail-fmt 42 rust' +// error-pattern:panicked +// error-pattern:test-fail-fmt 42 rust // ignore-emscripten no processes fn main() { diff --git a/tests/ui/panics/panic-macro-owned.rs b/tests/ui/panics/panic-macro-owned.rs index b898fde77a3b..522c87e1c314 100644 --- a/tests/ui/panics/panic-macro-owned.rs +++ b/tests/ui/panics/panic-macro-owned.rs @@ -1,5 +1,6 @@ // run-fail -// error-pattern:panicked at 'test-fail-owned' +// error-pattern:panicked +// error-pattern:test-fail-owned // ignore-emscripten no processes fn main() { diff --git a/tests/ui/panics/panic-macro-static.rs b/tests/ui/panics/panic-macro-static.rs index a1d467cbfb52..06ec5b0ad307 100644 --- a/tests/ui/panics/panic-macro-static.rs +++ b/tests/ui/panics/panic-macro-static.rs @@ -1,5 +1,6 @@ // run-fail -// error-pattern:panicked at 'test-fail-static' +// error-pattern:panicked +// error-pattern:test-fail-static // ignore-emscripten no processes fn main() { diff --git a/tests/ui/panics/panic-set-unset-handler.rs b/tests/ui/panics/panic-set-unset-handler.rs index dde0c72f7655..91f69f0a69e3 100644 --- a/tests/ui/panics/panic-set-unset-handler.rs +++ b/tests/ui/panics/panic-set-unset-handler.rs @@ -1,5 +1,6 @@ // run-fail -// error-pattern:thread 'main' panicked at 'foobar' +// error-pattern:thread 'main' panicked +// error-pattern:foobar // ignore-emscripten no processes use std::panic; diff --git a/tests/ui/panics/panic-take-handler-nop.rs b/tests/ui/panics/panic-take-handler-nop.rs index 41cbac97c443..d14a3244e610 100644 --- a/tests/ui/panics/panic-take-handler-nop.rs +++ b/tests/ui/panics/panic-take-handler-nop.rs @@ -1,5 +1,6 @@ // run-fail -// error-pattern:thread 'main' panicked at 'foobar' +// error-pattern:thread 'main' panicked +// error-pattern:foobar // ignore-emscripten no processes use std::panic; diff --git a/tests/ui/panics/panic-task-name-none.rs b/tests/ui/panics/panic-task-name-none.rs index 4e95fb5bdb80..3fb0f3412f6b 100644 --- a/tests/ui/panics/panic-task-name-none.rs +++ b/tests/ui/panics/panic-task-name-none.rs @@ -1,5 +1,6 @@ // run-fail -// error-pattern:thread '' panicked at 'test' +// error-pattern:thread '' panicked +// error-pattern:test // ignore-emscripten Needs threads use std::thread; diff --git a/tests/ui/panics/panic-task-name-owned.rs b/tests/ui/panics/panic-task-name-owned.rs index f85be7bb8e29..d5274ebbc4b4 100644 --- a/tests/ui/panics/panic-task-name-owned.rs +++ b/tests/ui/panics/panic-task-name-owned.rs @@ -1,5 +1,6 @@ // run-fail -// error-pattern:thread 'owned name' panicked at 'test' +// error-pattern:thread 'owned name' panicked +// error-pattern:test // ignore-emscripten Needs threads. use std::thread::Builder; diff --git a/tests/ui/panics/runtime-switch.legacy.run.stderr b/tests/ui/panics/runtime-switch.legacy.run.stderr index 0f76551630cc..bd05b6cc00fb 100644 --- a/tests/ui/panics/runtime-switch.legacy.run.stderr +++ b/tests/ui/panics/runtime-switch.legacy.run.stderr @@ -1,4 +1,5 @@ -thread 'main' panicked at 'explicit panic', $DIR/runtime-switch.rs:26:5 +thread 'main' panicked at $DIR/runtime-switch.rs:26:5: +explicit panic stack backtrace: 0: std::panicking::begin_panic 1: runtime_switch::main diff --git a/tests/ui/panics/runtime-switch.v0.run.stderr b/tests/ui/panics/runtime-switch.v0.run.stderr index a4ae441317da..2078c356d5cd 100644 --- a/tests/ui/panics/runtime-switch.v0.run.stderr +++ b/tests/ui/panics/runtime-switch.v0.run.stderr @@ -1,4 +1,5 @@ -thread 'main' panicked at 'explicit panic', $DIR/runtime-switch.rs:26:5 +thread 'main' panicked at $DIR/runtime-switch.rs:26:5: +explicit panic stack backtrace: 0: std::panicking::begin_panic::<&str> 1: runtime_switch::main diff --git a/tests/ui/panics/short-ice-remove-middle-frames-2.run.stderr b/tests/ui/panics/short-ice-remove-middle-frames-2.run.stderr index 2592b7479186..f7b46f0bd644 100644 --- a/tests/ui/panics/short-ice-remove-middle-frames-2.run.stderr +++ b/tests/ui/panics/short-ice-remove-middle-frames-2.run.stderr @@ -1,4 +1,5 @@ -thread 'main' panicked at 'debug!!!', $DIR/short-ice-remove-middle-frames-2.rs:56:5 +thread 'main' panicked at $DIR/short-ice-remove-middle-frames-2.rs:56:5: +debug!!! stack backtrace: 0: std::panicking::begin_panic 1: short_ice_remove_middle_frames_2::eight diff --git a/tests/ui/panics/short-ice-remove-middle-frames.run.stderr b/tests/ui/panics/short-ice-remove-middle-frames.run.stderr index 9c15f2e08fee..bc389f23d18e 100644 --- a/tests/ui/panics/short-ice-remove-middle-frames.run.stderr +++ b/tests/ui/panics/short-ice-remove-middle-frames.run.stderr @@ -1,4 +1,5 @@ -thread 'main' panicked at 'debug!!!', $DIR/short-ice-remove-middle-frames.rs:52:5 +thread 'main' panicked at $DIR/short-ice-remove-middle-frames.rs:52:5: +debug!!! stack backtrace: 0: std::panicking::begin_panic 1: short_ice_remove_middle_frames::seven diff --git a/tests/ui/proc-macro/load-panic-backtrace.stderr b/tests/ui/proc-macro/load-panic-backtrace.stderr index 45d4fd1c9bc4..c1a642713d29 100644 --- a/tests/ui/proc-macro/load-panic-backtrace.stderr +++ b/tests/ui/proc-macro/load-panic-backtrace.stderr @@ -1,4 +1,5 @@ -at 'panic-derive', $DIR/auxiliary/test-macros.rs:43:5 +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 a1887c2180ec..c240dc18fd36 100644 --- a/tests/ui/process/multi-panic.rs +++ b/tests/ui/process/multi-panic.rs @@ -8,10 +8,12 @@ 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.starts_with("thread '' panicked at")), 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.starts_with("thread 'main' panicked at")), Some(true)); + assert_eq!(it.next().is_some(), true); assert_eq!(it.next(), None); } 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 727e9691c53a..8c3f5a07f56f 100644 --- a/tests/ui/test-attrs/test-panic-abort-nocapture.run.stderr +++ b/tests/ui/test-attrs/test-panic-abort-nocapture.run.stderr @@ -1,9 +1,11 @@ -thread 'main' panicked at 'assertion failed: `(left == right)` +thread 'main' panicked at $DIR/test-panic-abort-nocapture.rs:33:5: +assertion failed: `(left == right)` left: `2`, - right: `4`', $DIR/test-panic-abort-nocapture.rs:33:5 + right: `4` note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace -thread 'main' panicked at 'assertion failed: `(left == right)` +thread 'main' panicked at $DIR/test-panic-abort-nocapture.rs:27:5: +assertion failed: `(left == right)` left: `2`, - right: `4`', $DIR/test-panic-abort-nocapture.rs:27:5 + 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 b6b9c2560fe5..785407dfa0ba 100644 --- a/tests/ui/test-attrs/test-panic-abort.run.stdout +++ b/tests/ui/test-attrs/test-panic-abort.run.stdout @@ -17,9 +17,10 @@ hello, world testing123 ---- it_fails stderr ---- testing321 -thread 'main' panicked at 'assertion failed: `(left == right)` +thread 'main' panicked at $DIR/test-panic-abort.rs:38:5: +assertion failed: `(left == right)` left: `2`, - right: `5`', $DIR/test-panic-abort.rs:38:5 + 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 513c8cf2add0..31261aaa2306 100644 --- a/tests/ui/test-attrs/test-thread-capture.run.stdout +++ b/tests/ui/test-attrs/test-thread-capture.run.stdout @@ -10,7 +10,8 @@ fee fie foe fum -thread 'thready_fail' panicked at 'explicit panic', $DIR/test-thread-capture.rs:32:5 +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 8c905d1af857..9266fe84197b 100644 --- a/tests/ui/test-attrs/test-thread-nocapture.run.stderr +++ b/tests/ui/test-attrs/test-thread-nocapture.run.stderr @@ -1,2 +1,3 @@ -thread 'thready_fail' panicked at 'explicit panic', $DIR/test-thread-nocapture.rs:32: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/threads-sendsync/issue-24313.rs b/tests/ui/threads-sendsync/issue-24313.rs index c28b4ca96014..6694bac0dc73 100644 --- a/tests/ui/threads-sendsync/issue-24313.rs +++ b/tests/ui/threads-sendsync/issue-24313.rs @@ -19,7 +19,7 @@ fn main() { if args.len() == 1 { let out = Command::new(&args[0]).arg("test").output().unwrap(); let stderr = std::str::from_utf8(&out.stderr).unwrap(); - assert!(stderr.contains("panicked at 'explicit panic'"), + assert!(stderr.contains("explicit panic"), "bad failure message:\n{}\n", stderr); } else { // TLS dtors are not always run on process exit diff --git a/tests/ui/treat-err-as-bug/delay_span_bug.rs b/tests/ui/treat-err-as-bug/delay_span_bug.rs index 832afddf8914..533c8d1ec8f5 100644 --- a/tests/ui/treat-err-as-bug/delay_span_bug.rs +++ b/tests/ui/treat-err-as-bug/delay_span_bug.rs @@ -3,7 +3,7 @@ // error-pattern: aborting due to `-Z treat-err-as-bug=1` // error-pattern: [trigger_delay_span_bug] triggering a delay span bug // normalize-stderr-test "note: .*\n\n" -> "" -// normalize-stderr-test "thread 'rustc' panicked.*\n" -> "" +// normalize-stderr-test "thread 'rustc' panicked.*:\n.*\n" -> "" // rustc-env:RUST_BACKTRACE=0 #![feature(rustc_attrs)] diff --git a/tests/ui/treat-err-as-bug/err.rs b/tests/ui/treat-err-as-bug/err.rs index de3e9ed6cf91..4090a706f99b 100644 --- a/tests/ui/treat-err-as-bug/err.rs +++ b/tests/ui/treat-err-as-bug/err.rs @@ -3,7 +3,7 @@ // error-pattern: aborting due to `-Z treat-err-as-bug=1` // error-pattern: [eval_to_allocation_raw] const-evaluating + checking `C` // normalize-stderr-test "note: .*\n\n" -> "" -// normalize-stderr-test "thread 'rustc' panicked.*\n" -> "" +// normalize-stderr-test "thread 'rustc' panicked.*:\n.*\n" -> "" // rustc-env:RUST_BACKTRACE=0 #![crate_type = "rlib"]