Skip to content

Commit e6822d6

Browse files
committed
make sure we find some things without validation or stacked borrows, respectively
1 parent 179e78d commit e6822d6

File tree

8 files changed

+18
-6
lines changed

8 files changed

+18
-6
lines changed

tests/compile-fail/stacked_borrows/load_invalid_mut.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Make sure we catch this even without validation
2+
// compile-flags: -Zmiri-disable-validation
3+
14
// Make sure that we cannot load from memory a `&mut` that got already invalidated.
25
fn main() {
36
let x = &mut 42;

tests/compile-fail/stacked_borrows/load_invalid_shr.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Make sure we catch this even without validation
2+
// compile-flags: -Zmiri-disable-validation
3+
14
// Make sure that we cannot load from memory a `&` that got already invalidated.
25
fn main() {
36
let x = &mut 42;

tests/compile-fail/unaligned_pointers/unaligned_ptr1.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// This should fail even without validation
2-
// compile-flags: -Zmiri-disable-validation
1+
// This should fail even without validation or Stacked Borrows.
2+
// compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows
33

44
fn main() {
55
let x = [2u16, 3, 4]; // Make it big enough so we don't get an out-of-bounds error.

tests/compile-fail/unaligned_pointers/unaligned_ptr2.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// This should fail even without validation.
2-
// compile-flags: -Zmiri-disable-validation
1+
// This should fail even without validation or Stacked Borrows.
2+
// compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows
33

44
fn main() {
55
let x = [2u32, 3]; // Make it big enough so we don't get an out-of-bounds error.

tests/compile-fail/unaligned_pointers/unaligned_ptr3.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// This should fail even without validation.
2-
// compile-flags: -Zmiri-disable-validation
1+
// This should fail even without validation or Stacked Borrows.
2+
// compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows
33

44
fn main() {
55
let x = [2u16, 3, 4, 5]; // Make it big enough so we don't get an out-of-bounds error.

tests/compile-fail/validity/dangling_ref1.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Make sure we catch this even without Stacked Borrows
2+
// compile-flags: -Zmiri-disable-stacked-borrows
13
use std::mem;
24

35
fn main() {

tests/compile-fail/validity/dangling_ref2.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Make sure we catch this even without Stacked Borrows
2+
// compile-flags: -Zmiri-disable-stacked-borrows
13
use std::mem;
24

35
fn main() {

tests/compile-fail/validity/dangling_ref3.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Make sure we catch this even without Stacked Borrows
2+
// compile-flags: -Zmiri-disable-stacked-borrows
13
use std::mem;
24

35
fn dangling() -> *const u8 {

0 commit comments

Comments
 (0)