mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-24 22:17:08 +00:00
`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.
16 lines
410 B
Rust
16 lines
410 B
Rust
//@ proc-macro: test-macros.rs
|
|
//@ compile-flags: -Z proc-macro-backtrace
|
|
//@ rustc-env:RUST_BACKTRACE=0
|
|
//@ normalize-stderr: "thread '.*' \(0x[[:xdigit:]]+\) panicked " -> ""
|
|
//@ normalize-stderr: "note:.*RUST_BACKTRACE=1.*\n" -> ""
|
|
//@ needs-unwind proc macro panics to report errors
|
|
|
|
#[macro_use]
|
|
extern crate test_macros;
|
|
|
|
#[derive(Panic)]
|
|
//~^ ERROR: proc-macro derive panicked
|
|
struct Foo;
|
|
|
|
fn main() {}
|