From 029c851d7c0eee03178c96c890ec974262b2ee21 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 7 Sep 2020 11:22:49 +0200 Subject: [PATCH] another optimization work-around --- tests/compile-fail/unaligned_pointers/unaligned_ptr_zst.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/compile-fail/unaligned_pointers/unaligned_ptr_zst.rs b/tests/compile-fail/unaligned_pointers/unaligned_ptr_zst.rs index 169e98abf31..a9db5ff7df3 100644 --- a/tests/compile-fail/unaligned_pointers/unaligned_ptr_zst.rs +++ b/tests/compile-fail/unaligned_pointers/unaligned_ptr_zst.rs @@ -2,8 +2,8 @@ // compile-flags: -Zmiri-disable-validation fn main() { - for _ in 0..10 { // Try many times as this might work by chance. - let x = 2u8; + for i in 0..10 { // Try many times as this might work by chance. + let x = i as u8; let x = &x as *const _ as *const [u32; 0]; // This must fail because alignment is violated. Test specifically for loading ZST. let _x = unsafe { *x }; //~ERROR alignment 4 is required