Skip to content

Commit 0b7ed65

Browse files
authored
Rollup merge of #105497 - albertlarsan68:doc-panic-hook-and-catch-unwind, 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
2 parents 22060f2 + cb7c899 commit 0b7ed65

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

library/std/src/panic.rs

+3
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)