rust/tests/ui/panics
Trevor Gross 289fe36d37 Print thread ID in panic message if thread name is unknown
`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>' (0xff9bf) 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.
2025-08-06 23:59:47 +00:00
..
abort-on-panic.rs tests: use needs-subprocess instead of ignore-{wasm32,emscripten,sgx} 2025-01-23 20:51:29 +08:00
args-panic.rs tests: use needs-subprocess instead of ignore-{wasm32,emscripten,sgx} 2025-01-23 20:51:29 +08:00
catch-unwind-bang.rs Move tests from /ui directory 2025-04-29 18:19:26 +02:00
default-backtrace-ice.rs compiletest: Support matching on non-json lines in compiler output 2025-05-04 18:27:45 +03:00
default-backtrace-ice.stderr compiletest: Support matching on non-json lines in compiler output 2025-05-04 18:27:45 +03:00
doublepanic.rs tests: use needs-subprocess instead of ignore-{wasm32,emscripten,sgx} 2025-01-23 20:51:29 +08:00
explicit-panic-msg.rs tests: use needs-subprocess instead of ignore-{wasm32,emscripten,sgx} 2025-01-23 20:51:29 +08:00
explicit-panic.rs tests: use needs-subprocess instead of ignore-{wasm32,emscripten,sgx} 2025-01-23 20:51:29 +08:00
fmt-only-once.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
fmt-only-once.run.stderr Print thread ID in panic message if thread name is unknown 2025-08-06 23:59:47 +00:00
fmt-panic.rs tests: use needs-subprocess instead of ignore-{wasm32,emscripten,sgx} 2025-01-23 20:51:29 +08:00
issue-47429-short-backtraces.rs tests: remove redundant //@ ignore-{wasm,wasm32,emscripten} 2025-02-03 22:27:17 +08:00
issue-47429-short-backtraces.run.stderr Print thread ID in panic message if thread name is unknown 2025-08-06 23:59:47 +00:00
location-detail-panic-no-column.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
location-detail-panic-no-column.run.stderr Print thread ID in panic message if thread name is unknown 2025-08-06 23:59:47 +00:00
location-detail-panic-no-file.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
location-detail-panic-no-file.run.stderr Print thread ID in panic message if thread name is unknown 2025-08-06 23:59:47 +00:00
location-detail-panic-no-line.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
location-detail-panic-no-line.run.stderr Print thread ID in panic message if thread name is unknown 2025-08-06 23:59:47 +00:00
location-detail-panic-no-location-info.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
location-detail-panic-no-location-info.run.stderr Print thread ID in panic message if thread name is unknown 2025-08-06 23:59:47 +00:00
location-detail-unwrap-multiline.rs Add a missing colon at the end of the expected panic message in location-detail-unwrap-multiline.rs 2025-06-17 12:24:44 -07:00
location-detail-unwrap-no-file.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
location-detail-unwrap-no-file.run.stderr Print thread ID in panic message if thread name is unknown 2025-08-06 23:59:47 +00:00
main-panic.rs Print thread ID in panic message if thread name is unknown 2025-08-06 23:59:47 +00:00
nested_panic_caught.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
oom-panic-unwind.rs cleaned up some tests 2025-07-05 00:50:51 +05:00
panic-2021.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
panic-2021.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
panic-arg.rs tests: use needs-subprocess instead of ignore-{wasm32,emscripten,sgx} 2025-01-23 20:51:29 +08:00
panic-during-display-formatting.rs cleaned up some tests 2025-07-05 03:46:08 +05:00
panic-handler-chain-update-hook.rs tests: use needs-threads instead of ignore-emscripten 2025-01-23 20:51:29 +08:00
panic-handler-chain.rs compiletest: Add a //@ needs-threads directive 2024-03-06 12:35:07 -08:00
panic-handler-closures.rs cleaned up some tests 2025-07-05 03:46:08 +05:00
panic-handler-flail-wildly.rs tests: use needs-threads instead of ignore-emscripten 2025-01-23 20:51:29 +08:00
panic-handler-set-twice.rs tests: use needs-threads instead of ignore-emscripten 2025-01-23 20:51:29 +08:00
panic-in-cleanup.rs tests: Require run-fail ui tests to have an exit code (SIGABRT not ok) 2025-07-19 18:44:07 +02:00
panic-in-cleanup.run.stderr Print thread ID in panic message if thread name is unknown 2025-08-06 23:59:47 +00:00
panic-in-dtor-drops-fields.rs tests: use needs-threads instead of ignore-emscripten 2025-01-23 20:51:29 +08:00
panic-in-ffi.rs tests: Require run-fail ui tests to have an exit code (SIGABRT not ok) 2025-07-19 18:44:07 +02:00
panic-in-ffi.run.stderr Print thread ID in panic message if thread name is unknown 2025-08-06 23:59:47 +00:00
panic-in-message-fmt.rs tests: Require run-fail ui tests to have an exit code (SIGABRT not ok) 2025-07-19 18:44:07 +02:00
panic-in-message-fmt.run.stderr panic-in-panic-hook: formatting a message that's just a string is risk-free 2024-03-24 10:29:44 +01:00
panic-macro-any-wrapped.rs tests: use needs-subprocess instead of ignore-{wasm32,emscripten,sgx} 2025-01-23 20:51:29 +08:00
panic-macro-any.rs tests: use needs-subprocess instead of ignore-{wasm32,emscripten,sgx} 2025-01-23 20:51:29 +08:00
panic-macro-explicit.rs tests: use needs-subprocess instead of ignore-{wasm32,emscripten,sgx} 2025-01-23 20:51:29 +08:00
panic-macro-fmt.rs tests: use needs-subprocess instead of ignore-{wasm32,emscripten,sgx} 2025-01-23 20:51:29 +08:00
panic-macro-owned.rs tests: use needs-subprocess instead of ignore-{wasm32,emscripten,sgx} 2025-01-23 20:51:29 +08:00
panic-macro-static.rs tests: use needs-subprocess instead of ignore-{wasm32,emscripten,sgx} 2025-01-23 20:51:29 +08:00
panic-main.rs tests: Require run-fail ui tests to have an exit code (SIGABRT not ok) 2025-07-19 18:44:07 +02:00
panic-parens.rs tests: use needs-subprocess instead of ignore-{wasm32,emscripten,sgx} 2025-01-23 20:51:29 +08:00
panic-recover-propagate.rs tests: use needs-threads instead of ignore-emscripten 2025-01-23 20:51:29 +08:00
panic-set-handler.rs tests: use needs-subprocess instead of ignore-{wasm32,emscripten,sgx} 2025-01-23 20:51:29 +08:00
panic-set-unset-handler.rs Print thread ID in panic message if thread name is unknown 2025-08-06 23:59:47 +00:00
panic-short-backtrace-windows-x86_64.rs Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
panic-short-backtrace-windows-x86_64.run.stderr Print thread ID in panic message if thread name is unknown 2025-08-06 23:59:47 +00:00
panic-take-handler-nop.rs Print thread ID in panic message if thread name is unknown 2025-08-06 23:59:47 +00:00
panic-task-name-none.rs Print thread ID in panic message if thread name is unknown 2025-08-06 23:59:47 +00:00
panic-task-name-owned.rs Print thread ID in panic message if thread name is unknown 2025-08-06 23:59:47 +00:00
panic.rs tests: use needs-subprocess instead of ignore-{wasm32,emscripten,sgx} 2025-01-23 20:51:29 +08:00
result-get-panic.rs tests: use needs-subprocess instead of ignore-{wasm32,emscripten,sgx} 2025-01-23 20:51:29 +08:00
runtime-switch.rs tests: remove redundant //@ ignore-{wasm,wasm32,emscripten} 2025-02-03 22:27:17 +08:00
runtime-switch.run.stderr Print thread ID in panic message if thread name is unknown 2025-08-06 23:59:47 +00:00
rvalue-cleanup-during-box-panic.rs cleaned up some tests 2025-06-05 20:03:29 +05:00
short-ice-remove-middle-frames-2.rs tests: remove redundant //@ ignore-{wasm,wasm32,emscripten} 2025-02-03 22:27:17 +08:00
short-ice-remove-middle-frames-2.run.stderr Print thread ID in panic message if thread name is unknown 2025-08-06 23:59:47 +00:00
short-ice-remove-middle-frames.rs tests: remove redundant //@ ignore-{wasm,wasm32,emscripten} 2025-02-03 22:27:17 +08:00
short-ice-remove-middle-frames.run.stderr Print thread ID in panic message if thread name is unknown 2025-08-06 23:59:47 +00:00
test-panic.rs tests: use needs-subprocess instead of ignore-{wasm32,emscripten,sgx} 2025-01-23 20:51:29 +08:00
test-should-fail-bad-message.rs Update test directives for wasm32-wasip1 2024-03-11 09:36:35 -07:00
test-should-panic-bad-message.rs Update test directives for wasm32-wasip1 2024-03-11 09:36:35 -07:00
test-should-panic-no-message.rs tests: use needs-subprocess instead of ignore-{wasm32,emscripten,sgx} 2025-01-23 20:51:29 +08:00
unique-panic.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unwind-force-no-unwind-tables.rs cleaned up some tests 2025-07-10 18:50:35 +05:00
while-body-panics.rs tests: use needs-subprocess instead of ignore-{wasm32,emscripten,sgx} 2025-01-23 20:51:29 +08:00
while-panic.rs tests: use needs-subprocess instead of ignore-{wasm32,emscripten,sgx} 2025-01-23 20:51:29 +08:00