Port all tests

This commit is contained in:
Oli Scherer 2022-07-08 16:08:32 +00:00
parent e4f7c6845c
commit 6e106617f1
221 changed files with 269 additions and 345 deletions

View File

@ -1,4 +1,4 @@
// compile-flags: -Zmiri-strict-provenance
//@compile-flags: -Zmiri-strict-provenance
// Taken from <https://github.com/rust-lang/unsafe-code-guidelines/issues/194#issuecomment-520934222>.

View File

@ -1,4 +1,4 @@
// ignore-windows: No libc on Windows
//@ignore-windows: No libc on Windows
// Joining a detached thread is undefined behavior.

View File

@ -1,4 +1,4 @@
// ignore-windows: No libc on Windows
//@ignore-windows: No libc on Windows
// Joining an already joined thread is undefined behavior.

View File

@ -1,4 +1,4 @@
// ignore-windows: No libc on Windows
//@ignore-windows: No libc on Windows
// Joining the main thread is undefined behavior.

View File

@ -1,4 +1,4 @@
// ignore-windows: No libc on Windows
//@ignore-windows: No libc on Windows
// Joining the same thread from multiple threads is undefined behavior.

View File

@ -1,6 +1,6 @@
// ignore-windows: No libc on Windows
//@ignore-windows: No libc on Windows
// We are making scheduler assumptions here.
// compile-flags: -Zmiri-preemption-rate=0
//@compile-flags: -Zmiri-preemption-rate=0
// Joining itself is undefined behavior.

View File

@ -1,4 +1,4 @@
// ignore-windows: Concurrency on Windows is not supported yet.
//@ignore-windows: Concurrency on Windows is not supported yet.
//! Ensure that thread-local statics get deallocated when the thread dies.

View File

@ -1,4 +1,4 @@
// ignore-windows: Concurrency on Windows is not supported yet.
//@ignore-windows: Concurrency on Windows is not supported yet.
//! The thread function must have exactly one argument.

View File

@ -1,4 +1,4 @@
// ignore-windows: Concurrency on Windows is not supported yet.
//@ignore-windows: Concurrency on Windows is not supported yet.
//! The thread function must have exactly one argument.

View File

@ -1,5 +1,5 @@
// ignore-windows: Concurrency on Windows is not supported yet.
// compile-flags: -Zmiri-disable-abi-check
//@ignore-windows: Concurrency on Windows is not supported yet.
//@compile-flags: -Zmiri-disable-abi-check
//! Unwinding past the top frame of a stack is Undefined Behavior.

View File

@ -1,5 +1,5 @@
// Make sure we find these even with many checks disabled.
// compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
//@compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
use std::ptr;
fn main() {

View File

@ -1,5 +1,5 @@
// Make sure we find these even with many checks disabled.
// compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
//@compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
fn main() {
let p = {

View File

@ -1,6 +1,6 @@
// Make sure we find these even with many checks disabled.
// Some optimizations remove ZST accesses, thus masking this UB.
// compile-flags: -Zmir-opt-level=0 -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() {
let p = {

View File

@ -1,5 +1,5 @@
// This should fail even without validation.
// compile-flags: -Zmiri-disable-validation -Zmiri-permissive-provenance
//@compile-flags: -Zmiri-disable-validation -Zmiri-permissive-provenance
fn main() {
let x = 16usize as *const u32;

View File

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

View File

@ -1,5 +1,5 @@
// Some optimizations remove ZST accesses, thus masking this UB.
// compile-flags: -Zmir-opt-level=0
//@compile-flags: -Zmir-opt-level=0
fn main() {
// This pointer *could* be NULL so we cannot load from it, not even at ZST

View File

@ -1,5 +1,5 @@
// Some optimizations remove ZST accesses, thus masking this UB.
// compile-flags: -Zmir-opt-level=0
//@compile-flags: -Zmir-opt-level=0
fn main() {
// This pointer *could* be NULL so we cannot load from it, not even at ZST.

View File

@ -1,5 +1,5 @@
// Some optimizations remove ZST accesses, thus masking this UB.
// compile-flags: -Zmir-opt-level=0
//@compile-flags: -Zmir-opt-level=0
#[allow(deref_nullptr)]
fn main() {

View File

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

View File

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

View File

@ -1,4 +1,4 @@
// compile-flags: -Zmiri-permissive-provenance
//@compile-flags: -Zmiri-permissive-provenance
fn main() {
let p = 44 as *const i32;

View File

@ -1,5 +1,5 @@
// ignore-windows: Concurrency on Windows is not supported yet.
// compile-flags: -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
//@ignore-windows: Concurrency on Windows is not supported yet.
//@compile-flags: -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
#![feature(new_uninit)]
use std::mem::MaybeUninit;

View File

@ -1,5 +1,5 @@
// ignore-windows: Concurrency on Windows is not supported yet.
// compile-flags: -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
//@ignore-windows: Concurrency on Windows is not supported yet.
//@compile-flags: -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
#![feature(new_uninit)]
use std::ptr::null_mut;

View File

@ -1,4 +1,4 @@
// ignore-windows: Concurrency on Windows is not supported yet.
//@ignore-windows: Concurrency on Windows is not supported yet.
#![feature(core_intrinsics)]
use std::intrinsics;

View File

@ -1,4 +1,4 @@
// ignore-windows: Concurrency on Windows is not supported yet.
//@ignore-windows: Concurrency on Windows is not supported yet.
use std::sync::atomic::AtomicUsize;
use std::sync::atomic::Ordering;

View File

@ -1,4 +1,4 @@
// ignore-windows: Concurrency on Windows is not supported yet.
//@ignore-windows: Concurrency on Windows is not supported yet.
use std::sync::atomic::AtomicUsize;
use std::sync::atomic::Ordering;

View File

@ -1,4 +1,4 @@
// ignore-windows: Concurrency on Windows is not supported yet.
//@ignore-windows: Concurrency on Windows is not supported yet.
#![feature(core_intrinsics)]
use std::intrinsics::atomic_store;

View File

@ -1,4 +1,4 @@
// ignore-windows: Concurrency on Windows is not supported yet.
//@ignore-windows: Concurrency on Windows is not supported yet.
#![feature(core_intrinsics)]
use std::intrinsics::atomic_store;

View File

@ -1,4 +1,4 @@
// ignore-windows: Concurrency on Windows is not supported yet.
//@ignore-windows: Concurrency on Windows is not supported yet.
use std::sync::atomic::AtomicUsize;
use std::sync::atomic::Ordering;

View File

@ -1,5 +1,5 @@
// ignore-windows: Concurrency on Windows is not supported yet.
// compile-flags: -Zmiri-disable-isolation
//@ignore-windows: Concurrency on Windows is not supported yet.
//@compile-flags: -Zmiri-disable-isolation
use std::mem;
use std::thread::{sleep, spawn};

View File

@ -1,5 +1,5 @@
// ignore-windows: Concurrency on Windows is not supported yet.
// compile-flags: -Zmiri-disable-isolation
//@ignore-windows: Concurrency on Windows is not supported yet.
//@compile-flags: -Zmiri-disable-isolation
use std::mem;
use std::thread::{sleep, spawn};

View File

@ -1,4 +1,4 @@
// ignore-windows: Concurrency on Windows is not supported yet.
//@ignore-windows: Concurrency on Windows is not supported yet.
use std::thread::spawn;

View File

@ -1,4 +1,4 @@
// ignore-windows: Concurrency on Windows is not supported yet.
//@ignore-windows: Concurrency on Windows is not supported yet.
use std::thread::spawn;

View File

@ -1,5 +1,5 @@
// ignore-windows: Concurrency on Windows is not supported yet.
// compile-flags: -Zmiri-disable-isolation -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
//@ignore-windows: Concurrency on Windows is not supported yet.
//@compile-flags: -Zmiri-disable-isolation -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
use std::ptr::null_mut;
use std::sync::atomic::{AtomicPtr, Ordering};

View File

@ -1,4 +1,4 @@
// ignore-windows: Concurrency on Windows is not supported yet.
//@ignore-windows: Concurrency on Windows is not supported yet.
use std::thread::spawn;

View File

@ -1,4 +1,4 @@
// ignore-windows: Concurrency on Windows is not supported yet.
//@ignore-windows: Concurrency on Windows is not supported yet.
use std::thread::spawn;

View File

@ -1,5 +1,5 @@
// ignore-windows: Concurrency on Windows is not supported yet.
// compile-flags: -Zmiri-disable-isolation -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
//@ignore-windows: Concurrency on Windows is not supported yet.
//@compile-flags: -Zmiri-disable-isolation -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
use std::ptr::null_mut;
use std::sync::atomic::{AtomicPtr, Ordering};

View File

@ -1,4 +1,4 @@
// ignore-windows: Concurrency on Windows is not supported yet.
//@ignore-windows: Concurrency on Windows is not supported yet.
use std::thread::spawn;

View File

@ -1,6 +1,6 @@
// We want to control preemption here.
// compile-flags: -Zmiri-disable-isolation -Zmiri-preemption-rate=0
// ignore-windows: Concurrency on Windows is not supported yet.
//@compile-flags: -Zmiri-disable-isolation -Zmiri-preemption-rate=0
//@ignore-windows: Concurrency on Windows is not supported yet.
use std::sync::atomic::{fence, AtomicUsize, Ordering};
use std::sync::Arc;
use std::thread;

View File

@ -1,4 +1,4 @@
// ignore-windows: Concurrency on Windows is not supported yet.
//@ignore-windows: Concurrency on Windows is not supported yet.
use std::thread::spawn;

View File

@ -1,5 +1,5 @@
// ignore-windows: Concurrency on Windows is not supported yet.
// compile-flags: -Zmiri-disable-isolation -Zmir-opt-level=0 -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
//@ignore-windows: Concurrency on Windows is not supported yet.
//@compile-flags: -Zmiri-disable-isolation -Zmir-opt-level=0 -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
// 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.

View File

@ -1,5 +1,5 @@
// ignore-windows: Concurrency on Windows is not supported yet.
// compile-flags: -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
//@ignore-windows: Concurrency on Windows is not supported yet.
//@compile-flags: -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
use std::sync::atomic::{AtomicUsize, Ordering};
use std::thread::spawn;

View File

@ -1,5 +1,5 @@
// ignore-windows: Concurrency on Windows is not supported yet.
// compile-flags: -Zmiri-disable-isolation -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
//@ignore-windows: Concurrency on Windows is not supported yet.
//@compile-flags: -Zmiri-disable-isolation -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
use std::sync::atomic::{AtomicUsize, Ordering};
use std::thread::{sleep, spawn};

View File

@ -1,5 +1,5 @@
// ignore-windows: Concurrency on Windows is not supported yet.
// compile-flags: -Zmiri-disable-isolation -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
//@ignore-windows: Concurrency on Windows is not supported yet.
//@compile-flags: -Zmiri-disable-isolation -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
use std::sync::atomic::{AtomicUsize, Ordering};
use std::thread::spawn;

View File

@ -1,5 +1,5 @@
// ignore-windows: Concurrency on Windows is not supported yet.
// compile-flags: -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
//@ignore-windows: Concurrency on Windows is not supported yet.
//@compile-flags: -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
use std::sync::atomic::{AtomicUsize, Ordering};
use std::thread::spawn;

View File

@ -1,5 +1,5 @@
// ignore-windows: Concurrency on Windows is not supported yet.
// compile-flags: -Zmiri-preemption-rate=0
//@ignore-windows: Concurrency on Windows is not supported yet.
//@compile-flags: -Zmiri-preemption-rate=0
use std::thread;
#[derive(Copy, Clone)]

View File

@ -1,4 +1,4 @@
// ignore-windows: Concurrency on Windows is not supported yet.
//@ignore-windows: Concurrency on Windows is not supported yet.
use std::thread::spawn;

View File

@ -1,5 +1,5 @@
// ignore-windows: Concurrency on Windows is not supported yet.
// compile-flags: -Zmiri-disable-isolation -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
//@ignore-windows: Concurrency on Windows is not supported yet.
//@compile-flags: -Zmiri-disable-isolation -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
use std::ptr::null_mut;
use std::sync::atomic::{AtomicPtr, Ordering};

View File

@ -1,4 +1,4 @@
// ignore-windows: Windows does not have a global environ list that the program can access directly
//@ignore-windows: Windows does not have a global environ list that the program can access directly
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
fn get_environ() -> *const *const u8 {

View File

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

View File

@ -1,5 +1,5 @@
// ignore-windows: No libc on Windows
// compile-flags: -Zmiri-disable-isolation
//@ignore-windows: No libc on Windows
//@compile-flags: -Zmiri-disable-isolation
// FIXME: standard handles cannot be closed (https://github.com/rust-lang/rust/issues/40032)

View File

@ -1,4 +1,4 @@
// ignore-windows: No libc on Windows
//@ignore-windows: No libc on Windows
#![feature(rustc_private)]

View File

@ -1,5 +1,5 @@
// compile-flags: -Zmiri-disable-isolation
// ignore-windows: No libc on Windows
//@compile-flags: -Zmiri-disable-isolation
//@ignore-windows: No libc on Windows
#![feature(rustc_private)]

View File

@ -1,5 +1,5 @@
// ignore-windows: No libc on Windows
// compile-flags: -Zmiri-disable-isolation
//@ignore-windows: No libc on Windows
//@compile-flags: -Zmiri-disable-isolation
#![feature(rustc_private)]

View File

@ -1,4 +1,4 @@
// ignore-windows: No libc on Windows
//@ignore-windows: No libc on Windows
#![feature(rustc_private)]

View File

@ -1,4 +1,4 @@
// revisions: no_cache cache fn_ptr
//@revisions: no_cache cache fn_ptr
#[no_mangle]
fn foo() {}

View File

@ -1,4 +1,4 @@
// compile-flags: -Zmiri-disable-abi-check
//@compile-flags: -Zmiri-disable-abi-check
#![feature(c_unwind)]
#[no_mangle]

View File

@ -1,4 +1,4 @@
// revisions: extern_block definition both
//@revisions: extern_block definition both
#![feature(rustc_attrs, c_unwind)]
#[cfg_attr(any(definition, both), rustc_allocator_nounwind)]

View File

@ -1,5 +1,5 @@
// Validation makes this fail in the wrong place
// compile-flags: -Zmiri-disable-validation
//@compile-flags: -Zmiri-disable-validation
fn main() {
let b = Box::new(42);

View File

@ -1,5 +1,5 @@
// Validation makes this fail in the wrong place
// compile-flags: -Zmiri-disable-validation
//@compile-flags: -Zmiri-disable-validation
fn main() {
let g = unsafe { std::mem::transmute::<usize, fn(i32)>(42) };

View File

@ -1,5 +1,5 @@
// Validation makes this fail in the wrong place
// compile-flags: -Zmiri-disable-validation
//@compile-flags: -Zmiri-disable-validation
#![feature(box_syntax)]

View File

@ -1,5 +1,5 @@
// Validation makes this fail in the wrong place
// compile-flags: -Zmiri-disable-validation
//@compile-flags: -Zmiri-disable-validation
use std::mem;

View File

@ -1,4 +1,4 @@
// compile-flags: -Zmiri-disable-validation
//@compile-flags: -Zmiri-disable-validation
#![feature(generators, generator_trait)]
use std::{

View File

@ -1,6 +1,6 @@
// Validation makes this fail in the wrong place
// Make sure we find these even with many checks disabled.
// compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
//@compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
#![feature(bench_black_box)]
fn main() {

View File

@ -1,6 +1,6 @@
// Validation makes this fail in the wrong place
// Make sure we find these even with many checks disabled.
// compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
//@compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
fn main() {
let c = 0xFFFFFFu32;

View File

@ -1,6 +1,6 @@
// Validation makes this fail in the wrong place
// Make sure we find these even with many checks disabled.
// compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
//@compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
fn main() {
let i = unsafe { std::mem::MaybeUninit::<i32>::uninit().assume_init() };

View File

@ -1,5 +1,5 @@
// This should fail even without validation/SB
// compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows
//@compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows
fn main() {
let x = &1; // the `&1` is promoted to a constant, but it used to be that only the pointer is marked static, not the pointee

View File

@ -1,5 +1,5 @@
// This should fail even without validation
// compile-flags: -Zmiri-disable-validation
//@compile-flags: -Zmiri-disable-validation
#![feature(never_type)]
#![allow(unreachable_code)]

View File

@ -1,5 +1,5 @@
// This should fail even without validation
// compile-flags: -Zmiri-disable-validation
//@compile-flags: -Zmiri-disable-validation
#![feature(never_type)]

View File

@ -1,5 +1,5 @@
// This should fail even without validation
// compile-flags: -Zmiri-disable-validation
//@compile-flags: -Zmiri-disable-validation
#![feature(never_type)]
#![allow(unused, invalid_value)]

View File

@ -1,4 +1,4 @@
// compile-flags: -Zmiri-disable-abi-check
//@compile-flags: -Zmiri-disable-abi-check
// This feature is required to trigger the error using the "C" ABI.
#![feature(c_unwind)]

View File

@ -1,4 +1,4 @@
// compile-flags: -Cpanic=abort
//@compile-flags: -Cpanic=abort
//! Unwinding despite `-C panic=abort` is an error.

View File

@ -1,5 +1,5 @@
// Make sure we find these even with many checks disabled.
// compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
//@compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
// Test what happens when we overwrite parts of a pointer.
// Also see <https://github.com/rust-lang/miri/issues/2181>.

View File

@ -1,4 +1,4 @@
// compile-flags: -Zmiri-permissive-provenance
//@compile-flags: -Zmiri-permissive-provenance
#![feature(strict_provenance)]
use std::mem;

View File

@ -1,4 +1,4 @@
// compile-flags: -Zmiri-permissive-provenance
//@compile-flags: -Zmiri-permissive-provenance
#![feature(strict_provenance)]
fn main() {

View File

@ -1,4 +1,4 @@
// compile-flags: -Zmiri-strict-provenance
//@compile-flags: -Zmiri-strict-provenance
fn main() {
let addr = &0 as *const i32 as usize;

View File

@ -1,5 +1,5 @@
// This should fail even without validation
// compile-flags: -Zmiri-disable-validation
//@compile-flags: -Zmiri-disable-validation
use std::ptr;
use std::rc::{Rc, Weak};

View File

@ -1,4 +1,4 @@
// stderr-per-bitwidth
//@stderr-per-bitwidth
fn main() {
extern "C" {

View File

@ -1,4 +1,4 @@
// compile-flags: -Zmiri-permissive-provenance
//@compile-flags: -Zmiri-permissive-provenance
#![feature(strict_provenance)]
// If we have only exposed read-only pointers, doing a write through a wildcard ptr should fail.

View File

@ -1,6 +1,6 @@
// We *can* have aliasing &RefCell<T> and &mut T, but we cannot read through the former.
// Else we couldn't optimize based on the assumption that `xref` below is truly unique.
// normalize-stderr-test: "0x[0-9a-fA-F]+" -> "$$HEX"
//@normalize-stderr-test: "0x[0-9a-fA-F]+" -> "$$HEX"
use std::cell::RefCell;
use std::{mem, ptr};

View File

@ -1,4 +1,4 @@
// compile-flags: -Zmiri-permissive-provenance
//@compile-flags: -Zmiri-permissive-provenance
fn main() {
unsafe {

View File

@ -1,4 +1,4 @@
// compile-flags: -Zmiri-permissive-provenance
//@compile-flags: -Zmiri-permissive-provenance
fn main() {
unsafe {

View File

@ -1,4 +1,4 @@
// compile-flags: -Zmiri-permissive-provenance
//@compile-flags: -Zmiri-permissive-provenance
fn main() {
unsafe {

View File

@ -1,5 +1,5 @@
// Make sure we catch this even without validation
// compile-flags: -Zmiri-disable-validation
//@compile-flags: -Zmiri-disable-validation
// Make sure that we cannot load from memory a `&mut` that got already invalidated.
fn main() {

View File

@ -1,5 +1,5 @@
// Make sure we catch this even without validation
// compile-flags: -Zmiri-disable-validation
//@compile-flags: -Zmiri-disable-validation
// Make sure that we cannot load from memory a `&` that got already invalidated.
fn main() {

View File

@ -1,7 +1,7 @@
// We want to test that granting a SharedReadWrite will be added
// *below* an already granted SharedReadWrite -- so writing to
// the SharedReadWrite will invalidate the SharedReadWrite.
// normalize-stderr-test: "0x[0-9a-fA-F]+" -> "$$HEX"
//@normalize-stderr-test: "0x[0-9a-fA-F]+" -> "$$HEX"
use std::cell::RefCell;
use std::mem;

View File

@ -1,4 +1,4 @@
// compile-flags: -Zmiri-permissive-provenance
//@compile-flags: -Zmiri-permissive-provenance
// Make sure we cannot use raw ptrs to access a local that
// we took the direct address of.

View File

@ -1,4 +1,4 @@
// compile-flags: -Zmiri-strict-provenance
//@compile-flags: -Zmiri-strict-provenance
//@error-pattern: does not exist in the borrow stack
fn main() {

View File

@ -1,5 +1,5 @@
// Stacked Borrows detects that we are casting & to &mut and so it changes why we fail
// compile-flags: -Zmiri-disable-stacked-borrows
//@compile-flags: -Zmiri-disable-stacked-borrows
static X: usize = 5;

View File

@ -1,5 +1,5 @@
// Stacked Borrows detects that we are casting & to &mut and so it changes why we fail
// compile-flags: -Zmiri-disable-stacked-borrows
//@compile-flags: -Zmiri-disable-stacked-borrows
use std::mem::transmute;

View File

@ -1,5 +1,5 @@
// Stacked Borrows detects that we are casting & to &mut and so it changes why we fail
// compile-flags: -Zmiri-disable-stacked-borrows
//@compile-flags: -Zmiri-disable-stacked-borrows
use std::mem::transmute;

View File

@ -1,4 +1,4 @@
// ignore-windows: No libc on Windows
//@ignore-windows: No libc on Windows
#![feature(rustc_private)]
/// Test that destroying a pthread_cond twice fails, even without a check for number validity

View File

@ -1,4 +1,4 @@
// ignore-windows: No libc on Windows
//@ignore-windows: No libc on Windows
#![feature(rustc_private)]
/// Test that destroying a pthread_condattr twice fails, even without a check for number validity

View File

@ -1,4 +1,4 @@
// ignore-windows: No libc on Windows
//@ignore-windows: No libc on Windows
//
// Check that if we pass NULL attribute, then we get the default mutex type.

View File

@ -1,4 +1,4 @@
// ignore-windows: No libc on Windows
//@ignore-windows: No libc on Windows
#![feature(rustc_private)]

View File

@ -1,4 +1,4 @@
// ignore-windows: No libc on Windows
//@ignore-windows: No libc on Windows
//
// Check that if we do not set the mutex type, it is the default.

View File

@ -1,4 +1,4 @@
// ignore-windows: No libc on Windows
//@ignore-windows: No libc on Windows
#![feature(rustc_private)]

View File

@ -1,4 +1,4 @@
// ignore-windows: No libc on Windows
//@ignore-windows: No libc on Windows
#![feature(rustc_private)]
/// Test that destroying a pthread_mutex twice fails, even without a check for number validity

View File

@ -1,4 +1,4 @@
// ignore-windows: No libc on Windows
//@ignore-windows: No libc on Windows
#![feature(rustc_private)]

View File

@ -1,4 +1,4 @@
// ignore-windows: No libc on Windows
//@ignore-windows: No libc on Windows
#![feature(rustc_private)]

Some files were not shown because too many files have changed in this diff Show More