diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-03-23 15:00:20 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-23 15:00:20 +0100 |
| commit | 691d5f533d7e1833301d0b52b2e7cc5762f6c365 (patch) | |
| tree | 94549edb2f4eb102357b4062f0ce6c315b5473c6 /library/std/src | |
| parent | aaf5f3b53ebda0e5249c2213ee99933e5605aae7 (diff) | |
| parent | fc257fae3c6d4adc6effb2535fb9130d8c15e3ff (diff) | |
| download | rust-691d5f533d7e1833301d0b52b2e7cc5762f6c365.tar.gz rust-691d5f533d7e1833301d0b52b2e7cc5762f6c365.zip | |
Rollup merge of #122930 - RalfJung:panic-in-panic-fmt, r=Amanieu
add panic location to 'panicked while processing panic' Fixes https://github.com/rust-lang/rust/issues/97181 r? `@Amanieu`
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/panicking.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/library/std/src/panicking.rs b/library/std/src/panicking.rs index b0bcab7994c..e6e1d32fa54 100644 --- a/library/std/src/panicking.rs +++ b/library/std/src/panicking.rs @@ -746,7 +746,13 @@ fn rust_panic_with_hook( panic_count::MustAbort::PanicInHook => { // Don't try to print the message in this case // - perhaps that is causing the recursive panics. - rtprintpanic!("thread panicked while processing panic. aborting.\n"); + let panicinfo = PanicInfo::internal_constructor( + None, // no message + location, // but we want to show the location! + can_unwind, + force_no_backtrace, + ); + rtprintpanic!("{panicinfo}\nthread panicked while processing panic. aborting.\n"); } panic_count::MustAbort::AlwaysAbort => { // Unfortunately, this does not print a backtrace, because creating |
