rust/tests/compile-fail/ptr_integer_transmute.rs
2022-05-20 18:37:57 +02:00

7 lines
183 B
Rust

// compile-flags: -Zmiri-check-number-validity
fn main() {
let r = &mut 42;
let _i: usize = unsafe { std::mem::transmute(r) }; //~ ERROR expected plain (non-pointer) bytes
}