Skip to content

Commit cb7c899

Browse files
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.
1 parent 14ca83a commit cb7c899

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

library/std/src/panic.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ where
114114
/// aborting the process as well. This function *only* catches unwinding panics,
115115
/// not those that abort the process.
116116
///
117+
/// Note that if a custom panic hook has been set, it will be invoked before
118+
/// the panic is caught, before unwinding.
119+
///
117120
/// Also note that unwinding into Rust code with a foreign exception (e.g.
118121
/// an exception thrown from C++ code) is undefined behavior.
119122
///

0 commit comments

Comments
 (0)