Macro debug_unreachable::debug_unreachable
source · macro_rules! debug_unreachable { () => { ... }; ($e:expr) => { ... }; }
Expand description
panic!()
in debug builds, optimization hint in release.
This is equivalent to core::unreachable
in debug builds,
and core::hint::unreachable_unchecked
in release builds.
Example:
use debug_unreachable::debug_unreachable;
if 0 > 100 {
// Can't happen!
unsafe { debug_unreachable!() }
} else {
println!("Good, 0 <= 100.");
}