-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Clarify catch_unwind
docs about panic hooks
#105497
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Clarify catch_unwind
docs about panic hooks
#105497
Conversation
r? @m-ou-se (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
|
@rustbot label +A-docs |
@m-ou-se Can this PR have a review, or if you can't please give it to somebody else pls? |
library/std/src/panic.rs
Outdated
/// If a custom panic hook has been set, note that it will be invoked before | ||
/// the panic is caught. |
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.
Let's also mention that the hook is executed before unwinding starts:
/// If a custom panic hook has been set, note that it will be invoked before | |
/// the panic is caught. | |
/// Note that if a custom panic hook has been set, it will be invoked before | |
/// the panic is caught, before unwinding. |
Makes it clear from catch_unwind docs that the panic hook will be called before the panic is caught.
261dc40
to
cb7c899
Compare
@rustbot ready |
@bors r+ rollup |
…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
Makes it clear from
catch_unwind
docs that the panic hook will be called before the panic is caught.Fixes #105432