diff --git a/rust-version b/rust-version index 3b05153d81c..fe5d17a963b 100644 --- a/rust-version +++ b/rust-version @@ -1 +1 @@ -5d04957a4b4714f71d38326fc96a0b0ef6dc5800 +372afcf93bf60e1a9334b107cc3d72f1b0a4b1f4 diff --git a/tests/compile-fail/dangling_pointers/dangling_zst_deref.rs b/tests/compile-fail/dangling_pointers/dangling_zst_deref.rs index f1b5149dabb..01e864213df 100644 --- a/tests/compile-fail/dangling_pointers/dangling_zst_deref.rs +++ b/tests/compile-fail/dangling_pointers/dangling_zst_deref.rs @@ -1,5 +1,6 @@ // Make sure we find these even with many checks disabled. -// compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation +// Some optimizations remove ZST accesses, thus masking this UB. +// compile-flags: -Zmir-opt-level=0 -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation fn main() { let p = { diff --git a/tests/compile-fail/dangling_pointers/maybe_null_pointer_deref_zst.rs b/tests/compile-fail/dangling_pointers/maybe_null_pointer_deref_zst.rs index d9f5ad4c696..9db8a7dcba9 100644 --- a/tests/compile-fail/dangling_pointers/maybe_null_pointer_deref_zst.rs +++ b/tests/compile-fail/dangling_pointers/maybe_null_pointer_deref_zst.rs @@ -1,3 +1,6 @@ +// Some optimizations remove ZST accesses, thus masking this UB. +// compile-flags: -Zmir-opt-level=0 + fn main() { // This pointer *could* be NULL so we cannot load from it, not even at ZST let ptr = (&0u8 as *const u8).wrapping_sub(0x800) as *const (); diff --git a/tests/compile-fail/dangling_pointers/maybe_null_pointer_write_zst.rs b/tests/compile-fail/dangling_pointers/maybe_null_pointer_write_zst.rs index ef46a469c3a..79eff2507ce 100644 --- a/tests/compile-fail/dangling_pointers/maybe_null_pointer_write_zst.rs +++ b/tests/compile-fail/dangling_pointers/maybe_null_pointer_write_zst.rs @@ -1,3 +1,6 @@ +// Some optimizations remove ZST accesses, thus masking this UB. +// compile-flags: -Zmir-opt-level=0 + fn main() { // This pointer *could* be NULL so we cannot load from it, not even at ZST. // Not using the () type here, as writes of that type do not even have MIR generated. diff --git a/tests/compile-fail/null_pointer_deref_zst.rs b/tests/compile-fail/null_pointer_deref_zst.rs index cfd3a75e3b8..d0f21a04d36 100644 --- a/tests/compile-fail/null_pointer_deref_zst.rs +++ b/tests/compile-fail/null_pointer_deref_zst.rs @@ -1,3 +1,6 @@ +// Some optimizations remove ZST accesses, thus masking this UB. +// compile-flags: -Zmir-opt-level=0 + fn main() { let x: () = unsafe { *std::ptr::null() }; //~ ERROR memory access failed: 0x0 is not a valid pointer panic!("this should never print: {:?}", x); diff --git a/tests/compile-fail/null_pointer_write_zst.rs b/tests/compile-fail/null_pointer_write_zst.rs index 0f7244ba25c..1ee1a4b8a30 100644 --- a/tests/compile-fail/null_pointer_write_zst.rs +++ b/tests/compile-fail/null_pointer_write_zst.rs @@ -1,3 +1,6 @@ +// Some optimizations remove ZST accesses, thus masking this UB. +// compile-flags: -Zmir-opt-level=0 + fn main() { // Not using the () type here, as writes of that type do not even have MIR generated. // Also not assigning directly as that's array initialization, not assignment. diff --git a/tests/compile-fail/unaligned_pointers/unaligned_ptr_zst.rs b/tests/compile-fail/unaligned_pointers/unaligned_ptr_zst.rs index a9db5ff7df3..27403c11abc 100644 --- a/tests/compile-fail/unaligned_pointers/unaligned_ptr_zst.rs +++ b/tests/compile-fail/unaligned_pointers/unaligned_ptr_zst.rs @@ -1,5 +1,6 @@ // This should fail even without validation -// compile-flags: -Zmiri-disable-validation +// Some optimizations remove ZST accesses, thus masking this UB. +// compile-flags: -Zmir-opt-level=0 -Zmiri-disable-validation fn main() { for i in 0..10 { // Try many times as this might work by chance. diff --git a/tests/compile-fail/zst2.rs b/tests/compile-fail/zst2.rs index 907337dcdb2..a602cb731e4 100644 --- a/tests/compile-fail/zst2.rs +++ b/tests/compile-fail/zst2.rs @@ -1,3 +1,6 @@ +// Some optimizations remove ZST accesses, thus masking this UB. +// compile-flags: -Zmir-opt-level=0 + fn main() { // Not using the () type here, as writes of that type do not even have MIR generated. // Also not assigning directly as that's array initialization, not assignment. diff --git a/tests/compile-fail/zst3.rs b/tests/compile-fail/zst3.rs index c94591174ec..734c4b8ac4b 100644 --- a/tests/compile-fail/zst3.rs +++ b/tests/compile-fail/zst3.rs @@ -1,3 +1,6 @@ +// Some optimizations remove ZST accesses, thus masking this UB. +// compile-flags: -Zmir-opt-level=0 + fn main() { // Not using the () type here, as writes of that type do not even have MIR generated. // Also not assigning directly as that's array initialization, not assignment.