Auto merge of #2975 - RalfJung:flags, r=RalfJung

remove compile-flags that are no longer needed

We stopped running fail-tests with optimizations a while ago, so we don't need to explicitly set the opt-level to 0 any more.
This commit is contained in:
bors 2023-07-14 13:41:32 +00:00
commit 21b05e71a5
15 changed files with 10 additions and 37 deletions

View File

@ -1,6 +1,5 @@
// Make sure we find these even with many checks disabled. // Make sure we find these even with many checks disabled.
// Some optimizations remove ZST accesses, thus masking this UB. //@compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
//@compile-flags: -Zmir-opt-level=0 -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
fn main() { fn main() {
let p = { let p = {

View File

@ -1,5 +1,5 @@
// should find the bug even without these, but gets masked by optimizations // should find the bug even without these
//@compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows -Zmir-opt-level=0 //@compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows
struct SliceWithHead(u8, [u8]); struct SliceWithHead(u8, [u8]);

View File

@ -1,6 +1,3 @@
// Some optimizations remove ZST accesses, thus masking this UB.
//@compile-flags: -Zmir-opt-level=0
fn main() { fn main() {
// This pointer *could* be NULL so we cannot load from it, not even at ZST // 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 (); let ptr = (&0u8 as *const u8).wrapping_sub(0x800) as *const ();

View File

@ -1,6 +1,3 @@
// Some optimizations remove ZST accesses, thus masking this UB.
//@compile-flags: -Zmir-opt-level=0
fn main() { fn main() {
// This pointer *could* be NULL so we cannot load from it, not even at ZST. // 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. // Not using the () type here, as writes of that type do not even have MIR generated.

View File

@ -1,6 +1,3 @@
// Some optimizations remove ZST accesses, thus masking this UB.
//@compile-flags: -Zmir-opt-level=0
#[allow(deref_nullptr)] #[allow(deref_nullptr)]
fn main() { fn main() {
let x: () = unsafe { *std::ptr::null() }; //~ ERROR: dereferencing pointer failed: null pointer is a dangling pointer let x: () = unsafe { *std::ptr::null() }; //~ ERROR: dereferencing pointer failed: null pointer is a dangling pointer

View File

@ -1,6 +1,3 @@
// Some optimizations remove ZST accesses, thus masking this UB.
//@compile-flags: -Zmir-opt-level=0
#[allow(deref_nullptr)] #[allow(deref_nullptr)]
fn main() { fn main() {
// Not using the () type here, as writes of that type do not even have MIR generated. // Not using the () type here, as writes of that type do not even have MIR generated.

View File

@ -1,5 +1,5 @@
// This should fail even without validation, but some MIR opts mask the error // This should fail even without validation
//@compile-flags: -Zmiri-disable-validation -Zmir-opt-level=0 //@compile-flags: -Zmiri-disable-validation
unsafe fn make_ref<'a>(x: *mut i32) -> &'a mut i32 { unsafe fn make_ref<'a>(x: *mut i32) -> &'a mut i32 {
&mut *x &mut *x

View File

@ -1,5 +1,5 @@
// This should fail even without validation, but some MIR opts mask the error // This should fail even without validation
//@compile-flags: -Zmiri-disable-validation -Zmir-opt-level=0 -Zmiri-permissive-provenance //@compile-flags: -Zmiri-disable-validation -Zmiri-permissive-provenance
static mut LEAK: usize = 0; static mut LEAK: usize = 0;

View File

@ -1,7 +1,4 @@
//@compile-flags: -Zmir-opt-level=0 -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0 -Zmiri-disable-stacked-borrows //@compile-flags: -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0 -Zmiri-disable-stacked-borrows
// Note: mir-opt-level set to 0 to prevent the read of stack_var in thread 1
// from being optimized away and preventing the detection of the data-race.
use std::ptr::null_mut; use std::ptr::null_mut;
use std::sync::atomic::{AtomicPtr, Ordering}; use std::sync::atomic::{AtomicPtr, Ordering};

View File

@ -1,7 +1,5 @@
//! Make sure we detect erroneous constants post-monomorphization even when they are unused. //! Make sure we detect erroneous constants post-monomorphization even when they are unused.
//! (https://github.com/rust-lang/miri/issues/1382) //! (https://github.com/rust-lang/miri/issues/1382)
// Inlining changes the error location
//@compile-flags: -Zmir-opt-level=0
#![feature(never_type)] #![feature(never_type)]
struct PrintName<T>(T); struct PrintName<T>(T);

View File

@ -1,5 +1,5 @@
// should find the bug even without, but gets masked by optimizations // should find the bug even without, but gets masked by optimizations
//@compile-flags: -Zmiri-disable-stacked-borrows -Zmir-opt-level=0 -Cdebug-assertions=no //@compile-flags: -Zmiri-disable-stacked-borrows -Cdebug-assertions=no
//@normalize-stderr-test: "but found [0-9]+" -> "but found $$ALIGN" //@normalize-stderr-test: "but found [0-9]+" -> "but found $$ALIGN"
#[repr(align(256))] #[repr(align(256))]

View File

@ -1,6 +1,5 @@
// This should fail even without validation // This should fail even without validation
// Some optimizations remove ZST accesses, thus masking this UB. //@compile-flags: -Zmiri-disable-validation -Cdebug-assertions=no
//@compile-flags: -Zmir-opt-level=0 -Zmiri-disable-validation -Cdebug-assertions=no
fn main() { fn main() {
// Try many times as this might work by chance. // Try many times as this might work by chance.

View File

@ -1,5 +1,3 @@
// gets masked by optimizations
//@compile-flags: -Zmir-opt-level=0
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
#![allow(unused_attributes)] #![allow(unused_attributes)]

View File

@ -1,6 +1,3 @@
// Some optimizations remove ZST accesses, thus masking this UB.
//@compile-flags: -Zmir-opt-level=0
fn main() { fn main() {
// Not using the () type here, as writes of that type do not even have MIR generated. // 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. // Also not assigning directly as that's array initialization, not assignment.

View File

@ -1,6 +1,3 @@
// Some optimizations remove ZST accesses, thus masking this UB.
//@compile-flags: -Zmir-opt-level=0
fn main() { fn main() {
// Not using the () type here, as writes of that type do not even have MIR generated. // 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. // Also not assigning directly as that's array initialization, not assignment.