We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 088af66 commit 029c851Copy full SHA for 029c851
tests/compile-fail/unaligned_pointers/unaligned_ptr_zst.rs
@@ -2,8 +2,8 @@
2
// compile-flags: -Zmiri-disable-validation
3
4
fn main() {
5
- for _ in 0..10 { // Try many times as this might work by chance.
6
- let x = 2u8;
+ for i in 0..10 { // Try many times as this might work by chance.
+ let x = i as u8;
7
let x = &x as *const _ as *const [u32; 0];
8
// This must fail because alignment is violated. Test specifically for loading ZST.
9
let _x = unsafe { *x }; //~ERROR alignment 4 is required
0 commit comments