mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-01 05:57:03 +03:00
make sure we find some things without validation or stacked borrows, respectively
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// Make sure we catch this even without Stacked Borrows
|
||||
// compile-flags: -Zmiri-disable-stacked-borrows
|
||||
use std::mem;
|
||||
|
||||
fn main() {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// Make sure we catch this even without Stacked Borrows
|
||||
// compile-flags: -Zmiri-disable-stacked-borrows
|
||||
use std::mem;
|
||||
|
||||
fn main() {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user