blob: befe96f2b35d95d2b9a5d3705650a53c2480b6c5 [file] [log] [blame]
// This should fail even without validation
// compile-flags: -Zmiri-disable-validation
#![allow(dead_code, unused_variables)]
#[repr(packed)]
struct Foo {
x: i32,
y: i32,
}
fn main() {
let foo = Foo {
x: 42,
y: 99,
};
let p = unsafe { &foo.x };
let i = *p; //~ ERROR tried to access memory with alignment 1, but alignment 4 is required
}