rust/tests/compile-fail/invalid_bool2.rs

5 lines
134 B
Rust
Raw Normal View History

fn main() {
let b = unsafe { std::mem::transmute::<u8, bool>(2) };
let _x = b == true; //~ ERROR invalid boolean value read
}