3 ms·
panic is just different name for exception though.
by garaetjjte 5y ago
panic is just different name for exception though.
- throwawayninja 5y agoExceptions can be handled, so in rust an "exception" is a "Result<T,U>". A panic means the program terminates, guaranteed. This allows us to ignore hugely difficult edge cases when interacting with hardware / OSes and still ensure the code meets safety guarantees; if the code isn't executing it cannot invalidate any invariants.
- baseballdork 5y ago> A panic means the program terminates, guaranteed. That's not strictly true: https://doc.rust-lang.org/std/panic/fn.catch_unwind.html https://doc.rust-lang.org/std/panic/fn.catch_unwind.html