| 1 |
# new_debug_unreachable |
| 2 |
|
| 3 |
> unreachable!() in debug, std::intrinsics::unreachable() in release. |
| 4 |
|
| 5 |
This is a fork of [`debug_unreachable`](https://crates.io/crates/debug_unreachable). |
| 6 |
|
| 7 |
## [Documentation](https://docs.rs/new_debug_unreachable) |
| 8 |
|
| 9 |
## Usage |
| 10 |
|
| 11 |
Use the crates.io repository; add this to your `Cargo.toml` along |
| 12 |
with the rest of your dependencies: |
| 13 |
|
| 14 |
```toml |
| 15 |
[dependencies] |
| 16 |
new_debug_unreachable = "1.0" |
| 17 |
``` |
| 18 |
|
| 19 |
In your Rust code, the library name is still `debug_unreachable`: |
| 20 |
|
| 21 |
```rust |
| 22 |
use debug_unreachable::debug_unreachable; |
| 23 |
|
| 24 |
fn main() { |
| 25 |
if 0 > 100 { |
| 26 |
// Can't happen! |
| 27 |
unsafe { debug_unreachable!() } |
| 28 |
} else { |
| 29 |
println!("Good, 0 <= 100."); |
| 30 |
} |
| 31 |
} |
| 32 |
``` |
| 33 |
|
| 34 |
## Author |
| 35 |
|
| 36 |
[Jonathan Reem](https://medium.com/@jreem) is the original author of debug-unreachable. |
| 37 |
|
| 38 |
[Matt Brubeck](https://limpet.net/mbrubeck/) is the maintainer of this fork. |
| 39 |
|
| 40 |
## License |
| 41 |
|
| 42 |
MIT |