]> git.lizzy.rs Git - rust.git/commitdiff
some UB gets masked by optimizations
authorRalf Jung <post@ralfj.de>
Sat, 18 Apr 2020 07:15:59 +0000 (09:15 +0200)
committerRalf Jung <post@ralfj.de>
Sat, 18 Apr 2020 07:15:59 +0000 (09:15 +0200)
tests/compile-fail/dangling_pointers/dyn_size.rs
tests/compile-fail/unaligned_pointers/dyn_alignment.rs
tests/compile-fail/validity/nonzero.rs

index c8f1ee31137a9df34ae773a3dd83912f7708c555..39a091387c6c26948a490e330fab6dc7d08f5ff2 100644 (file)
@@ -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]);
 
index 4d0b3af0952c1eb6adb8b364e34741699fb0343e..aa293a5d2167b57a9d5919513c77dfce661ac5e8 100644 (file)
@@ -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)]
index dbb31b3f1757524ac155e30d0ca8f558b38dc3e6..8ff19a2b4386527e5b083e6e8dbf8b2b79ca3ad0 100644 (file)
@@ -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)]