authorbors <bors@rust-lang.org> 2025-08-07 02:32:55 UTC
committerbors <bors@rust-lang.org> 2025-08-07 02:32:55 UTC
log61cb1e97fcf954c37d0a457a8084ed9ad8b3cb82
tree107887d30f4041adae19af258f83ca2dc0fb5d93
parent6bcdcc73bd11568fd85f5a38b58e1eda054ad1cd
parent289fe36d373c5a13fa7f1b93f39ff88425ab2351

Auto merge of #115746 - tgross35:unnamed-threads-panic-message, r=cuviper

Print thread ID in panic message `panic!` does not print any identifying information for threads that are unnamed. However, in many cases, the thread ID can be determined. This changes the panic message from something like this: thread '<unnamed>' panicked at src/main.rs:3:5: explicit panic To something like this: thread '<unnamed>' (12345) panicked at src/main.rs:3:5: explicit panic Stack overflow messages are updated as well. This change applies to both named and unnamed threads. The ID printed is the OS integer thread ID rather than the Rust thread ID, which should also be what debuggers print. try-job: aarch64-apple try-job: aarch64-gnu try-job: dist-apple-various try-job: dist-various-* try-job: dist-x86_64-freebsd try-job: dist-x86_64-illumos try-job: dist-x86_64-netbsd try-job: dist-x86_64-solaris try-job: test-various try-job: x86_64-gnu try-job: x86_64-mingw-1 try-job: x86_64-msvc-1

124 files changed, 318 insertions(+), 169 deletions(-)

library/std/src/panicking.rs+2-1
......@@ -269,6 +269,7 @@ fn default_hook(info: &PanicHookInfo<'_>) {
269269
270270 thread::with_current_name(|name| {
271271 let name = name.unwrap_or("<unnamed>");
272 let tid = thread::current_os_id();
272273
273274 // Try to write the panic message to a buffer first to prevent other concurrent outputs
274275 // interleaving with it.
......@@ -277,7 +278,7 @@ fn default_hook(info: &PanicHookInfo<'_>) {
277278
278279 let write_msg = |dst: &mut dyn crate::io::Write| {
279280 // We add a newline to ensure the panic message appears at the start of a line.
280 writeln!(dst, "\nthread '{name}' panicked at {location}:\n{msg}")
281 writeln!(dst, "\nthread '{name}' ({tid}) panicked at {location}:\n{msg}")
281282 };
282283
283284 if write_msg(&mut cursor).is_ok() {
library/std/src/sys/pal/hermit/thread.rs+4
......@@ -115,6 +115,10 @@ impl Thread {
115115 }
116116}
117117
118pub(crate) fn current_os_id() -> Option<u64> {
119 None
120}
121
118122pub fn available_parallelism() -> io::Result<NonZero<usize>> {
119123 unsafe { Ok(NonZero::new_unchecked(hermit_abi::available_parallelism())) }
120124}
library/std/src/sys/pal/itron/thread.rs+4
......@@ -361,6 +361,10 @@ unsafe fn terminate_and_delete_current_task() -> ! {
361361 unsafe { crate::hint::unreachable_unchecked() };
362362}
363363
364pub(crate) fn current_os_id() -> Option<u64> {
365 None
366}
367
364368pub fn available_parallelism() -> io::Result<NonZero<usize>> {
365369 super::unsupported()
366370}
library/std/src/sys/pal/sgx/thread.rs+5-1
......@@ -1,6 +1,6 @@
11#![cfg_attr(test, allow(dead_code))] // why is this necessary?
22
3use super::abi::usercalls;
3use super::abi::{thread, usercalls};
44use super::unsupported;
55use crate::ffi::CStr;
66use crate::io;
......@@ -149,6 +149,10 @@ impl Thread {
149149 }
150150}
151151
152pub(crate) fn current_os_id() -> Option<u64> {
153 Some(thread::current().addr().get() as u64)
154}
155
152156pub fn available_parallelism() -> io::Result<NonZero<usize>> {
153157 unsupported()
154158}
library/std/src/sys/pal/teeos/thread.rs+4
......@@ -144,6 +144,10 @@ impl Drop for Thread {
144144 }
145145}
146146
147pub(crate) fn current_os_id() -> Option<u64> {
148 None
149}
150
147151// Note: Both `sched_getaffinity` and `sysconf` are available but not functional on
148152// teeos, so this function always returns an Error!
149153pub fn available_parallelism() -> io::Result<NonZero<usize>> {
library/std/src/sys/pal/uefi/thread.rs+4
......@@ -56,6 +56,10 @@ impl Thread {
5656 }
5757}
5858
59pub(crate) fn current_os_id() -> Option<u64> {
60 None
61}
62
5963pub fn available_parallelism() -> io::Result<NonZero<usize>> {
6064 // UEFI is single threaded
6165 Ok(NonZero::new(1).unwrap())
library/std/src/sys/pal/unix/stack_overflow.rs+4-2
......@@ -119,7 +119,8 @@ mod imp {
119119 && thread_info.guard_page_range.contains(&fault_addr)
120120 {
121121 let name = thread_info.thread_name.as_deref().unwrap_or("<unknown>");
122 rtprintpanic!("\nthread '{name}' has overflowed its stack\n");
122 let tid = crate::thread::current_os_id();
123 rtprintpanic!("\nthread '{name}' ({tid}) has overflowed its stack\n");
123124 rtabort!("stack overflow");
124125 }
125126 })
......@@ -696,7 +697,8 @@ mod imp {
696697 if code == c::EXCEPTION_STACK_OVERFLOW {
697698 crate::thread::with_current_name(|name| {
698699 let name = name.unwrap_or("<unknown>");
699 rtprintpanic!("\nthread '{name}' has overflowed its stack\n");
700 let tid = crate::thread::current_os_id();
701 rtprintpanic!("\nthread '{name}' ({tid}) has overflowed its stack\n");
700702 });
701703 }
702704 c::EXCEPTION_CONTINUE_SEARCH
library/std/src/sys/pal/unix/thread.rs+56
......@@ -398,6 +398,62 @@ impl Drop for Thread {
398398 }
399399}
400400
401pub(crate) fn current_os_id() -> Option<u64> {
402 // Most Unix platforms have a way to query an integer ID of the current thread, all with
403 // slightly different spellings.
404 //
405 // The OS thread ID is used rather than `pthread_self` so as to match what will be displayed
406 // for process inspection (debuggers, trace, `top`, etc.).
407 cfg_if::cfg_if! {
408 // Most platforms have a function returning a `pid_t` or int, which is an `i32`.
409 if #[cfg(any(target_os = "android", target_os = "linux"))] {
410 use crate::sys::weak::syscall;
411
412 // `libc::gettid` is only available on glibc 2.30+, but the syscall is available
413 // since Linux 2.4.11.
414 syscall!(fn gettid() -> libc::pid_t;);
415
416 // SAFETY: FFI call with no preconditions.
417 let id: libc::pid_t = unsafe { gettid() };
418 Some(id as u64)
419 } else if #[cfg(target_os = "nto")] {
420 // SAFETY: FFI call with no preconditions.
421 let id: libc::pid_t = unsafe { libc::gettid() };
422 Some(id as u64)
423 } else if #[cfg(target_os = "openbsd")] {
424 // SAFETY: FFI call with no preconditions.
425 let id: libc::pid_t = unsafe { libc::getthrid() };
426 Some(id as u64)
427 } else if #[cfg(target_os = "freebsd")] {
428 // SAFETY: FFI call with no preconditions.
429 let id: libc::c_int = unsafe { libc::pthread_getthreadid_np() };
430 Some(id as u64)
431 } else if #[cfg(target_os = "netbsd")] {
432 // SAFETY: FFI call with no preconditions.
433 let id: libc::lwpid_t = unsafe { libc::_lwp_self() };
434 Some(id as u64)
435 } else if #[cfg(any(target_os = "illumos", target_os = "solaris"))] {
436 // On Illumos and Solaris, the `pthread_t` is the same as the OS thread ID.
437 // SAFETY: FFI call with no preconditions.
438 let id: libc::pthread_t = unsafe { libc::pthread_self() };
439 Some(id as u64)
440 } else if #[cfg(target_vendor = "apple")] {
441 // Apple allows querying arbitrary thread IDs, `thread=NULL` queries the current thread.
442 let mut id = 0u64;
443 // SAFETY: `thread_id` is a valid pointer, no other preconditions.
444 let status: libc::c_int = unsafe { libc::pthread_threadid_np(0, &mut id) };
445 if status == 0 {
446 Some(id)
447 } else {
448 None
449 }
450 } else {
451 // Other platforms don't have an OS thread ID or don't have a way to access it.
452 None
453 }
454 }
455}
456
401457#[cfg(any(
402458 target_os = "linux",
403459 target_os = "nto",
library/std/src/sys/pal/unsupported/thread.rs+4
......@@ -39,6 +39,10 @@ impl Thread {
3939 }
4040}
4141
42pub(crate) fn current_os_id() -> Option<u64> {
43 None
44}
45
4246pub fn available_parallelism() -> io::Result<NonZero<usize>> {
4347 unsupported()
4448}
library/std/src/sys/pal/wasi/thread.rs+4
......@@ -194,6 +194,10 @@ impl Thread {
194194 }
195195}
196196
197pub(crate) fn current_os_id() -> Option<u64> {
198 None
199}
200
197201pub fn available_parallelism() -> io::Result<NonZero<usize>> {
198202 cfg_if::cfg_if! {
199203 if #[cfg(target_feature = "atomics")] {
library/std/src/sys/pal/windows/c/bindings.txt+1
......@@ -2185,6 +2185,7 @@ GetSystemInfo
21852185GetSystemTimeAsFileTime
21862186GetSystemTimePreciseAsFileTime
21872187GetTempPathW
2188GetThreadId
21882189GetUserProfileDirectoryW
21892190GetWindowsDirectoryW
21902191HANDLE
library/std/src/sys/pal/windows/c/windows_sys.rs+1
......@@ -61,6 +61,7 @@ windows_targets::link!("kernel32.dll" "system" fn GetSystemInfo(lpsysteminfo : *
6161windows_targets::link!("kernel32.dll" "system" fn GetSystemTimeAsFileTime(lpsystemtimeasfiletime : *mut FILETIME));
6262windows_targets::link!("kernel32.dll" "system" fn GetSystemTimePreciseAsFileTime(lpsystemtimeasfiletime : *mut FILETIME));
6363windows_targets::link!("kernel32.dll" "system" fn GetTempPathW(nbufferlength : u32, lpbuffer : PWSTR) -> u32);
64windows_targets::link!("kernel32.dll" "system" fn GetThreadId(thread : HANDLE) -> u32);
6465windows_targets::link!("userenv.dll" "system" fn GetUserProfileDirectoryW(htoken : HANDLE, lpprofiledir : PWSTR, lpcchsize : *mut u32) -> BOOL);
6566windows_targets::link!("kernel32.dll" "system" fn GetWindowsDirectoryW(lpbuffer : PWSTR, usize : u32) -> u32);
6667windows_targets::link!("kernel32.dll" "system" fn InitOnceBeginInitialize(lpinitonce : *mut INIT_ONCE, dwflags : u32, fpending : *mut BOOL, lpcontext : *mut *mut core::ffi::c_void) -> BOOL);
library/std/src/sys/pal/windows/stack_overflow.rs+2-1
......@@ -20,7 +20,8 @@ unsafe extern "system" fn vectored_handler(ExceptionInfo: *mut c::EXCEPTION_POIN
2020 if code == c::EXCEPTION_STACK_OVERFLOW {
2121 thread::with_current_name(|name| {
2222 let name = name.unwrap_or("<unknown>");
23 rtprintpanic!("\nthread '{name}' has overflowed its stack\n");
23 let tid = thread::current_os_id();
24 rtprintpanic!("\nthread '{name}' ({tid}) has overflowed its stack\n");
2425 });
2526 }
2627 c::EXCEPTION_CONTINUE_SEARCH
library/std/src/sys/pal/windows/thread.rs+8
......@@ -127,6 +127,14 @@ impl Thread {
127127 }
128128}
129129
130pub(crate) fn current_os_id() -> Option<u64> {
131 // SAFETY: FFI call with no preconditions.
132 let id: u32 = unsafe { c::GetThreadId(c::GetCurrentThread()) };
133
134 // A return value of 0 indicates failed lookup.
135 if id == 0 { None } else { Some(id.into()) }
136}
137
130138pub fn available_parallelism() -> io::Result<NonZero<usize>> {
131139 let res = unsafe {
132140 let mut sysinfo: c::SYSTEM_INFO = crate::mem::zeroed();
library/std/src/sys/pal/xous/thread.rs+4
......@@ -145,6 +145,10 @@ impl Thread {
145145 }
146146}
147147
148pub(crate) fn current_os_id() -> Option<u64> {
149 None
150}
151
148152pub fn available_parallelism() -> io::Result<NonZero<usize>> {
149153 // We're unicore right now.
150154 Ok(unsafe { NonZero::new_unchecked(1) })
library/std/src/thread/current.rs+12-1
......@@ -1,4 +1,4 @@
1use super::{Thread, ThreadId};
1use super::{Thread, ThreadId, imp};
22use crate::mem::ManuallyDrop;
33use crate::ptr;
44use crate::sys::thread_local::local_pointer;
......@@ -148,6 +148,17 @@ pub(crate) fn current_id() -> ThreadId {
148148 id::get_or_init()
149149}
150150
151/// Gets the OS thread ID of the thread that invokes it, if available. If not, return the Rust
152/// thread ID.
153///
154/// We use a `u64` to all possible platform IDs without excess `cfg`; most use `int`, some use a
155/// pointer, and Apple uses `uint64_t`. This is a "best effort" approach for diagnostics and is
156/// allowed to fall back to a non-OS ID (such as the Rust thread ID) or a non-unique ID (such as a
157/// PID) if the thread ID cannot be retrieved.
158pub(crate) fn current_os_id() -> u64 {
159 imp::current_os_id().unwrap_or_else(|| current_id().as_u64().get())
160}
161
151162/// Gets a reference to the handle of the thread that invokes it, if the handle
152163/// has been initialized.
153164pub(super) fn try_with_current<F, R>(f: F) -> R
library/std/src/thread/mod.rs+1-1
......@@ -183,7 +183,7 @@ mod current;
183183
184184#[stable(feature = "rust1", since = "1.0.0")]
185185pub use current::current;
186pub(crate) use current::{current_id, current_or_unnamed, drop_current};
186pub(crate) use current::{current_id, current_or_unnamed, current_os_id, drop_current};
187187use current::{set_current, try_with_current};
188188
189189mod spawnhook;
library/std/src/thread/tests.rs+7
......@@ -346,6 +346,13 @@ fn test_thread_id_not_equal() {
346346 assert!(thread::current().id() != spawned_id);
347347}
348348
349#[test]
350fn test_thread_os_id_not_equal() {
351 let spawned_id = thread::spawn(|| thread::current_os_id()).join().unwrap();
352 let current_id = thread::current_os_id();
353 assert!(current_id != spawned_id);
354}
355
349356#[test]
350357fn test_scoped_threads_drop_result_before_join() {
351358 let actually_finished = &AtomicBool::new(false);
src/tools/compiletest/src/runtest.rs+5
......@@ -2567,6 +2567,11 @@ impl<'test> TestCx<'test> {
25672567 })
25682568 .into_owned();
25692569
2570 // Normalize thread IDs in panic messages
2571 normalized = static_regex!(r"thread '(?P<name>.*?)' \((rtid )?\d+\) panicked")
2572 .replace_all(&normalized, "thread '$name' ($$TID) panicked")
2573 .into_owned();
2574
25702575 normalized = normalized.replace("\t", "\\t"); // makes tabs visible
25712576
25722577 // Remove test annotations like `//~ ERROR text` from the output,
src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind1.stderr+1-1
......@@ -1,5 +1,5 @@
11
2thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind1.rs:LL:CC:
2thread 'main' ($TID) panicked at tests/fail/function_calls/exported_symbol_bad_unwind1.rs:LL:CC:
33explicit panic
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr+2-2
......@@ -1,10 +1,10 @@
11
2thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC:
2thread 'main' ($TID) panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC:
33explicit panic
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
66
7thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
7thread 'main' ($TID) panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
88panic in a function that cannot unwind
99stack backtrace:
1010thread caused non-unwinding panic. aborting.
src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr+2-2
......@@ -1,10 +1,10 @@
11
2thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC:
2thread 'main' ($TID) panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC:
33explicit panic
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
66
7thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
7thread 'main' ($TID) panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
88panic in a function that cannot unwind
99stack backtrace:
1010thread caused non-unwinding panic. aborting.
src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.extern_block.stderr+1-1
......@@ -1,5 +1,5 @@
11
2thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC:
2thread 'main' ($TID) panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC:
33explicit panic
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.stderr+1-1
......@@ -1,5 +1,5 @@
11
2thread 'main' panicked at tests/fail/function_calls/return_pointer_on_unwind.rs:LL:CC:
2thread 'main' ($TID) panicked at tests/fail/function_calls/return_pointer_on_unwind.rs:LL:CC:
33explicit panic
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
src/tools/miri/tests/fail/panic/abort_unwind.stderr+2-2
......@@ -1,10 +1,10 @@
11
2thread 'main' panicked at tests/fail/panic/abort_unwind.rs:LL:CC:
2thread 'main' ($TID) panicked at tests/fail/panic/abort_unwind.rs:LL:CC:
33PANIC!!!
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
66
7thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
7thread 'main' ($TID) panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
88panic in a function that cannot unwind
99stack backtrace:
1010thread caused non-unwinding panic. aborting.
src/tools/miri/tests/fail/panic/bad_unwind.stderr+1-1
......@@ -1,5 +1,5 @@
11
2thread 'main' panicked at tests/fail/panic/bad_unwind.rs:LL:CC:
2thread 'main' ($TID) panicked at tests/fail/panic/bad_unwind.rs:LL:CC:
33explicit panic
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
src/tools/miri/tests/fail/panic/double_panic.stderr+3-3
......@@ -1,14 +1,14 @@
11
2thread 'main' panicked at tests/fail/panic/double_panic.rs:LL:CC:
2thread 'main' ($TID) panicked at tests/fail/panic/double_panic.rs:LL:CC:
33first
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
66
7thread 'main' panicked at tests/fail/panic/double_panic.rs:LL:CC:
7thread 'main' ($TID) panicked at tests/fail/panic/double_panic.rs:LL:CC:
88second
99stack backtrace:
1010
11thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
11thread 'main' ($TID) panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
1212panic in a destructor during cleanup
1313thread caused non-unwinding panic. aborting.
1414error: abnormal termination: the program aborted execution
src/tools/miri/tests/fail/panic/panic_abort1.stderr+1-1
......@@ -1,5 +1,5 @@
11
2thread 'main' panicked at tests/fail/panic/panic_abort1.rs:LL:CC:
2thread 'main' ($TID) panicked at tests/fail/panic/panic_abort1.rs:LL:CC:
33panicking from libstd
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
src/tools/miri/tests/fail/panic/panic_abort2.stderr+1-1
......@@ -1,5 +1,5 @@
11
2thread 'main' panicked at tests/fail/panic/panic_abort2.rs:LL:CC:
2thread 'main' ($TID) panicked at tests/fail/panic/panic_abort2.rs:LL:CC:
3342-panicking from libstd
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
src/tools/miri/tests/fail/panic/panic_abort3.stderr+1-1
......@@ -1,5 +1,5 @@
11
2thread 'main' panicked at tests/fail/panic/panic_abort3.rs:LL:CC:
2thread 'main' ($TID) panicked at tests/fail/panic/panic_abort3.rs:LL:CC:
33panicking from libcore
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
src/tools/miri/tests/fail/panic/panic_abort4.stderr+1-1
......@@ -1,5 +1,5 @@
11
2thread 'main' panicked at tests/fail/panic/panic_abort4.rs:LL:CC:
2thread 'main' ($TID) panicked at tests/fail/panic/panic_abort4.rs:LL:CC:
3342-panicking from libcore
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
src/tools/miri/tests/fail/panic/tls_macro_const_drop_panic.stderr+1-1
......@@ -1,5 +1,5 @@
11
2thread $NAME panicked at tests/fail/panic/tls_macro_const_drop_panic.rs:LL:CC:
2thread $NAME ($TID) panicked at tests/fail/panic/tls_macro_const_drop_panic.rs:LL:CC:
33ow
44fatal runtime error: thread local panicked on drop, aborting
55error: abnormal termination: the program aborted execution
src/tools/miri/tests/fail/panic/tls_macro_drop_panic.stderr+1-1
......@@ -1,5 +1,5 @@
11
2thread $NAME panicked at tests/fail/panic/tls_macro_drop_panic.rs:LL:CC:
2thread $NAME ($TID) panicked at tests/fail/panic/tls_macro_drop_panic.rs:LL:CC:
33ow
44fatal runtime error: thread local panicked on drop, aborting
55error: abnormal termination: the program aborted execution
src/tools/miri/tests/fail/ptr_swap_nonoverlapping.stderr+1-1
......@@ -1,5 +1,5 @@
11
2thread 'main' panicked at tests/fail/ptr_swap_nonoverlapping.rs:LL:CC:
2thread 'main' ($TID) panicked at tests/fail/ptr_swap_nonoverlapping.rs:LL:CC:
33unsafe precondition(s) violated: ptr::swap_nonoverlapping requires that both pointer arguments are aligned and non-null and the specified memory ranges do not overlap
44
55This indicates a bug in the program. This Undefined Behavior check is optional, and cannot be relied on for safety.
src/tools/miri/tests/fail/terminate-terminator.stderr+2-2
......@@ -1,12 +1,12 @@
11warning: 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.
22
33
4thread 'main' panicked at tests/fail/terminate-terminator.rs:LL:CC:
4thread 'main' ($TID) panicked at tests/fail/terminate-terminator.rs:LL:CC:
55explicit panic
66note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
77note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
88
9thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
9thread 'main' ($TID) panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
1010panic in a function that cannot unwind
1111stack backtrace:
1212thread caused non-unwinding panic. aborting.
src/tools/miri/tests/fail/unwind-action-terminate.stderr+2-2
......@@ -1,10 +1,10 @@
11
2thread 'main' panicked at tests/fail/unwind-action-terminate.rs:LL:CC:
2thread 'main' ($TID) panicked at tests/fail/unwind-action-terminate.rs:LL:CC:
33explicit panic
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
66
7thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
7thread 'main' ($TID) panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
88panic in a function that cannot unwind
99stack backtrace:
1010thread caused non-unwinding panic. aborting.
src/tools/miri/tests/panic/alloc_error_handler_hook.stderr+1-1
......@@ -1,5 +1,5 @@
11
2thread 'main' panicked at tests/panic/alloc_error_handler_hook.rs:LL:CC:
2thread 'main' ($TID) panicked at tests/panic/alloc_error_handler_hook.rs:LL:CC:
33alloc error hook called
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
src/tools/miri/tests/panic/alloc_error_handler_panic.stderr+1-1
......@@ -1,5 +1,5 @@
11
2thread 'main' panicked at RUSTLIB/std/src/alloc.rs:LL:CC:
2thread 'main' ($TID) panicked at RUSTLIB/std/src/alloc.rs:LL:CC:
33memory allocation of 4 bytes failed
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
src/tools/miri/tests/panic/div-by-zero-2.stderr+1-1
......@@ -1,5 +1,5 @@
11
2thread 'main' panicked at tests/panic/div-by-zero-2.rs:LL:CC:
2thread 'main' ($TID) panicked at tests/panic/div-by-zero-2.rs:LL:CC:
33attempt to divide by zero
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
src/tools/miri/tests/panic/function_calls/exported_symbol_good_unwind.stderr+3-3
......@@ -1,11 +1,11 @@
11
2thread 'main' panicked at tests/panic/function_calls/exported_symbol_good_unwind.rs:LL:CC:
2thread 'main' ($TID) panicked at tests/panic/function_calls/exported_symbol_good_unwind.rs:LL:CC:
33explicit panic
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
66
7thread 'main' panicked at tests/panic/function_calls/exported_symbol_good_unwind.rs:LL:CC:
7thread 'main' ($TID) panicked at tests/panic/function_calls/exported_symbol_good_unwind.rs:LL:CC:
88explicit panic
99
10thread 'main' panicked at tests/panic/function_calls/exported_symbol_good_unwind.rs:LL:CC:
10thread 'main' ($TID) panicked at tests/panic/function_calls/exported_symbol_good_unwind.rs:LL:CC:
1111explicit panic
src/tools/miri/tests/panic/mir-validation.rs+6
......@@ -8,6 +8,12 @@
88// Somehow on rustc Windows CI, the "Miri caused an ICE" message is not shown
99// and we don't even get a regular panic; rustc aborts with a different exit code instead.
1010//@ignore-host: windows
11
12// FIXME: this tests a crash in rustc. For stage1, rustc is built with the downloaded standard
13// library which doesn't yet print the thread ID. Normalization can be removed at the stage bump.
14// For the grep: cfg(bootstrap)
15//@normalize-stderr-test: "thread 'rustc' panicked" -> "thread 'rustc' ($$TID) panicked"
16
1117#![feature(custom_mir, core_intrinsics)]
1218use core::intrinsics::mir::*;
1319
src/tools/miri/tests/panic/mir-validation.stderr+1-1
......@@ -6,7 +6,7 @@ LL | *(tuple.0) = 1;
66 | ^^^^^^^^^^^^^^
77
88
9thread 'rustc' panicked at compiler/rustc_mir_transform/src/validate.rs:LL:CC:
9thread 'rustc' ($TID) panicked at compiler/rustc_mir_transform/src/validate.rs:LL:CC:
1010Box<dyn Any>
1111stack backtrace:
1212
src/tools/miri/tests/panic/oob_subslice.stderr+1-1
......@@ -1,5 +1,5 @@
11
2thread 'main' panicked at tests/panic/oob_subslice.rs:LL:CC:
2thread 'main' ($TID) panicked at tests/panic/oob_subslice.rs:LL:CC:
33range end index 5 out of range for slice of length 4
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
src/tools/miri/tests/panic/overflowing-lsh-neg.stderr+1-1
......@@ -1,5 +1,5 @@
11
2thread 'main' panicked at tests/panic/overflowing-lsh-neg.rs:LL:CC:
2thread 'main' ($TID) panicked at tests/panic/overflowing-lsh-neg.rs:LL:CC:
33attempt to shift left with overflow
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
src/tools/miri/tests/panic/overflowing-rsh-1.stderr+1-1
......@@ -1,5 +1,5 @@
11
2thread 'main' panicked at tests/panic/overflowing-rsh-1.rs:LL:CC:
2thread 'main' ($TID) panicked at tests/panic/overflowing-rsh-1.rs:LL:CC:
33attempt to shift right with overflow
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
src/tools/miri/tests/panic/overflowing-rsh-2.stderr+1-1
......@@ -1,5 +1,5 @@
11
2thread 'main' panicked at tests/panic/overflowing-rsh-2.rs:LL:CC:
2thread 'main' ($TID) panicked at tests/panic/overflowing-rsh-2.rs:LL:CC:
33attempt to shift right with overflow
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
src/tools/miri/tests/panic/panic1.stderr+1-1
......@@ -1,5 +1,5 @@
11
2thread 'main' panicked at tests/panic/panic1.rs:LL:CC:
2thread 'main' ($TID) panicked at tests/panic/panic1.rs:LL:CC:
33panicking from libstd
44stack backtrace:
55 0: std::panicking::begin_panic_handler
src/tools/miri/tests/panic/panic2.stderr+1-1
......@@ -1,5 +1,5 @@
11
2thread 'main' panicked at tests/panic/panic2.rs:LL:CC:
2thread 'main' ($TID) panicked at tests/panic/panic2.rs:LL:CC:
3342-panicking from libstd
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
src/tools/miri/tests/panic/panic3.stderr+1-1
......@@ -1,5 +1,5 @@
11
2thread 'main' panicked at tests/panic/panic3.rs:LL:CC:
2thread 'main' ($TID) panicked at tests/panic/panic3.rs:LL:CC:
33panicking from libcore
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
src/tools/miri/tests/panic/panic4.stderr+1-1
......@@ -1,5 +1,5 @@
11
2thread 'main' panicked at tests/panic/panic4.rs:LL:CC:
2thread 'main' ($TID) panicked at tests/panic/panic4.rs:LL:CC:
3342-panicking from libcore
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
src/tools/miri/tests/panic/transmute_fat2.stderr+1-1
......@@ -1,5 +1,5 @@
11
2thread 'main' panicked at tests/panic/transmute_fat2.rs:LL:CC:
2thread 'main' ($TID) panicked at tests/panic/transmute_fat2.rs:LL:CC:
33index out of bounds: the len is 0 but the index is 0
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
src/tools/miri/tests/pass/panic/catch_panic.stderr+11-11
......@@ -1,47 +1,47 @@
11
2thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
2thread 'main' ($TID) panicked at tests/pass/panic/catch_panic.rs:LL:CC:
33Hello from std::panic
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
66Caught panic message (&str): Hello from std::panic
77
8thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
8thread 'main' ($TID) panicked at tests/pass/panic/catch_panic.rs:LL:CC:
99Hello from std::panic: 1
1010Caught panic message (String): Hello from std::panic: 1
1111
12thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
12thread 'main' ($TID) panicked at tests/pass/panic/catch_panic.rs:LL:CC:
1313Hello from std::panic_any: 2
1414Caught panic message (String): Hello from std::panic_any: 2
1515
16thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
16thread 'main' ($TID) panicked at tests/pass/panic/catch_panic.rs:LL:CC:
1717Box<dyn Any>
1818Failed to get caught panic message.
1919
20thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
20thread 'main' ($TID) panicked at tests/pass/panic/catch_panic.rs:LL:CC:
2121Hello from core::panic
2222Caught panic message (&str): Hello from core::panic
2323
24thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
24thread 'main' ($TID) panicked at tests/pass/panic/catch_panic.rs:LL:CC:
2525Hello from core::panic: 5
2626Caught panic message (String): Hello from core::panic: 5
2727
28thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
28thread 'main' ($TID) panicked at tests/pass/panic/catch_panic.rs:LL:CC:
2929index out of bounds: the len is 3 but the index is 4
3030Caught panic message (String): index out of bounds: the len is 3 but the index is 4
3131
32thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
32thread 'main' ($TID) panicked at tests/pass/panic/catch_panic.rs:LL:CC:
3333attempt to divide by zero
3434Caught panic message (&str): attempt to divide by zero
3535
36thread 'main' panicked at RUSTLIB/core/src/ptr/const_ptr.rs:LL:CC:
36thread 'main' ($TID) panicked at RUSTLIB/core/src/ptr/const_ptr.rs:LL:CC:
3737align_offset: align is not a power-of-two
3838Caught panic message (&str): align_offset: align is not a power-of-two
3939
40thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
40thread 'main' ($TID) panicked at tests/pass/panic/catch_panic.rs:LL:CC:
4141assertion failed: false
4242Caught panic message (&str): assertion failed: false
4343
44thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
44thread 'main' ($TID) panicked at tests/pass/panic/catch_panic.rs:LL:CC:
4545assertion failed: false
4646Caught panic message (&str): assertion failed: false
4747Success!
src/tools/miri/tests/pass/panic/concurrent-panic.stderr+2-2
......@@ -1,7 +1,7 @@
11Thread 1 starting, will block on mutex
22Thread 1 reported it has started
33
4thread '<unnamed>' panicked at tests/pass/panic/concurrent-panic.rs:LL:CC:
4thread '<unnamed>' ($TID) panicked at tests/pass/panic/concurrent-panic.rs:LL:CC:
55panic in thread 2
66note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
77note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
......@@ -9,7 +9,7 @@ Thread 2 blocking on thread 1
99Thread 2 reported it has started
1010Unlocking mutex
1111
12thread '<unnamed>' panicked at tests/pass/panic/concurrent-panic.rs:LL:CC:
12thread '<unnamed>' ($TID) panicked at tests/pass/panic/concurrent-panic.rs:LL:CC:
1313panic in thread 1
1414Thread 1 has exited
1515Thread 2 has exited
src/tools/miri/tests/pass/panic/nested_panic_caught.stderr+2-2
......@@ -1,9 +1,9 @@
11
2thread 'main' panicked at tests/pass/panic/nested_panic_caught.rs:LL:CC:
2thread 'main' ($TID) panicked at tests/pass/panic/nested_panic_caught.rs:LL:CC:
33once
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
66
7thread 'main' panicked at tests/pass/panic/nested_panic_caught.rs:LL:CC:
7thread 'main' ($TID) panicked at tests/pass/panic/nested_panic_caught.rs:LL:CC:
88twice
99stack backtrace:
src/tools/miri/tests/pass/panic/thread_panic.stderr+2-2
......@@ -1,8 +1,8 @@
11
2thread '<unnamed>' panicked at tests/pass/panic/thread_panic.rs:LL:CC:
2thread '<unnamed>' ($TID) panicked at tests/pass/panic/thread_panic.rs:LL:CC:
33Hello!
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
66
7thread 'childthread' panicked at tests/pass/panic/thread_panic.rs:LL:CC:
7thread 'childthread' ($TID) panicked at tests/pass/panic/thread_panic.rs:LL:CC:
88Hello, world!
src/tools/miri/tests/ui.rs+2-1
......@@ -248,7 +248,8 @@ regexes! {
248248 // erase alloc ids
249249 "alloc[0-9]+" => "ALLOC",
250250 // erase thread ids
251 r"unnamed-[0-9]+" => "unnamed-ID",
251 r"unnamed-[0-9]+" => "unnamed-ID",
252 r"thread '(?P<name>.*?)' \(\d+\) panicked" => "thread '$name' ($$TID) panicked",
252253 // erase borrow tags
253254 "<[0-9]+>" => "<TAG>",
254255 "<[0-9]+=" => "<TAG=",
src/tools/rustfmt/tests/rustfmt/main.rs+2-1
......@@ -185,10 +185,11 @@ fn dont_emit_ICE() {
185185 "tests/target/issue-6105.rs",
186186 ];
187187
188 let panic_re = regex::Regex::new("thread.*panicked").unwrap();
188189 for file in files {
189190 let args = [file];
190191 let (_stdout, stderr) = rustfmt(&args);
191 assert!(!stderr.contains("thread 'main' panicked"));
192 assert!(!panic_re.is_match(&stderr));
192193 }
193194}
194195
tests/run-make/libtest-json/output-default.json+1-1
......@@ -2,7 +2,7 @@
22{ "type": "test", "event": "started", "name": "a" }
33{ "type": "test", "name": "a", "event": "ok" }
44{ "type": "test", "event": "started", "name": "b" }
5{ "type": "test", "name": "b", "event": "failed", "stdout": "\nthread 'b' panicked at f.rs:9:5:\nassertion failed: false\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\n" }
5{ "type": "test", "name": "b", "event": "failed", "stdout": "\nthread 'b' ($TID) panicked at f.rs:9:5:\nassertion failed: false\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\n" }
66{ "type": "test", "event": "started", "name": "c" }
77{ "type": "test", "name": "c", "event": "ok" }
88{ "type": "test", "event": "started", "name": "d" }
tests/run-make/libtest-json/output-stdout-success.json+2-2
......@@ -2,9 +2,9 @@
22{ "type": "test", "event": "started", "name": "a" }
33{ "type": "test", "name": "a", "event": "ok", "stdout": "print from successful test\n" }
44{ "type": "test", "event": "started", "name": "b" }
5{ "type": "test", "name": "b", "event": "failed", "stdout": "\nthread 'b' panicked at f.rs:9:5:\nassertion failed: false\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\n" }
5{ "type": "test", "name": "b", "event": "failed", "stdout": "\nthread 'b' ($TID) panicked at f.rs:9:5:\nassertion failed: false\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\n" }
66{ "type": "test", "event": "started", "name": "c" }
7{ "type": "test", "name": "c", "event": "ok", "stdout": "\nthread 'c' panicked at f.rs:15:5:\nassertion failed: false\n" }
7{ "type": "test", "name": "c", "event": "ok", "stdout": "\nthread 'c' ($TID) panicked at f.rs:15:5:\nassertion failed: false\n" }
88{ "type": "test", "event": "started", "name": "d" }
99{ "type": "test", "name": "d", "event": "ignored", "message": "msg" }
1010{ "type": "suite", "event": "failed", "passed": 2, "failed": 1, "ignored": 1, "measured": 0, "filtered_out": 0, "exec_time": "$EXEC_TIME" }
tests/run-make/libtest-json/rmake.rs+1
......@@ -38,5 +38,6 @@ fn run_tests(extra_args: &[&str], expected_file: &str) {
3838 .expected_file(expected_file)
3939 .actual_text("stdout", test_stdout)
4040 .normalize(r#"(?<prefix>"exec_time": )[0-9.]+"#, r#"${prefix}"$$EXEC_TIME""#)
41 .normalize(r"thread '(?P<name>.*?)' \(\d+\) panicked", "thread '$name' ($$TID) panicked")
4142 .run();
4243}
tests/run-make/libtest-junit/output-default.xml+1-1
......@@ -1 +1 @@
1<?xml version="1.0" encoding="UTF-8"?><testsuites><testsuite name="test" package="test" id="0" errors="0" failures="1" tests="4" skipped="1" ><testcase classname="unknown" name="a" time="$TIME"/><testcase classname="unknown" name="b" time="$TIME"><failure type="assert"/><system-out><![CDATA[print from failing test]]>&#xA;&#xA;<![CDATA[thread 'b' panicked at f.rs:10:5:]]>&#xA;<![CDATA[assertion failed: false]]>&#xA;<![CDATA[note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace]]>&#xA;<![CDATA[]]></system-out></testcase><testcase classname="unknown" name="c" time="$TIME"/><system-out/><system-err/></testsuite></testsuites>
1<?xml version="1.0" encoding="UTF-8"?><testsuites><testsuite name="test" package="test" id="0" errors="0" failures="1" tests="4" skipped="1" ><testcase classname="unknown" name="a" time="$TIME"/><testcase classname="unknown" name="b" time="$TIME"><failure type="assert"/><system-out><![CDATA[print from failing test]]>&#xA;&#xA;<![CDATA[thread 'b' ($TID) panicked at f.rs:10:5:]]>&#xA;<![CDATA[assertion failed: false]]>&#xA;<![CDATA[note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace]]>&#xA;<![CDATA[]]></system-out></testcase><testcase classname="unknown" name="c" time="$TIME"/><system-out/><system-err/></testsuite></testsuites>
tests/run-make/libtest-junit/output-stdout-success.xml+1-1
......@@ -1 +1 @@
1<?xml version="1.0" encoding="UTF-8"?><testsuites><testsuite name="test" package="test" id="0" errors="0" failures="1" tests="4" skipped="1" ><testcase classname="unknown" name="a" time="$TIME"><system-out><![CDATA[print from successful test]]>&#xA;<![CDATA[]]></system-out></testcase><testcase classname="unknown" name="b" time="$TIME"><failure type="assert"/><system-out><![CDATA[print from failing test]]>&#xA;&#xA;<![CDATA[thread 'b' panicked at f.rs:10:5:]]>&#xA;<![CDATA[assertion failed: false]]>&#xA;<![CDATA[note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace]]>&#xA;<![CDATA[]]></system-out></testcase><testcase classname="unknown" name="c" time="$TIME"><system-out><![CDATA[]]>&#xA;<![CDATA[thread 'c' panicked at f.rs:16:5:]]>&#xA;<![CDATA[assertion failed: false]]>&#xA;<![CDATA[]]></system-out></testcase><system-out/><system-err/></testsuite></testsuites>
1<?xml version="1.0" encoding="UTF-8"?><testsuites><testsuite name="test" package="test" id="0" errors="0" failures="1" tests="4" skipped="1" ><testcase classname="unknown" name="a" time="$TIME"><system-out><![CDATA[print from successful test]]>&#xA;<![CDATA[]]></system-out></testcase><testcase classname="unknown" name="b" time="$TIME"><failure type="assert"/><system-out><![CDATA[print from failing test]]>&#xA;&#xA;<![CDATA[thread 'b' ($TID) panicked at f.rs:10:5:]]>&#xA;<![CDATA[assertion failed: false]]>&#xA;<![CDATA[note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace]]>&#xA;<![CDATA[]]></system-out></testcase><testcase classname="unknown" name="c" time="$TIME"><system-out><![CDATA[]]>&#xA;<![CDATA[thread 'c' ($TID) panicked at f.rs:16:5:]]>&#xA;<![CDATA[assertion failed: false]]>&#xA;<![CDATA[]]></system-out></testcase><system-out/><system-err/></testsuite></testsuites>
tests/run-make/libtest-junit/rmake.rs+1
......@@ -27,5 +27,6 @@ fn run_tests(extra_args: &[&str], expected_file: &str) {
2727 .expected_file(expected_file)
2828 .actual_text("stdout", test_stdout)
2929 .normalize(r#"\btime="[0-9.]+""#, r#"time="$$TIME""#)
30 .normalize(r"thread '(?P<name>.*?)' \(\d+\) panicked", "thread '$name' ($$TID) panicked")
3031 .run();
3132}
tests/rustdoc-ui/doctest/edition-2024-error-output.stdout+1-1
......@@ -9,7 +9,7 @@ Test executable failed (exit status: 101).
99
1010stderr:
1111
12thread 'main' panicked at $TMP:6:1:
12thread 'main' ($TID) panicked at $TMP:6:1:
1313assertion `left == right` failed
1414 left: 4
1515 right: 5
tests/rustdoc-ui/doctest/failed-doctest-output-windows.stdout+1-1
......@@ -27,7 +27,7 @@ stderr:
2727stderr 1
2828stderr 2
2929
30thread 'main' panicked at $DIR/failed-doctest-output-windows.rs:7:1:
30thread 'main' ($TID) panicked at $DIR/failed-doctest-output-windows.rs:7:1:
3131oh no
3232note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
3333
tests/rustdoc-ui/doctest/failed-doctest-output.stdout+1-1
......@@ -27,7 +27,7 @@ stderr:
2727stderr 1
2828stderr 2
2929
30thread 'main' panicked at $DIR/failed-doctest-output.rs:7:1:
30thread 'main' ($TID) panicked at $DIR/failed-doctest-output.rs:7:1:
3131oh no
3232note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
3333
tests/rustdoc-ui/doctest/stdout-and-stderr.stdout+2-2
......@@ -14,7 +14,7 @@ stdout:
1414
1515stderr:
1616
17thread 'main' panicked at $TMP:7:1:
17thread 'main' ($TID) panicked at $TMP:7:1:
1818assertion `left == right` failed
1919 left: "doc"
2020 right: "test"
......@@ -26,7 +26,7 @@ Test executable failed (exit status: 101).
2626
2727stderr:
2828
29thread 'main' panicked at $TMP:15:1:
29thread 'main' ($TID) panicked at $TMP:15:1:
3030assertion `left == right` failed
3131 left: "doc"
3232 right: "test"
tests/rustdoc-ui/remap-path-prefix-failed-doctest-output.stdout+1-1
......@@ -9,7 +9,7 @@ Test executable failed (exit status: 101).
99
1010stderr:
1111
12thread 'main' panicked at remapped_path/remap-path-prefix-failed-doctest-output.rs:3:1:
12thread 'main' ($TID) panicked at remapped_path/remap-path-prefix-failed-doctest-output.rs:3:1:
1313oh no
1414note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
1515
tests/ui/async-await/issues/issue-65419/issue-65419-async-fn-resume-after-completion.rs+1-1
......@@ -2,7 +2,7 @@
22// be talking about `async fn`s instead.
33
44//@ run-fail
5//@ error-pattern: thread 'main' panicked
5//@ regex-error-pattern: thread 'main'.*panicked
66//@ error-pattern: `async fn` resumed after completion
77//@ edition:2018
88
tests/ui/async-await/issues/issue-65419/issue-65419-async-fn-resume-after-panic.rs+1-1
......@@ -3,7 +3,7 @@
33
44//@ run-fail
55//@ needs-unwind
6//@ error-pattern: thread 'main' panicked
6//@ regex-error-pattern: thread 'main'.*panicked
77//@ error-pattern: `async fn` resumed after panicking
88//@ edition:2018
99
tests/ui/backtrace/synchronized-panic-handler.run.stderr+2-2
......@@ -1,7 +1,7 @@
11
2thread '<unnamed>' panicked at $DIR/synchronized-panic-handler.rs:11:5:
2thread '<unnamed>' ($TID) panicked at $DIR/synchronized-panic-handler.rs:11:5:
33oops oh no woe is me
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55
6thread '<unnamed>' panicked at $DIR/synchronized-panic-handler.rs:11:5:
6thread '<unnamed>' ($TID) panicked at $DIR/synchronized-panic-handler.rs:11:5:
77oops oh no woe is me
tests/ui/const-generics/generic_const_exprs/issue-80742.rs+1-1
......@@ -2,7 +2,7 @@
22//@ known-bug: #97477
33//@ failure-status: 101
44//@ normalize-stderr: "note: .*\n\n" -> ""
5//@ normalize-stderr: "thread 'rustc' panicked.*\n" -> ""
5//@ normalize-stderr: "thread 'rustc'.*panicked.*\n" -> ""
66//@ normalize-stderr: "(error: internal compiler error: [^:]+):\d+:\d+: " -> "$1:LL:CC: "
77//@ rustc-env:RUST_BACKTRACE=0
88
tests/ui/extern/extern-types-field-offset.run.stderr+1-1
......@@ -1,5 +1,5 @@
11
2thread 'main' panicked at library/core/src/panicking.rs:$LINE:$COL:
2thread 'main' ($TID) panicked at library/core/src/panicking.rs:$LINE:$COL:
33attempted to compute the size or alignment of extern type `Opaque`
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55thread caused non-unwinding panic. aborting.
tests/ui/extern/extern-types-size_of_val.align.run.stderr+1-1
......@@ -1,5 +1,5 @@
11
2thread 'main' panicked at library/core/src/panicking.rs:$LINE:$COL:
2thread 'main' ($TID) panicked at library/core/src/panicking.rs:$LINE:$COL:
33attempted to compute the size or alignment of extern type `A`
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55thread caused non-unwinding panic. aborting.
tests/ui/extern/extern-types-size_of_val.size.run.stderr+1-1
......@@ -1,5 +1,5 @@
11
2thread 'main' panicked at library/core/src/panicking.rs:$LINE:$COL:
2thread 'main' ($TID) panicked at library/core/src/panicking.rs:$LINE:$COL:
33attempted to compute the size or alignment of extern type `A`
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55thread caused non-unwinding panic. aborting.
tests/ui/hygiene/panic-location.run.stderr+1-1
......@@ -1,4 +1,4 @@
11
2thread 'main' panicked at $DIR/panic-location.rs:LL:CC:
2thread 'main' ($TID) panicked at $DIR/panic-location.rs:LL:CC:
33capacity overflow
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
tests/ui/intrinsics/const-eval-select-backtrace-std.run.stderr+1-1
......@@ -1,4 +1,4 @@
11
2thread 'main' panicked at $DIR/const-eval-select-backtrace-std.rs:6:8:
2thread 'main' ($TID) panicked at $DIR/const-eval-select-backtrace-std.rs:6:8:
33byte index 1 is out of bounds of ``
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
tests/ui/intrinsics/const-eval-select-backtrace.run.stderr+1-1
......@@ -1,4 +1,4 @@
11
2thread 'main' panicked at $DIR/const-eval-select-backtrace.rs:15:5:
2thread 'main' ($TID) panicked at $DIR/const-eval-select-backtrace.rs:15:5:
33Aaah!
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
tests/ui/intrinsics/not-overridden.rs+1-1
......@@ -4,7 +4,7 @@
44//@ build-fail
55//@ failure-status:101
66//@ normalize-stderr: ".*note: .*\n\n" -> ""
7//@ normalize-stderr: "thread 'rustc' panicked.*:\n.*\n" -> ""
7//@ normalize-stderr: "thread 'rustc'.*panicked.*:\n.*\n" -> ""
88//@ normalize-stderr: "internal compiler error:.*: intrinsic const_deallocate " -> ""
99//@ rustc-env:RUST_BACKTRACE=0
1010
tests/ui/issues/issue-87707.run.stderr+2-2
......@@ -1,7 +1,7 @@
11
2thread 'main' panicked at $DIR/issue-87707.rs:14:24:
2thread 'main' ($TID) panicked at $DIR/issue-87707.rs:14:24:
33Here Once instance is poisoned.
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55
6thread 'main' panicked at $DIR/issue-87707.rs:16:7:
6thread 'main' ($TID) panicked at $DIR/issue-87707.rs:16:7:
77Once instance has previously been poisoned
tests/ui/layout/valid_range_oob.rs+1-1
......@@ -1,6 +1,6 @@
11//@ failure-status: 101
22//@ normalize-stderr: "note: .*\n\n" -> ""
3//@ normalize-stderr: "thread 'rustc' panicked.*\n" -> ""
3//@ normalize-stderr: "thread 'rustc'.*panicked.*\n" -> ""
44//@ rustc-env:RUST_BACKTRACE=0
55
66#![feature(rustc_attrs)]
tests/ui/macros/assert-long-condition.run.stderr+1-1
......@@ -1,5 +1,5 @@
11
2thread 'main' panicked at $DIR/assert-long-condition.rs:7:5:
2thread 'main' ($TID) panicked at $DIR/assert-long-condition.rs:7:5:
33assertion failed: 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18
44 + 19 + 20 + 21 + 22 + 23 + 24 + 25 == 0
55note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
tests/ui/mir/lint/storage-live.rs+1-1
......@@ -1,7 +1,7 @@
11//@ compile-flags: -Zlint-mir -Ztreat-err-as-bug
22//@ failure-status: 101
33//@ normalize-stderr: "note: .*\n\n" -> ""
4//@ normalize-stderr: "thread 'rustc' panicked.*\n" -> ""
4//@ normalize-stderr: "thread 'rustc'.*panicked.*\n" -> ""
55//@ normalize-stderr: "storage_live\[....\]" -> "storage_live[HASH]"
66//@ normalize-stderr: "(delayed at [^:]+):\d+:\d+ - " -> "$1:LL:CC - "
77//@ rustc-env:RUST_BACKTRACE=0
tests/ui/nll/issue-51345-2.rs+2-2
......@@ -1,6 +1,6 @@
11//@ run-fail
2//@ error-pattern:thread 'main' panicked
3//@ error-pattern:explicit panic
2//@ regex-error-pattern: thread 'main'.*panicked
3//@ error-pattern: explicit panic
44//@ needs-subprocess
55
66fn main() {
tests/ui/numbers-arithmetic/overflowing-add.rs+2-2
......@@ -1,6 +1,6 @@
11//@ run-fail
2//@ error-pattern:thread 'main' panicked
3//@ error-pattern:attempt to add with overflow
2//@ regex-error-pattern: thread 'main'.*panicked
3//@ error-pattern: attempt to add with overflow
44//@ compile-flags: -C debug-assertions
55//@ needs-subprocess
66
tests/ui/numbers-arithmetic/overflowing-mul.rs+2-2
......@@ -1,6 +1,6 @@
11//@ run-fail
2//@ error-pattern:thread 'main' panicked
3//@ error-pattern:attempt to multiply with overflow
2//@ regex-error-pattern: thread 'main'.*panicked
3//@ error-pattern: attempt to multiply with overflow
44//@ needs-subprocess
55//@ compile-flags: -C debug-assertions
66
tests/ui/numbers-arithmetic/overflowing-pow-signed.rs+2-2
......@@ -1,6 +1,6 @@
11//@ run-fail
2//@ error-pattern:thread 'main' panicked
3//@ error-pattern:attempt to multiply with overflow
2//@ regex-error-pattern: thread 'main'.*panicked
3//@ error-pattern: attempt to multiply with overflow
44//@ needs-subprocess
55//@ compile-flags: -C debug-assertions
66
tests/ui/numbers-arithmetic/overflowing-pow-unsigned.rs+2-2
......@@ -1,6 +1,6 @@
11//@ run-fail
2//@ error-pattern:thread 'main' panicked
3//@ error-pattern:attempt to multiply with overflow
2//@ regex-error-pattern: thread 'main'.*panicked
3//@ error-pattern: attempt to multiply with overflow
44//@ needs-subprocess
55//@ compile-flags: -C debug-assertions
66
tests/ui/numbers-arithmetic/overflowing-sub.rs+2-2
......@@ -1,6 +1,6 @@
11//@ run-fail
2//@ error-pattern:thread 'main' panicked
3//@ error-pattern:attempt to subtract with overflow
2//@ regex-error-pattern: thread 'main'.*panicked
3//@ error-pattern: attempt to subtract with overflow
44//@ needs-subprocess
55//@ compile-flags: -C debug-assertions
66
tests/ui/panics/fmt-only-once.run.stderr+1-1
......@@ -1,5 +1,5 @@
11fmt
22
3thread 'main' panicked at $DIR/fmt-only-once.rs:20:5:
3thread 'main' ($TID) panicked at $DIR/fmt-only-once.rs:20:5:
44PrintOnFmt
55note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
tests/ui/panics/issue-47429-short-backtraces.run.stderr+1-1
......@@ -1,5 +1,5 @@
11
2thread 'main' panicked at $DIR/issue-47429-short-backtraces.rs:24:5:
2thread 'main' ($TID) panicked at $DIR/issue-47429-short-backtraces.rs:24:5:
33explicit panic
44stack backtrace:
55 0: std::panicking::begin_panic
tests/ui/panics/location-detail-panic-no-column.run.stderr+1-1
......@@ -1,4 +1,4 @@
11
2thread 'main' panicked at $DIR/location-detail-panic-no-column.rs:7:0:
2thread 'main' ($TID) panicked at $DIR/location-detail-panic-no-column.rs:7:0:
33column-redacted
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
tests/ui/panics/location-detail-panic-no-file.run.stderr+1-1
......@@ -1,4 +1,4 @@
11
2thread 'main' panicked at <redacted>:7:5:
2thread 'main' ($TID) panicked at <redacted>:7:5:
33file-redacted
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
tests/ui/panics/location-detail-panic-no-line.run.stderr+1-1
......@@ -1,4 +1,4 @@
11
2thread 'main' panicked at $DIR/location-detail-panic-no-line.rs:0:5:
2thread 'main' ($TID) panicked at $DIR/location-detail-panic-no-line.rs:0:5:
33line-redacted
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
tests/ui/panics/location-detail-panic-no-location-info.run.stderr+1-1
......@@ -1,4 +1,4 @@
11
2thread 'main' panicked at <redacted>:0:0:
2thread 'main' ($TID) panicked at <redacted>:0:0:
33no location info
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
tests/ui/panics/location-detail-unwrap-no-file.run.stderr+1-1
......@@ -1,4 +1,4 @@
11
2thread 'main' panicked at <redacted>:8:9:
2thread 'main' ($TID) panicked at <redacted>:8:9:
33called `Option::unwrap()` on a `None` value
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
tests/ui/panics/main-panic.rs+1-1
......@@ -1,5 +1,5 @@
11//@ run-fail
2//@ error-pattern:thread 'main' panicked at
2//@ regex-error-pattern: thread 'main' \(\d+\) panicked at
33//@ needs-subprocess
44
55fn main() {
tests/ui/panics/panic-in-cleanup.run.stderr+3-3
......@@ -1,12 +1,12 @@
11
2thread 'main' panicked at $DIR/panic-in-cleanup.rs:22:5:
2thread 'main' ($TID) panicked at $DIR/panic-in-cleanup.rs:22:5:
33explicit panic
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55
6thread 'main' panicked at $DIR/panic-in-cleanup.rs:16:9:
6thread 'main' ($TID) panicked at $DIR/panic-in-cleanup.rs:16:9:
77BOOM
88stack backtrace:
99
10thread 'main' panicked at library/core/src/panicking.rs:$LINE:$COL:
10thread 'main' ($TID) panicked at library/core/src/panicking.rs:$LINE:$COL:
1111panic in a destructor during cleanup
1212thread caused non-unwinding panic. aborting.
tests/ui/panics/panic-in-ffi.run.stderr+2-2
......@@ -1,10 +1,10 @@
11
2thread 'main' panicked at $DIR/panic-in-ffi.rs:21:5:
2thread 'main' ($TID) panicked at $DIR/panic-in-ffi.rs:21:5:
33Test
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55Noisy Drop
66
7thread 'main' panicked at library/core/src/panicking.rs:$LINE:$COL:
7thread 'main' ($TID) panicked at library/core/src/panicking.rs:$LINE:$COL:
88panic in a function that cannot unwind
99stack backtrace:
1010thread caused non-unwinding panic. aborting.
tests/ui/panics/panic-set-unset-handler.rs+2-2
......@@ -1,6 +1,6 @@
11//@ run-fail
2//@ error-pattern:thread 'main' panicked
3//@ error-pattern:foobar
2//@ regex-error-pattern: thread 'main' \(\d+\) panicked
3//@ error-pattern: foobar
44//@ needs-subprocess
55
66use std::panic;
tests/ui/panics/panic-short-backtrace-windows-x86_64.run.stderr+1-1
......@@ -1,4 +1,4 @@
1thread 'main' panicked at 'd was called', $DIR/panic-short-backtrace-windows-x86_64.rs:48:5
1thread 'main' ($TID) panicked at 'd was called', $DIR/panic-short-backtrace-windows-x86_64.rs:48:5
22stack backtrace:
33 0: std::panicking::begin_panic
44 1: d
tests/ui/panics/panic-take-handler-nop.rs+2-2
......@@ -1,6 +1,6 @@
11//@ run-fail
2//@ error-pattern:thread 'main' panicked
3//@ error-pattern:foobar
2//@ regex-error-pattern: thread 'main' \(\d+\) panicked
3//@ error-pattern: foobar
44//@ needs-subprocess
55
66use std::panic;
tests/ui/panics/panic-task-name-none.rs+5-5
......@@ -1,14 +1,14 @@
11//@ run-fail
2//@ error-pattern:thread '<unnamed>' panicked
3//@ error-pattern:test
2//@ regex-error-pattern: thread '<unnamed>' \(\d+\) panicked
3//@ error-pattern: test
44//@ needs-threads
55
66use std::thread;
77
88fn main() {
99 let r: Result<(), _> = thread::spawn(move || {
10 panic!("test");
11 })
12 .join();
10 panic!("test");
11 })
12 .join();
1313 assert!(r.is_ok());
1414}
tests/ui/panics/panic-task-name-owned.rs+10-10
......@@ -1,19 +1,19 @@
11//@ run-fail
2//@ error-pattern:thread 'owned name' panicked
3//@ error-pattern:test
2//@ regex-error-pattern: thread 'owned name' \(\d+\) panicked
3//@ error-pattern: test
44//@ needs-threads
55
66use std::thread::Builder;
77
88fn main() {
99 let r: () = Builder::new()
10 .name("owned name".to_string())
11 .spawn(move || {
12 panic!("test");
13 ()
14 })
15 .unwrap()
16 .join()
17 .unwrap();
10 .name("owned name".to_string())
11 .spawn(move || {
12 panic!("test");
13 ()
14 })
15 .unwrap()
16 .join()
17 .unwrap();
1818 panic!();
1919}
tests/ui/panics/runtime-switch.run.stderr+1-1
......@@ -1,5 +1,5 @@
11
2thread 'main' panicked at $DIR/runtime-switch.rs:28:5:
2thread 'main' ($TID) panicked at $DIR/runtime-switch.rs:28:5:
33explicit panic
44stack backtrace:
55 0: std::panicking::begin_panic
tests/ui/panics/short-ice-remove-middle-frames-2.run.stderr+1-1
......@@ -1,5 +1,5 @@
11
2thread 'main' panicked at $DIR/short-ice-remove-middle-frames-2.rs:62:5:
2thread 'main' ($TID) panicked at $DIR/short-ice-remove-middle-frames-2.rs:62:5:
33debug!!!
44stack backtrace:
55 0: std::panicking::begin_panic
tests/ui/panics/short-ice-remove-middle-frames.run.stderr+1-1
......@@ -1,5 +1,5 @@
11
2thread 'main' panicked at $DIR/short-ice-remove-middle-frames.rs:58:5:
2thread 'main' ($TID) panicked at $DIR/short-ice-remove-middle-frames.rs:58:5:
33debug!!!
44stack backtrace:
55 0: std::panicking::begin_panic
tests/ui/proc-macro/load-panic-backtrace.rs+1-1
......@@ -1,7 +1,7 @@
11//@ proc-macro: test-macros.rs
22//@ compile-flags: -Z proc-macro-backtrace
33//@ rustc-env:RUST_BACKTRACE=0
4//@ normalize-stderr: "thread '.*' panicked " -> ""
4//@ normalize-stderr: "thread '.*' \(0x[[:xdigit:]]+\) panicked " -> ""
55//@ normalize-stderr: "note:.*RUST_BACKTRACE=1.*\n" -> ""
66//@ needs-unwind proc macro panics to report errors
77
tests/ui/proc-macro/load-panic-backtrace.stderr+1-1
......@@ -1,5 +1,5 @@
11
2at $DIR/auxiliary/test-macros.rs:38:5:
2thread '<unnamed>' ($TID) panicked at $DIR/auxiliary/test-macros.rs:38:5:
33panic-derive
44error: proc-macro derive panicked
55 --> $DIR/load-panic-backtrace.rs:11:10
tests/ui/process/multi-panic.rs+15-6
......@@ -7,18 +7,27 @@ fn check_for_no_backtrace(test: std::process::Output) {
77 let err = String::from_utf8_lossy(&test.stderr);
88 let mut it = err.lines().filter(|l| !l.is_empty());
99
10 assert_eq!(it.next().map(|l| l.starts_with("thread '<unnamed>' panicked")), Some(true));
11 assert_eq!(it.next().is_some(), true);
10 assert_eq!(
11 it.next().map(|l| l.starts_with("thread '<unnamed>' (") && l.contains("panicked")),
12 Some(true),
13 "out: ```{err}```",
14 );
15 assert_eq!(it.next().is_some(), true, "out: ```{err}```");
1216 assert_eq!(
1317 it.next(),
1418 Some(
1519 "note: run with `RUST_BACKTRACE=1` \
1620 environment variable to display a backtrace"
17 )
21 ),
22 "out: ```{err}```",
23 );
24 assert_eq!(
25 it.next().map(|l| l.starts_with("thread 'main' (") && l.contains("panicked at")),
26 Some(true),
27 "out: ```{err}```",
1828 );
19 assert_eq!(it.next().map(|l| l.starts_with("thread 'main' panicked at")), Some(true));
20 assert_eq!(it.next().is_some(), true);
21 assert_eq!(it.next(), None);
29 assert_eq!(it.next().is_some(), true, "out: ```{err}```");
30 assert_eq!(it.next(), None, "out: ```{err}```");
2231}
2332
2433fn main() {
tests/ui/process/println-with-broken-pipe.run.stderr+1-1
......@@ -1,4 +1,4 @@
11
2thread 'main' panicked at library/std/src/io/stdio.rs:LL:CC:
2thread 'main' ($TID) panicked at library/std/src/io/stdio.rs:LL:CC:
33failed printing to stdout: Broken pipe (os error 32)
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
tests/ui/resolve/multiple_definitions_attribute_merging.rs+1-1
......@@ -5,7 +5,7 @@
55//@known-bug: #120873
66//@ failure-status: 101
77//@ normalize-stderr: "note: .*\n\n" -> ""
8//@ normalize-stderr: "thread 'rustc' panicked.*\n" -> ""
8//@ normalize-stderr: "thread 'rustc'.*panicked.*\n" -> ""
99//@ normalize-stderr: "(error: internal compiler error: [^:]+):\d+:\d+: " -> "$1:LL:CC: "
1010//@ rustc-env:RUST_BACKTRACE=0
1111
tests/ui/resolve/proc_macro_generated_packed.rs+1-1
......@@ -5,7 +5,7 @@
55//@known-bug: #120873
66//@ failure-status: 101
77//@ normalize-stderr: "note: .*\n\n" -> ""
8//@ normalize-stderr: "thread 'rustc' panicked.*\n" -> ""
8//@ normalize-stderr: "thread 'rustc'.*panicked.*\n" -> ""
99//@ normalize-stderr: "(error: internal compiler error: [^:]+):\d+:\d+: " -> "$1:LL:CC: "
1010//@ rustc-env:RUST_BACKTRACE=0
1111
tests/ui/test-attrs/terse.run.stdout+3-3
......@@ -10,18 +10,18 @@ failures:
1010
1111---- abc stdout ----
1212
13thread 'abc' panicked at $DIR/terse.rs:12:5:
13thread 'abc' ($TID) panicked at $DIR/terse.rs:12:5:
1414explicit panic
1515note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
1616
1717---- foo stdout ----
1818
19thread 'foo' panicked at $DIR/terse.rs:17:5:
19thread 'foo' ($TID) panicked at $DIR/terse.rs:17:5:
2020explicit panic
2121
2222---- foo2 stdout ----
2323
24thread 'foo2' panicked at $DIR/terse.rs:22:5:
24thread 'foo2' ($TID) panicked at $DIR/terse.rs:22:5:
2525explicit panic
2626
2727
tests/ui/test-attrs/test-panic-abort-nocapture.run.stderr+2-2
......@@ -1,11 +1,11 @@
11
2thread 'main' panicked at $DIR/test-panic-abort-nocapture.rs:32:5:
2thread 'main' ($TID) panicked at $DIR/test-panic-abort-nocapture.rs:32:5:
33assertion `left == right` failed
44 left: 2
55 right: 4
66note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
77
8thread 'main' panicked at $DIR/test-panic-abort-nocapture.rs:26:5:
8thread 'main' ($TID) panicked at $DIR/test-panic-abort-nocapture.rs:26:5:
99assertion `left == right` failed
1010 left: 2
1111 right: 4
tests/ui/test-attrs/test-panic-abort.run.stdout+1-1
......@@ -18,7 +18,7 @@ testing123
1818---- it_fails stderr ----
1919testing321
2020
21thread 'main' panicked at $DIR/test-panic-abort.rs:37:5:
21thread 'main' ($TID) panicked at $DIR/test-panic-abort.rs:37:5:
2222assertion `left == right` failed
2323 left: 2
2424 right: 5
tests/ui/test-attrs/test-should-panic-failed-show-span.run.stderr+4-4
......@@ -1,13 +1,13 @@
11
2thread 'should_panic_with_any_message' panicked at $DIR/test-should-panic-failed-show-span.rs:14:5:
2thread 'should_panic_with_any_message' ($TID) panicked at $DIR/test-should-panic-failed-show-span.rs:14:5:
33Panic!
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55
6thread 'should_panic_with_message' panicked at $DIR/test-should-panic-failed-show-span.rs:20:5:
6thread 'should_panic_with_message' ($TID) panicked at $DIR/test-should-panic-failed-show-span.rs:20:5:
77message
88
9thread 'should_panic_with_substring_panics_with_incorrect_string' panicked at $DIR/test-should-panic-failed-show-span.rs:38:5:
9thread 'should_panic_with_substring_panics_with_incorrect_string' ($TID) panicked at $DIR/test-should-panic-failed-show-span.rs:38:5:
1010ZOMGWTFBBQ
1111
12thread 'should_panic_with_substring_panics_with_non_string_value' panicked at $DIR/test-should-panic-failed-show-span.rs:45:5:
12thread 'should_panic_with_substring_panics_with_non_string_value' ($TID) panicked at $DIR/test-should-panic-failed-show-span.rs:45:5:
1313Box<dyn Any>
tests/ui/test-attrs/test-thread-capture.run.stdout+1-1
......@@ -11,7 +11,7 @@ fie
1111foe
1212fum
1313
14thread 'thready_fail' panicked at $DIR/test-thread-capture.rs:32:5:
14thread 'thready_fail' ($TID) panicked at $DIR/test-thread-capture.rs:32:5:
1515explicit panic
1616note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
1717
tests/ui/test-attrs/test-thread-nocapture.run.stderr+1-1
......@@ -1,4 +1,4 @@
11
2thread 'thready_fail' panicked at $DIR/test-thread-nocapture.rs:32:5:
2thread 'thready_fail' ($TID) panicked at $DIR/test-thread-nocapture.rs:32:5:
33explicit panic
44note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
tests/ui/track-diagnostics/track.rs+5
......@@ -13,6 +13,11 @@
1313// top of this file are present, then assume all args are present.
1414//@ normalize-stderr: "note: compiler flags: .*-Z ui-testing.*-Z track-diagnostics" -> "note: compiler flags: ... -Z ui-testing ... -Z track-diagnostics"
1515
16// FIXME: this tests a crash in rustc. For stage1, rustc is built with the downloaded standard
17// library which doesn't yet print the thread ID. Normalization can be removed at the stage bump.
18// For the grep: cfg(bootstrap)
19//@normalize-stderr: "thread 'rustc' panicked" -> "thread 'rustc' ($$TID) panicked"
20
1621fn main() {
1722 break rust
1823 //~^ ERROR cannot find value `rust` in this scope
tests/ui/track-diagnostics/track.stderr+1-1
......@@ -27,7 +27,7 @@ LL | break rust
2727 = note: compiler flags: ... -Z ui-testing ... -Z track-diagnostics
2828
2929
30thread 'rustc' panicked at compiler/rustc_hir_typeck/src/lib.rs:LL:CC:
30thread 'rustc' ($TID) panicked at compiler/rustc_hir_typeck/src/lib.rs:LL:CC:
3131Box<dyn Any>
3232note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
3333
tests/ui/treat-err-as-bug/err.rs+1-1
......@@ -1,7 +1,7 @@
11//@ compile-flags: -Ztreat-err-as-bug
22//@ failure-status: 101
33//@ normalize-stderr: "note: .*\n\n" -> ""
4//@ normalize-stderr: "thread 'rustc' panicked.*:\n.*\n" -> ""
4//@ normalize-stderr: "thread 'rustc'.*panicked.*:\n.*\n" -> ""
55//@ rustc-env:RUST_BACKTRACE=0
66
77#![crate_type = "rlib"]
tests/ui/treat-err-as-bug/span_delayed_bug.rs+1-1
......@@ -1,7 +1,7 @@
11//@ compile-flags: -Ztreat-err-as-bug -Zeagerly-emit-delayed-bugs
22//@ failure-status: 101
33//@ normalize-stderr: "note: .*\n\n" -> ""
4//@ normalize-stderr: "thread 'rustc' panicked.*:\n.*\n" -> ""
4//@ normalize-stderr: "thread 'rustc'.*panicked.*:\n.*\n" -> ""
55//@ rustc-env:RUST_BACKTRACE=0
66
77#![feature(rustc_attrs)]
tests/ui/type/pattern_types/bad_const_generics_args_on_const_param.rs+1-1
......@@ -1,7 +1,7 @@
11//@known-bug: #127972
22//@ failure-status: 101
33//@ normalize-stderr: "note: .*\n\n" -> ""
4//@ normalize-stderr: "thread 'rustc' panicked.*\n" -> ""
4//@ normalize-stderr: "thread 'rustc'.*panicked.*\n" -> ""
55//@ normalize-stderr: "(error: internal compiler error: [^:]+):\d+:\d+: " -> "$1:LL:CC: "
66//@ rustc-env:RUST_BACKTRACE=0
77