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.
This commit is contained in:
Albert Larsan 2022-12-09 14:57:57 +01:00
parent 14ca83a04b
commit cb7c8993b9
No known key found for this signature in database
GPG Key ID: F91FB20C20E1306C

View File

@ -114,6 +114,9 @@ impl<K, V, S> UnwindSafe for collections::HashMap<K, V, S>
/// 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.
///