mirror of
https://github.com/rust-lang/rust.git
synced 2025-09-28 05:34:45 +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.
18 lines
636 B
Rust
18 lines
636 B
Rust
//! Check that intrinsics that do not get overridden, but are marked as such,
|
|
//! cause an error instead of silently invoking the body.
|
|
#![feature(intrinsics)]
|
|
//@ build-fail
|
|
//@ failure-status:101
|
|
//@ normalize-stderr: ".*note: .*\n\n" -> ""
|
|
//@ normalize-stderr: "thread 'rustc'.*panicked.*:\n.*\n" -> ""
|
|
//@ normalize-stderr: "internal compiler error:.*: intrinsic const_deallocate " -> ""
|
|
//@ rustc-env:RUST_BACKTRACE=0
|
|
|
|
#[rustc_intrinsic]
|
|
pub const unsafe fn const_deallocate(_ptr: *mut u8, _size: usize, _align: usize);
|
|
|
|
fn main() {
|
|
unsafe { const_deallocate(std::ptr::null_mut(), 0, 0) }
|
|
//~^ ERROR: must be overridden
|
|
}
|