Registry / utility / debug-unreachable

debug-unreachable

JSON →
library0.1.1rscratesunverified

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

# Cargo.toml [dependencies] debug_unreachable = "0.1.1"
INSTALL
IMPORT
SIG · DEBUG-UNREACHABLE
D
debug-unreachable
utilityrustv0.1.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

debug_unreachable
use debug_unreachable::debug_unreachable;

Uses debug_unreachable! macro to mark unreachable code paths.

use debug_unreachable::debug_unreachable; fn main() { let x = 1; match x { 1 => println!("one"), _ => unsafe { debug_unreachable!() }, } }
Debug
Known issues
breakingUses unsafe code in release mode; may cause undefined behavior if reached.
fix
Ensure the code path is truly unreachable before using.
affects: >=0.1.0
Upgrade
Version history
0.1.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
debug-unreachable — cargo add debug-unreachable · libregistry