diff --git a/library/core/src/error.md b/library/core/src/error.md index 78808d489b25a..7771b8adc920b 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 5576adde84b03..c7f04f11ef618 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 05f8fd8de327f..ee5eddebfaf7c 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 15285465c713a..6ff7b19f293d3 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 98db33e3206bd..ceb5955922a3f 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 7f87ec6f3bb69..f181f90abd3b8 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 e1631471ae2be..bf5199307f6ce 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 e1631471ae2be..bf5199307f6ce 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 b23c05a530357..c774bd4dd9112 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 5d7f01f478656..18438c13b2118 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 b6ac56f15d4b5..8e008da75ee87 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 f8307c0c23bf8..47ec710052a25 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 d9303fd0d0684..404777344d7a8 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 54cbc9b5f6d96..5512d145c6b7d 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 64eea47b14b4b..9fdccd4e59e4b 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 21beb1006459b..3c9557ca4ab61 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/panic/thread_local_const_drop_panic.stderr b/src/tools/miri/tests/fail/panic/thread_local_const_drop_panic.stderr index 47962e44adf64..550d009607d13 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 2a56e2b9c877a..3d6c41faabc40 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/src/tools/miri/tests/fail/terminate-terminator.stderr b/src/tools/miri/tests/fail/terminate-terminator.stderr index d73e23a53d0d9..4f73b599a3f9b 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 52a1879cb5fef..daa4a808df9ce 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 538d87113654d..0f088ddd1a544 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 bff897775e8f6..acc0e58885f23 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 4c6deaeccf615..2bccb60352e0a 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 21e434d873f7b..2cff81c58af10 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 fd04bf1bd4ec3..13117df5fc39a 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 eb568e4d742bc..986a66f899188 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 0f4535e6792e6..4eb4244d7472c 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 c192ca3f64c36..bee1af2bef662 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 0ce4a37fd5197..8dac000d291bc 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 82df953b61c03..13437fe7f0751 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 f497ab672550f..1f09a2c1a082c 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 a49dbdae58a6f..4db1e2909618a 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 90aa5a9073638..40ba6671d5b6d 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 028cc0fb736ff..33d6b6841ade6 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 f43434582a299..aa005590db3ee 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 fd8fabc89cccf..0bb3dcd8d248c 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 4e2593242df75..4684beb33383a 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 ad22b66eda69f..01710f59e5d74 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 ec98172eb1c4e..878eb6c7c260d 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 d59e07b8ad89d..58a9a28744f6a 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 0c300611e1f76..723816a4acdaa 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-windows.stdout b/tests/rustdoc-ui/doctest/failed-doctest-output-windows.stdout index 6c147054da322..f4bfb94e98cae 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 diff --git a/tests/rustdoc-ui/doctest/failed-doctest-output.stdout b/tests/rustdoc-ui/doctest/failed-doctest-output.stdout index 630198a561af0..840c9c5084c23 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.rs b/tests/rustdoc-ui/ice-bug-report-url.rs index 7689d78d31f33..a3fa819ab5e10 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 7d9f05f8f4ed0..869fcd20fac8e 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`' + +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 ade386a605dca..725caddae0b20 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 b4ea4c9f68664..5909c3a5ecc06 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 00fb535f04879..772a821ca8aec 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 5d19aaf0b9555..99a2c345c33b0 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 81f28c1755deb..266d15938af46 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/consts/precise-drop-with-promoted.rs b/tests/ui/consts/precise-drop-with-promoted.rs index 5da325afb72b2..0c0514dd9d531 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/generic-associated-types/issue-90014-tait2.rs b/tests/ui/generic-associated-types/issue-90014-tait2.rs index dacbc93dec880..c7000b75e3b2a 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 da7ee0343291e..61d86a9cb2390 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 55923cc5f6f87..5ed0d9fcf1ef1 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 ec4fda322d04f..df70b324c5ec7 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 463cd52c5aa7b..69c7491b2af5d 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 54e28db5e533d..3f196bd8abc39 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 527c78ba89e91..255a77a6ab12c 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 a3a514fb83095..d56804a35a7f4 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 accbd2d1e7f50..cb21d5e7ed634 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 578ef5632780f..3d1a9a6b1ad1c 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 b8d319d85f404..ceec53ceb9f54 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 753675872b9ca..fb4b389b80b83 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 dc5274a7e8880..fccc3259281f9 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 fd8cd5a1a0566..0f63de6cfffbc 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 fc0472b99b428..7e390d24a23e1 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 720fb0a90b08b..1037ddc88ef65 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 52f342a85005e..77a944a7b7e27 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 b0f22a74b4a8f..c45b44966edb4 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 34ab5d8fad5e6..ec5279d321cdb 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 565b7e86fc4b9..dabb0d50cbb5a 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 df1198053036d..530243753934f 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 b59efe6f21278..c2c8cad5f0b78 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 f2643c1646316..4a0f9abd982ea 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 66685ac961a17..119d80748027b 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 815ce4dd01528..4b00f13504758 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 39bd06881ad05..a991706d34e1a 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 ac4ed8225bd82..dce91ce59e3a1 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 65401fe1c3d80..f458c7acb39fd 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 46c9b8448d7e4..6d8d02a3a55fe 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 811f93bf3085f..492ad37f5c7c3 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 cc3f1624c49ab..fdbc43c4311d3 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 d1c3108643c6c..1e9002df95585 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 7d8e1d93038a3..52019f6223329 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 663bf6713d090..1815a0d2c10fc 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 c7df5365474e9..1bc3c336c3f3b 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 ac4d6f8128b87..b5b6c7675ac35 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 a755ebc0f4e3a..0796d33eae0c2 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 b898fde77a3b6..522c87e1c3141 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 a1d467cbfb524..06ec5b0ad3076 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 dde0c72f76550..91f69f0a69e35 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 41cbac97c443f..d14a3244e610d 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 4e95fb5bdb803..3fb0f3412f6b8 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 f85be7bb8e299..d5274ebbc4b4d 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 0f76551630cca..bd05b6cc00fb1 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 a4ae441317dac..2078c356d5cd7 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 2592b7479186a..f7b46f0bd6442 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 9c15f2e08feed..bc389f23d18e2 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 45d4fd1c9bc4c..c1a642713d29f 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 a1887c2180ecf..c240dc18fd366 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/process/println-with-broken-pipe.run.stderr b/tests/ui/process/println-with-broken-pipe.run.stderr index ebcd920d501ff..a334c0ad20473 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 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 727e9691c53a1..8c3f5a07f56f7 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 b6b9c2560fe5c..785407dfa0baa 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 513c8cf2add00..31261aaa23065 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 8c905d1af8572..9266fe84197ba 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 c28b4ca96014b..6694bac0dc730 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 832afddf89147..533c8d1ec8f51 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 de3e9ed6cf910..4090a706f99b3 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"]