diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-12-28 22:22:21 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-28 22:22:21 +0100 |
| commit | d28ef9dbf1e9bedd0a30ad96ead65d95aaa09ebb (patch) | |
| tree | e89d087e56c18320949d77252bc58c1c2c70cba2 | |
| parent | 06306770f83404fe5f73658d3e041768ec5736af (diff) | |
| parent | b804c0d5a54dee10a59fc2b3d54037cb96fbb598 (diff) | |
| download | rust-d28ef9dbf1e9bedd0a30ad96ead65d95aaa09ebb.tar.gz rust-d28ef9dbf1e9bedd0a30ad96ead65d95aaa09ebb.zip | |
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
| -rw-r--r-- | library/std/src/panicking.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/library/std/src/panicking.rs b/library/std/src/panicking.rs index 1039835bbbd..49c2f81403a 100644 --- a/library/std/src/panicking.rs +++ b/library/std/src/panicking.rs @@ -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(); } |
