Skip to content

Commit

Permalink
Clarify catch_unwind docs about panic hooks
Browse files Browse the repository at this point in the history
Makes it clear from catch_unwind docs that the panic hook will be called
before the panic is caught.
  • Loading branch information
albertlarsan68 committed Dec 28, 2022
1 parent 14ca83a commit cb7c899
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 cb7c899

Please sign in to comment.