diff --git a/tests/compile-fail/dangling_pointers/dyn_size.rs b/tests/compile-fail/dangling_pointers/dyn_size.rs index c8f1ee3113..39a091387c 100644 --- a/tests/compile-fail/dangling_pointers/dyn_size.rs +++ b/tests/compile-fail/dangling_pointers/dyn_size.rs @@ -1,5 +1,5 @@ -// should find the bug even without these -// compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows +// should find the bug even without these, but gets masked by optimizations +// compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows -Zmir-opt-level=0 struct SliceWithHead(u8, [u8]); diff --git a/tests/compile-fail/unaligned_pointers/dyn_alignment.rs b/tests/compile-fail/unaligned_pointers/dyn_alignment.rs index 4d0b3af095..aa293a5d21 100644 --- a/tests/compile-fail/unaligned_pointers/dyn_alignment.rs +++ b/tests/compile-fail/unaligned_pointers/dyn_alignment.rs @@ -1,5 +1,5 @@ -// should find the bug even without these -// compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows +// should find the bug even without these, but gets masked by optimizations +// compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows -Zmir-opt-level=0 #[repr(align(256))] #[derive(Debug)] diff --git a/tests/compile-fail/validity/nonzero.rs b/tests/compile-fail/validity/nonzero.rs index dbb31b3f17..8ff19a2b43 100644 --- a/tests/compile-fail/validity/nonzero.rs +++ b/tests/compile-fail/validity/nonzero.rs @@ -1,4 +1,5 @@ -// compile-flags: -Zmir-opt-level=1 +// gets masked by optimizations +// compile-flags: -Zmir-opt-level=0 #![feature(rustc_attrs)] #![allow(unused_attributes)]