rust/tests/ui/consts/const-assert-unchecked-ub.rs
Trevor Gross 5745c220e6 Stabilize hint_assert_unchecked
Make both `hint_assert_unchecked` and `const_hint_assert_unchecked`
stable as `hint_assert_unchecked`.
2024-06-19 19:31:41 -04:00

7 lines
162 B
Rust

const _: () = unsafe {
let n = u32::MAX.count_ones();
std::hint::assert_unchecked(n < 32); //~ ERROR evaluation of constant value failed
};
fn main() {}