rust/tests/rustdoc-ui/doctest/failed-doctest-output.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

42 lines
1.0 KiB
Plaintext

running 2 tests
test $DIR/failed-doctest-output.rs - OtherStruct (line 25) ... FAILED
test $DIR/failed-doctest-output.rs - SomeStruct (line 15) ... FAILED
failures:
---- $DIR/failed-doctest-output.rs - OtherStruct (line 25) stdout ----
error[E0425]: cannot find value `no` in this scope
--> $DIR/failed-doctest-output.rs:26:1
|
LL | no
| ^^ not found in this scope
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0425`.
Couldn't compile the test.
---- $DIR/failed-doctest-output.rs - SomeStruct (line 15) stdout ----
Test executable failed (exit status: 101).
stdout:
stdout 1
stdout 2
stderr:
stderr 1
stderr 2
thread 'main' ($TID) panicked at $DIR/failed-doctest-output.rs:7:1:
oh no
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failures:
$DIR/failed-doctest-output.rs - OtherStruct (line 25)
$DIR/failed-doctest-output.rs - SomeStruct (line 15)
test result: FAILED. 0 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME