macro_rules! assume {
($cond:expr) => { ... };
($cond:expr, $($arg:tt)+) => { ... };
}
Expand description
A macro that combines debug_assert and std::hint::assert_unchecked for optimized assertions
In debug builds, this will perform a normal assertion check. In release builds, this will use hint::assert_unchecked which tells the compiler to assume the condition is true without actually checking it.
ยงSafety
This macro is unsafe in release builds since it uses hint::assert_unchecked. The caller must ensure the condition will always be true.