Skip to content

Commit d28ef9d

Browse files
authored
Rollup merge of rust-lang#105998 - RalfJung:no-unwind-panic-msg, r=thomcc
adjust message on non-unwinding panic "thread panicked while panicking" is just plain wrong in case this is a non-unwinding panic, such as - a panic out of a `nounwind` function - the sanity checks we have in `mem::uninitialized` and `mem::zeroed` - the optional debug assertion in various unsafe std library functions
2 parents 0630677 + b804c0d commit d28ef9d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

library/std/src/panicking.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,11 @@ fn rust_panic_with_hook(
699699
// have limited options. Currently our preference is to
700700
// just abort. In the future we may consider resuming
701701
// unwinding or otherwise exiting the thread cleanly.
702-
rtprintpanic!("thread panicked while panicking. aborting.\n");
702+
if !can_unwind {
703+
rtprintpanic!("thread caused non-unwinding panic. aborting.\n");
704+
} else {
705+
rtprintpanic!("thread panicked while panicking. aborting.\n");
706+
}
703707
crate::sys::abort_internal();
704708
}
705709

0 commit comments

Comments
 (0)