You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that the behaviour of the default (in rustc libstd) panic handler is interesting here, and I don't know how much of that is stable or implementation detail:
On the first panic, it runs the panic hook, then executes the default action depending on the runtime - unwind or abort,
On the second panic, it enters the panic hook as well (which can cause it to reenter if it was the panic hook, rather than a destructor, that panicked for a second time), then aborts immediately.
If a panic happens for the third time, it just instantly aborts the process without running the panic hook.
I can't find any documentation about double panic behavior (other than https://doc.rust-lang.org/std/ops/trait.Drop.html#panics, which currently just says "will likely abort the program"). There are some subtleties about this, because some handlers will cause a hang (see rust-lang/rust#97146).
I'm not sure exactly where or how to document this. Some thoughts:
panic_handler
attributeThe text was updated successfully, but these errors were encountered: