News for hackers. Stuff that matters.
Re:Rust panics under the hood, and implementing them in .NET by SAI_Peregrinus on Monday September 23, 2024 @07:00PM (#41631485)
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.

There are no comments on this comment yet.