rust/tests/rustdoc-ui/doctest/stdout-and-stderr.stdout
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

48 lines
1.2 KiB
Plaintext

running 3 tests
test $DIR/stdout-and-stderr.rs - (line 17) ... FAILED
test $DIR/stdout-and-stderr.rs - (line 22) ... FAILED
test $DIR/stdout-and-stderr.rs - (line 26) ... FAILED
failures:
---- $DIR/stdout-and-stderr.rs - (line 17) stdout ----
Test executable failed (exit status: 101).
stdout:
######## from a DOC TEST ########
stderr:
thread 'main' ($TID) panicked at $TMP:7:1:
assertion `left == right` failed
left: "doc"
right: "test"
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
---- $DIR/stdout-and-stderr.rs - (line 22) stdout ----
Test executable failed (exit status: 101).
stderr:
thread 'main' ($TID) panicked at $TMP:15:1:
assertion `left == right` failed
left: "doc"
right: "test"
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
---- $DIR/stdout-and-stderr.rs - (line 26) stdout ----
Test executable failed (exit status: 1).
failures:
$DIR/stdout-and-stderr.rs - (line 17)
$DIR/stdout-and-stderr.rs - (line 22)
$DIR/stdout-and-stderr.rs - (line 26)
test result: FAILED. 0 passed; 3 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
all doctests ran in $TIME; merged doctests compilation took $TIME