Rollup merge of #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
This commit is contained in:
Matthias Krüger 2022-12-28 22:22:21 +01:00 committed by GitHub
commit d28ef9dbf1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -699,7 +699,11 @@ fn rust_panic_with_hook(
// have limited options. Currently our preference is to
// just abort. In the future we may consider resuming
// unwinding or otherwise exiting the thread cleanly.
rtprintpanic!("thread panicked while panicking. aborting.\n");
if !can_unwind {
rtprintpanic!("thread caused non-unwinding panic. aborting.\n");
} else {
rtprintpanic!("thread panicked while panicking. aborting.\n");
}
crate::sys::abort_internal();
}