[][src]Macro chek::debug_unreachable_unchecked

macro_rules! debug_unreachable_unchecked {
    ($($arg:tt)*) => { ... };
}

In debug mode, panics if reached (with unreachable!). In release mode, is a std::hint::unreachable_unchecked() call. This is unsafe to call in both debug and release builds.

Example

let value = Some(10);
// Obviously, be extremely sure you're correct if you use this.
let contents = value.unwrap_or_else(|| unsafe {
    chek::debug_unreachable_unchecked!("optional message")
});