From 0e729404da1e741e26a398192fcd1614514117cf Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Tue, 20 Jun 2023 19:16:18 +0200 Subject: [PATCH 1/4] 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 78808d489b2..7771b8adc92 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 5576adde84b..c7f04f11ef6 100644 --- a/library/core/src/panic/panic_info.rs +++ b/library/core/src/panic/panic_info.rs @@ -147,16 +147,18 @@ impl<'a> PanicInfo<'a> { 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 05f8fd8de32..ee5eddebfaf 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 15285465c71..6ff7b19f293 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 98db33e3206..ceb5955922a 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 7f87ec6f3bb..f181f90abd3 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 e1631471ae2..bf5199307f6 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 e1631471ae2..bf5199307f6 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 b23c05a5303..c774bd4dd91 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 5d7f01f4786..18438c13b21 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 b6ac56f15d4..8e008da75ee 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 f8307c0c23b..47ec710052a 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 d9303fd0d06..404777344d7 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 54cbc9b5f6d..5512d145c6b 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 64eea47b14b..9fdccd4e59e 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 21beb100645..3c9557ca4ab 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 d73e23a53d0..4f73b599a3f 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 52a1879cb5f..daa4a808df9 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 538d8711365..0f088ddd1a5 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 bff897775e8..acc0e58885f 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 4c6deaeccf6..2bccb60352e 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 21e434d873f..2cff81c58af 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 fd04bf1bd4e..13117df5fc3 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 eb568e4d742..986a66f8991 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 0f4535e6792..4eb4244d747 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 c192ca3f64c..bee1af2bef6 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 0ce4a37fd51..8dac000d291 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 82df953b61c..13437fe7f07 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 f497ab67255..1f09a2c1a08 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 a49dbdae58a..4db1e290961 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 90aa5a90736..40ba6671d5b 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 028cc0fb736..33d6b6841ad 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 f43434582a2..aa005590db3 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 fd8fabc89cc..0bb3dcd8d24 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 4e2593242df..4684beb3338 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 ad22b66eda6..01710f59e5d 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 ec98172eb1c..878eb6c7c26 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 d59e07b8ad8..58a9a28744f 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 0c300611e1f..723816a4acd 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 630198a561a..840c9c5084c 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 7d9f05f8f4e..d454e296b38 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 ade386a605d..725caddae0b 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 b4ea4c9f686..5909c3a5ecc 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 00fb535f048..772a821ca8a 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 5d19aaf0b95..99a2c345c33 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 81f28c1755d..266d15938af 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 dacbc93dec8..c7000b75e3b 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 da7ee034329..61d86a9cb23 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 55923cc5f6f..5ed0d9fcf1e 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 ec4fda322d0..df70b324c5e 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 463cd52c5aa..69c7491b2af 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 54e28db5e53..3f196bd8abc 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 527c78ba89e..255a77a6ab1 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 a3a514fb830..d56804a35a7 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 accbd2d1e7f..cb21d5e7ed6 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 578ef563278..3d1a9a6b1ad 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 b8d319d85f4..ceec53ceb9f 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 753675872b9..fb4b389b80b 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 dc5274a7e88..fccc3259281 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 fd8cd5a1a05..0f63de6cfff 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 fc0472b99b4..7e390d24a23 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 720fb0a90b0..1037ddc88ef 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 52f342a8500..77a944a7b7e 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 b0f22a74b4a..c45b44966ed 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 34ab5d8fad5..ec5279d321c 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 565b7e86fc4..dabb0d50cbb 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 df119805303..53024375393 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 b59efe6f212..c2c8cad5f0b 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 f2643c16463..4a0f9abd982 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 66685ac961a..119d8074802 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 815ce4dd015..4b00f135047 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 39bd06881ad..a991706d34e 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 ac4ed8225bd..dce91ce59e3 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 65401fe1c3d..f458c7acb39 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 46c9b8448d7..6d8d02a3a55 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 811f93bf308..492ad37f5c7 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 cc3f1624c49..fdbc43c4311 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 d1c3108643c..1e9002df955 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 7d8e1d93038..52019f62233 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 663bf6713d0..1815a0d2c10 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 c7df5365474..1bc3c336c3f 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 ac4d6f8128b..b5b6c7675ac 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 a755ebc0f4e..0796d33eae0 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 b898fde77a3..522c87e1c31 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 a1d467cbfb5..06ec5b0ad30 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 dde0c72f765..91f69f0a69e 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 41cbac97c44..d14a3244e61 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 4e95fb5bdb8..3fb0f3412f6 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 f85be7bb8e2..d5274ebbc4b 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 0f76551630c..bd05b6cc00f 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 a4ae441317d..2078c356d5c 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 2592b747918..f7b46f0bd64 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 9c15f2e08fe..bc389f23d18 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 45d4fd1c9bc..c1a642713d2 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 a1887c2180e..c240dc18fd3 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 727e9691c53..8c3f5a07f56 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 b6b9c2560fe..785407dfa0b 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 513c8cf2add..31261aaa230 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 8c905d1af85..9266fe84197 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 c28b4ca9601..6694bac0dc7 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 832afddf891..533c8d1ec8f 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 de3e9ed6cf9..4090a706f99 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"] From 893bb8e1ce0721524be9853c55c3b80b871eebea Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Thu, 27 Jul 2023 12:46:07 +0200 Subject: [PATCH 2/4] Fix test output. --- .../miri/tests/fail/panic/thread_local_const_drop_panic.stderr | 3 ++- src/tools/miri/tests/fail/panic/thread_local_drop_panic.stderr | 3 ++- tests/rustdoc-ui/ice-bug-report-url.rs | 2 +- tests/rustdoc-ui/ice-bug-report-url.stderr | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/tools/miri/tests/fail/panic/thread_local_const_drop_panic.stderr b/src/tools/miri/tests/fail/panic/thread_local_const_drop_panic.stderr index 47962e44adf..550d009607d 100644 --- a/src/tools/miri/tests/fail/panic/thread_local_const_drop_panic.stderr +++ b/src/tools/miri/tests/fail/panic/thread_local_const_drop_panic.stderr @@ -1,4 +1,5 @@ -thread $NAME panicked at 'ow', $DIR/thread_local_const_drop_panic.rs:LL:CC +thread $NAME panicked at $DIR/thread_local_const_drop_panic.rs:LL:CC: +ow fatal runtime error: thread local panicked on drop error: abnormal termination: the program aborted execution diff --git a/src/tools/miri/tests/fail/panic/thread_local_drop_panic.stderr b/src/tools/miri/tests/fail/panic/thread_local_drop_panic.stderr index 2a56e2b9c87..3d6c41faabc 100644 --- a/src/tools/miri/tests/fail/panic/thread_local_drop_panic.stderr +++ b/src/tools/miri/tests/fail/panic/thread_local_drop_panic.stderr @@ -1,4 +1,5 @@ -thread $NAME panicked at 'ow', $DIR/thread_local_drop_panic.rs:LL:CC +thread $NAME panicked at $DIR/thread_local_drop_panic.rs:LL:CC: +ow fatal runtime error: thread local panicked on drop error: abnormal termination: the program aborted execution diff --git a/tests/rustdoc-ui/ice-bug-report-url.rs b/tests/rustdoc-ui/ice-bug-report-url.rs index 7689d78d31f..a3fa819ab5e 100644 --- a/tests/rustdoc-ui/ice-bug-report-url.rs +++ b/tests/rustdoc-ui/ice-bug-report-url.rs @@ -6,7 +6,7 @@ // normalize-stderr-test "note: compiler flags.*\n\n" -> "" // normalize-stderr-test "note: rustc.*running on.*" -> "note: rustc {version} running on {platform}" -// normalize-stderr-test "thread.*panicked at .*, compiler.*" -> "thread panicked at 'aborting due to `-Z treat-err-as-bug`'" +// normalize-stderr-test "thread.*panicked at compiler.*" -> "" // normalize-stderr-test " +\d{1,}: .*\n" -> "" // normalize-stderr-test " + at .*\n" -> "" // normalize-stderr-test ".*note: Some details are omitted.*\n" -> "" diff --git a/tests/rustdoc-ui/ice-bug-report-url.stderr b/tests/rustdoc-ui/ice-bug-report-url.stderr index d454e296b38..869fcd20fac 100644 --- a/tests/rustdoc-ui/ice-bug-report-url.stderr +++ b/tests/rustdoc-ui/ice-bug-report-url.stderr @@ -4,7 +4,7 @@ error: expected one of `->`, `where`, or `{`, found `` LL | fn wrong() | ^ expected one of `->`, `where`, or `{` -thread 'rustc' panicked at compiler/rustc_errors/src/lib.rs:1711:30: + aborting due to `-Z treat-err-as-bug=1` stack backtrace: From 4017c5c945e043b1e8d3ab03b4c7cc071178dadd Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Sat, 29 Jul 2023 11:47:26 +0200 Subject: [PATCH 3/4] Fix tests. --- tests/ui/consts/precise-drop-with-promoted.rs | 2 +- tests/ui/process/println-with-broken-pipe.run.stderr | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/ui/consts/precise-drop-with-promoted.rs b/tests/ui/consts/precise-drop-with-promoted.rs index 5da325afb72..0c0514dd9d5 100644 --- a/tests/ui/consts/precise-drop-with-promoted.rs +++ b/tests/ui/consts/precise-drop-with-promoted.rs @@ -3,7 +3,7 @@ // known-bug: #103507 // failure-status: 101 // normalize-stderr-test "note: .*\n\n" -> "" -// normalize-stderr-test "thread 'rustc' panicked.*\n" -> "" +// normalize-stderr-test "thread 'rustc' panicked.*\n.*\n" -> "" // normalize-stderr-test "(error: internal compiler error: [^:]+):\d+:\d+: " -> "$1:LL:CC: " // rustc-env:RUST_BACKTRACE=0 diff --git a/tests/ui/process/println-with-broken-pipe.run.stderr b/tests/ui/process/println-with-broken-pipe.run.stderr index ebcd920d501..a334c0ad204 100644 --- a/tests/ui/process/println-with-broken-pipe.run.stderr +++ b/tests/ui/process/println-with-broken-pipe.run.stderr @@ -1,2 +1,3 @@ -thread 'main' panicked at 'failed printing to stdout: Broken pipe (os error 32)', library/std/src/io/stdio.rs:LL:CC +thread 'main' panicked at library/std/src/io/stdio.rs:LL:CC: +failed printing to stdout: Broken pipe (os error 32) note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace From 2c5ecf22a2aaaecf0bfc9f3f94259913a1d00c74 Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Mon, 31 Jul 2023 17:05:11 -0400 Subject: [PATCH 4/4] Fix windows test output. --- tests/rustdoc-ui/doctest/failed-doctest-output-windows.stdout | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/rustdoc-ui/doctest/failed-doctest-output-windows.stdout b/tests/rustdoc-ui/doctest/failed-doctest-output-windows.stdout index 6c147054da3..f4bfb94e98c 100644 --- a/tests/rustdoc-ui/doctest/failed-doctest-output-windows.stdout +++ b/tests/rustdoc-ui/doctest/failed-doctest-output-windows.stdout @@ -26,7 +26,8 @@ stdout 2 stderr: stderr 1 stderr 2 -thread 'main' panicked at 'oh no', $DIR/failed-doctest-output-windows.rs:7:1 +thread 'main' panicked at $DIR/failed-doctest-output-windows.rs:7:1: +oh no note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace