2 ms·
The last paragraph is particularly important! Catching panics in Rust is meant pretty much only to avoid unwinding across an FFI boundary, since that would be
by SAI_Peregrinus 2y ago
The last paragraph is particularly important!
Catching panics in Rust is meant pretty much only to avoid unwinding across an FFI boundary, since that would be undefined behavior. Pretty much every other use of `catch_unwind` is a mistake, it's not guaranteed to catch all panics (they can also just abort) so panics are rather different from exceptions. Panics are intended to be useless for control flow, unwinding exists to help debugging, and any panic indicates a bug in the invoking program.