rust/tests/compile-fail/invalid_bool2.rs
2018-08-24 19:18:21 +02:00

5 lines
134 B
Rust

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