]> git.lizzy.rs Git - rust.git/commitdiff
make sure we find some things without validation or stacked borrows, respectively
authorRalf Jung <post@ralfj.de>
Tue, 14 Apr 2020 08:03:10 +0000 (10:03 +0200)
committerRalf Jung <post@ralfj.de>
Tue, 14 Apr 2020 08:23:47 +0000 (10:23 +0200)
tests/compile-fail/stacked_borrows/load_invalid_mut.rs
tests/compile-fail/stacked_borrows/load_invalid_shr.rs
tests/compile-fail/unaligned_pointers/unaligned_ptr1.rs
tests/compile-fail/unaligned_pointers/unaligned_ptr2.rs
tests/compile-fail/unaligned_pointers/unaligned_ptr3.rs
tests/compile-fail/validity/dangling_ref1.rs
tests/compile-fail/validity/dangling_ref2.rs
tests/compile-fail/validity/dangling_ref3.rs

index 1704b7fe19b2ed4be5ab1bf0a0507ca7763d60ea..c2c4ce6726dfb9f1d04167d7ded1d3a0e3cfa95a 100644 (file)
@@ -1,3 +1,6 @@
+// Make sure we catch this even without validation
+// compile-flags: -Zmiri-disable-validation
+
 // Make sure that we cannot load from memory a `&mut` that got already invalidated.
 fn main() {
     let x = &mut 42;
index 4757a2c1e58942f1d93444509cbeb480cce47461..7d681f649a107f623ef449813b5c32e7b55ba1d7 100644 (file)
@@ -1,3 +1,6 @@
+// Make sure we catch this even without validation
+// compile-flags: -Zmiri-disable-validation
+
 // Make sure that we cannot load from memory a `&` that got already invalidated.
 fn main() {
     let x = &mut 42;
index ee1a130042317a26ccc72dbdd0ea5db199409f03..0a67cfc5a1b362ead0f71b7a38b52d4398f2d4ed 100644 (file)
@@ -1,5 +1,5 @@
-// This should fail even without validation
-// compile-flags: -Zmiri-disable-validation
+// This should fail even without validation or Stacked Borrows.
+// compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows
 
 fn main() {
     let x = [2u16, 3, 4]; // Make it big enough so we don't get an out-of-bounds error.
index 853d890ecf07e69ff11e069470a442590ea85d3f..b1fb2f4aa9762646d9ec8705bdab8cec1b355e9f 100644 (file)
@@ -1,5 +1,5 @@
-// This should fail even without validation.
-// compile-flags: -Zmiri-disable-validation
+// This should fail even without validation or Stacked Borrows.
+// compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows
 
 fn main() {
     let x = [2u32, 3]; // Make it big enough so we don't get an out-of-bounds error.
index 43f6b472da05bbd560a4ee80c288076e205accac..c5a3398384e495ea6830b306c83345825288de2d 100644 (file)
@@ -1,5 +1,5 @@
-// This should fail even without validation.
-// compile-flags: -Zmiri-disable-validation
+// This should fail even without validation or Stacked Borrows.
+// compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows
 
 fn main() {
     let x = [2u16, 3, 4, 5]; // Make it big enough so we don't get an out-of-bounds error.
index 034510f3b283ab2e07a65170313dc0f7a0868610..a83c6af21acfd62e2c3474d96c2e16c6472991ec 100644 (file)
@@ -1,3 +1,5 @@
+// Make sure we catch this even without Stacked Borrows
+// compile-flags: -Zmiri-disable-stacked-borrows
 use std::mem;
 
 fn main() {
index 4ad9b8135db44ac87fc1a148e680546ea1e12228..7aff1a49785cc4b848aed83a96e6f4e7175dbc5a 100644 (file)
@@ -1,3 +1,5 @@
+// Make sure we catch this even without Stacked Borrows
+// compile-flags: -Zmiri-disable-stacked-borrows
 use std::mem;
 
 fn main() {
index 46e17375a82828e31f584443dc3c713179c6bbd6..495a266a85dc64e382b33fa856e57592b4a34721 100644 (file)
@@ -1,3 +1,5 @@
+// Make sure we catch this even without Stacked Borrows
+// compile-flags: -Zmiri-disable-stacked-borrows
 use std::mem;
 
 fn dangling() -> *const u8 {