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
This commit is contained in:
Matthias Krüger 2022-12-28 22:22:19 +01:00 committed by GitHub
commit 0b7ed65c13
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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.
///