4 ms·
No! Exceptions have a very well defined meaning. Exceptions in Rust are non-aborting panics.
by cornstalks 4y ago
No! Exceptions have a very well defined meaning. Exceptions in Rust are non-aborting panics.
- kibwen 4y agoWhen people talk about "exceptions", they mean resumable exceptions that are intended to be caught. But "catching" an unwinding panic in Rust is so (deliberately!) limited, cumbersome, and unidiomatic that it doesn't qualify as an implementation of resumable exceptions. The only reason the ability to "catch" an unwinding panic even exists in Rust is to prevent unwinding across FFI boundaries, which would be UB; it's a correctness mechanism, not an error-handling mechanism.