@@ -311,18 +311,19 @@ where
311
311
///
312
312
/// # Notes
313
313
///
314
- /// This function **might not catch all panics** in Rust. A panic in Rust is not
315
- /// always implemented via unwinding, but can be implemented by aborting the
316
- /// process as well. This function *only* catches unwinding panics, not those
317
- /// that abort the process.
314
+ /// This function **cannot** catch panics when `panic=abort`, or with a manually written panic
315
+ /// handler that aborts the process.
318
316
///
319
317
/// If a custom panic hook has been set, it will be invoked before the panic is
320
318
/// caught, before unwinding.
321
319
///
322
320
/// Although unwinding into Rust code with a foreign exception (e.g. an
323
- /// exception thrown from C++ code) via an appropriate ABI (e.g. `"C-unwind"`)
324
- /// is permitted, catching such an exception using this function is undefined
325
- /// behavior.
321
+ /// exception thrown from C++ code, or a `panic!` in Rust code compiled or linked with a different
322
+ /// runtime) via an appropriate ABI (e.g. `"C-unwind"`) is permitted, catching such an exception
323
+ /// using this function will have one of two behaviors, and it is unspecified which will occur:
324
+ ///
325
+ /// * The process aborts.
326
+ /// * The function returns a `Result::Err` containing an opaque type.
326
327
///
327
328
/// Finally, be **careful in how you drop the result of this function**.
328
329
/// If it is `Err`, it contains the panic payload, and dropping that may in turn panic!
0 commit comments