rust/tests/fail/validity/ptr_integer_array_transmute.rs
2022-07-11 11:48:56 +00:00

5 lines
168 B
Rust

fn main() {
let r = &mut 42;
let _i: [usize; 1] = unsafe { std::mem::transmute(r) }; //~ ERROR: encountered a pointer, but expected plain (non-pointer) bytes
}