From fc257fae3c6d4adc6effb2535fb9130d8c15e3ff Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 23 Mar 2024 09:40:16 +0100 Subject: add panic location to 'panicked while processing panic' --- library/std/src/panicking.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'library/std/src') diff --git a/library/std/src/panicking.rs b/library/std/src/panicking.rs index 464a46264cb..6121eaf86ce 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 -- cgit 1.4.1-3-g733a5