Registry / utility / no-panic

no-panic

JSON →
library0.1.36rscratesunverified

Attribute macro to require that the compiler prove a function can't ever panic.

# Cargo.toml [dependencies] no-panic = "0.1.36"
INSTALL
IMPORT
SIG · NO-PANIC
N
no-panic
utilityrustv0.1.36
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.

no_panic
use no_panic::no_panic;

Annotates a function to ensure it does not panic at compile time.

use no_panic::no_panic; #[no_panic] fn safe_function(x: i32) -> i32 { x + 1 } fn main() { println!("{}", safe_function(5)); }
Debug
Known issues
breakingMay fail to compile if the function uses any panicking operations (e.g., indexing, unwrap).
fix
Replace panicking operations with safe alternatives (e.g., `get` instead of indexing).
affects: >=0.1.0
Upgrade
Version history
0.1.36latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
no-panic — cargo add no-panic · libregistry