Registry / utility / abort-on-panic

abort-on-panic

JSON →
library2.0.0rscratesunverified

Intercepts panic! from unsafe locations and aborts the process to prevent undefined behavior.

# Cargo.toml [dependencies] abort_on_panic = "2.0.0"
INSTALL
IMPORT
SIG · ABORT-ON-PANIC
A
abort-on-panic
utilityrustv2.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

abort_on_panic
use abort_on_panic::abort_on_panic;

Wraps a closure to abort on panic.

use abort_on_panic::abort_on_panic; fn main() { abort_on_panic(|| { // unsafe code that might panic panic!("this will abort"); }); }
Debug
Known issues
gotchaOnly works with the default panic hook; custom hooks may interfere.
fix
Ensure no custom panic hook is set before using this crate.
affects: >=2.0.0
Upgrade
Version history
2.0.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
44 hits · last 30 days
node
36
OpenAI (training)
1
Resources
abort-on-panic — cargo add abort-on-panic · libregistry