Skip to content

Commit 029c851

Browse files
committed
another optimization work-around
1 parent 088af66 commit 029c851

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/compile-fail/unaligned_pointers/unaligned_ptr_zst.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// compile-flags: -Zmiri-disable-validation
33

44
fn main() {
5-
for _ in 0..10 { // Try many times as this might work by chance.
6-
let x = 2u8;
5+
for i in 0..10 { // Try many times as this might work by chance.
6+
let x = i as u8;
77
let x = &x as *const _ as *const [u32; 0];
88
// This must fail because alignment is violated. Test specifically for loading ZST.
99
let _x = unsafe { *x }; //~ERROR alignment 4 is required

0 commit comments

Comments
 (0)