rust/tests/compile-fail/zst.rs
2018-11-26 15:31:53 +01:00

5 lines
158 B
Rust

fn main() {
let x = &() as *const () as *const i32;
let _val = unsafe { *x }; //~ ERROR access memory with alignment 1, but alignment 4 is required
}