A fork of Kixunil/dont_panic that uses unreachable! instead of panic!
Ensures that code can't panic at compile time.
This code will compile and (not) run just fine:
rust
let should_panic = false;
if should_panic {
unreachable_checked!("This will never execute.");
}
However, this code will cause a linking error:
rust
let should_panic = true;
if should_panic {
unreachable_checked!("This will never execute.");
}
panic
cargo feature to panic instead