-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adjust message on non-unwinding panic #105998
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
library/std/src/panicking.rs
Outdated
@@ -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!("this is a non-unwinding panic. aborting.\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is written from a different perspective than the unwinding case. Is that because this reads differently in context?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it? What alternative wording would preserve the same perspective?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"non-unwinding panic launched. aborting."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see. Seems fine for me, except I don't think "launch" is usually the verb we use for panics, is it?
The docs usually seem to use "panic" as verb and not noun, so... not sure how to best use that here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am going with "thread caused non-unwinding panic." for now. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, that reads better to me.
r? @thomcc |
bef4e92
to
b804c0d
Compare
LGTM |
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#104402 (Move `ReentrantMutex` to `std::sync`) - rust-lang#104493 (available_parallelism: Gracefully handle zero value cfs_period_us) - rust-lang#105359 (Make sentinel value configurable in `library/std/src/sys_common/thread_local_key.rs`) - rust-lang#105497 (Clarify `catch_unwind` docs about panic hooks) - rust-lang#105570 (Properly calculate best failure in macro matching) - rust-lang#105702 (Format only modified files) - rust-lang#105998 (adjust message on non-unwinding panic) - rust-lang#106161 (Iterator::find: link to Iterator::position in docs for discoverability) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
"thread panicked while panicking" is just plain wrong in case this is a non-unwinding panic, such as
nounwind
functionmem::uninitialized
andmem::zeroed