1 // This should fail even without validation
2 // Some optimizations remove ZST accesses, thus masking this UB.
3 //@compile-flags: -Zmir-opt-level=0 -Zmiri-disable-validation
6 // Try many times as this might work by chance.
9 let x = &x as *const _ as *const [u32; 0];
10 // This must fail because alignment is violated. Test specifically for loading ZST.
11 let _x = unsafe { *x }; //~ERROR: alignment 4 is required