rust/tests/compile-fail/zst.rs

5 lines
164 B
Rust
Raw Normal View History

fn main() {
let x = &() as *const () as *const i32;
2018-10-19 04:50:17 -05:00
let _ = unsafe { *x }; //~ ERROR tried to access memory with alignment 1, but alignment 4 is required
}