#debug #unreachable #debugging #panic #rest #fork

new_debug_unreachable

panic in debug, intrinsics::unreachable() in release (fork of debug_unreachable)

5 stable releases

1.0.4 Dec 30, 2019
1.0.3 Feb 26, 2019
1.0.2 Feb 16, 2019
1.0.1 Jun 3, 2018
1.0.0 Jun 1, 2018

#186 in Debugging

Download history 137697/week @ 2022-08-19 139031/week @ 2022-08-26 141585/week @ 2022-09-02 154718/week @ 2022-09-09 128303/week @ 2022-09-16 142482/week @ 2022-09-23 140647/week @ 2022-09-30 158396/week @ 2022-10-07 156936/week @ 2022-10-14 139361/week @ 2022-10-21 135175/week @ 2022-10-28 127385/week @ 2022-11-04 133619/week @ 2022-11-11 121286/week @ 2022-11-18 124225/week @ 2022-11-25 118916/week @ 2022-12-02

520,692 downloads per month
Used in 1,263 crates (10 directly)

MIT license

3KB

new_debug_unreachable

unreachable!() in debug, std::intrinsics::unreachable() in release.

This is a fork of debug_unreachable.

Documentation

Usage

Use the crates.io repository; add this to your Cargo.toml along with the rest of your dependencies:

[dependencies]
new_debug_unreachable = "1.0"

In your Rust code, the library name is still debug_unreachable:

use debug_unreachable::debug_unreachable;

fn main() {
    if 0 > 100 {
        // Can't happen!
        unsafe { debug_unreachable!() }
    } else {
        println!("Good, 0 <= 100.");
    }
}

Author

Jonathan Reem is the original author of debug-unreachable.

Matt Brubeck is the maintainer of this fork.

License

MIT


lib.rs:

panic!() in debug builds, optimization hint in release.

No runtime deps