Hacker News new | ask | show | jobs
by prmph 520 days ago
> This function might not catch all Rust panics. A Rust panic is not always implemented via unwinding, but can be implemented by aborting the process as well. This function only catches unwinding panics, not those that abort the process.
1 comments

The default behavior is unwind, and unless the library is targeting something like bare metal embedded, in all likelihood will never resort to an aborting panic.

I'll bet $20 USD to the open source project of your choice that the authors of whatever PDF library was being referenced here did not go out of their way to abort on panic, and that it's just a normal unwind.

But it stops being a normal unwind if I set panic=abort.

I can legitimately want my app to fail if it’s in a bad state but not have third party libraries do this on my behalf.