make sure we find some things without validation or stacked borrows, respectively

This commit is contained in:
Ralf Jung 2020-04-14 10:03:10 +02:00
parent 179e78d0ad
commit e6822d60b3
8 changed files with 18 additions and 6 deletions

View 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;

View 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;

View 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.

View 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.

View 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.

View 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() {

View 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() {

View 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 {