Skip to content

Commit

Permalink
Rollup merge of #105497 - albertlarsan68:doc-panic-hook-and-catch-unw…
Browse files Browse the repository at this point in the history
…ind, r=m-ou-se

Clarify `catch_unwind` docs about panic hooks

Makes it clear from `catch_unwind` docs that the panic hook will be called before the panic is caught.

Fixes #105432
  • Loading branch information
matthiaskrgr committed Dec 28, 2022
2 parents 22060f2 + cb7c899 commit 0b7ed65
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions library/std/src/panic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ where
/// aborting the process as well. This function *only* catches unwinding panics,
/// not those that abort the process.
///
/// Note that if a custom panic hook has been set, it will be invoked before
/// the panic is caught, before unwinding.
///
/// Also note that unwinding into Rust code with a foreign exception (e.g.
/// an exception thrown from C++ code) is undefined behavior.
///
Expand Down

0 comments on commit 0b7ed65

Please sign in to comment.