diff --git a/tests/fail/box-cell-alias.rs b/tests/fail/box-cell-alias.rs index d3f505d2da5..319845d86a6 100644 --- a/tests/fail/box-cell-alias.rs +++ b/tests/fail/box-cell-alias.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-strict-provenance +//@compile-flags: -Zmiri-strict-provenance // Taken from . diff --git a/tests/fail/concurrency/libc_pthread_join_detached.rs b/tests/fail/concurrency/libc_pthread_join_detached.rs index dcd06596de1..1ec1d630ecb 100644 --- a/tests/fail/concurrency/libc_pthread_join_detached.rs +++ b/tests/fail/concurrency/libc_pthread_join_detached.rs @@ -1,4 +1,4 @@ -// ignore-windows: No libc on Windows +//@ignore-windows: No libc on Windows // Joining a detached thread is undefined behavior. diff --git a/tests/fail/concurrency/libc_pthread_join_joined.rs b/tests/fail/concurrency/libc_pthread_join_joined.rs index 26f33f1f5f9..b067556e51b 100644 --- a/tests/fail/concurrency/libc_pthread_join_joined.rs +++ b/tests/fail/concurrency/libc_pthread_join_joined.rs @@ -1,4 +1,4 @@ -// ignore-windows: No libc on Windows +//@ignore-windows: No libc on Windows // Joining an already joined thread is undefined behavior. diff --git a/tests/fail/concurrency/libc_pthread_join_main.rs b/tests/fail/concurrency/libc_pthread_join_main.rs index 15e43776ab8..ebfe8c865e3 100644 --- a/tests/fail/concurrency/libc_pthread_join_main.rs +++ b/tests/fail/concurrency/libc_pthread_join_main.rs @@ -1,4 +1,4 @@ -// ignore-windows: No libc on Windows +//@ignore-windows: No libc on Windows // Joining the main thread is undefined behavior. diff --git a/tests/fail/concurrency/libc_pthread_join_multiple.rs b/tests/fail/concurrency/libc_pthread_join_multiple.rs index d86233a6764..39cd9ff7797 100644 --- a/tests/fail/concurrency/libc_pthread_join_multiple.rs +++ b/tests/fail/concurrency/libc_pthread_join_multiple.rs @@ -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. diff --git a/tests/fail/concurrency/libc_pthread_join_self.rs b/tests/fail/concurrency/libc_pthread_join_self.rs index db45b33c146..7b91560ab6b 100644 --- a/tests/fail/concurrency/libc_pthread_join_self.rs +++ b/tests/fail/concurrency/libc_pthread_join_self.rs @@ -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. diff --git a/tests/fail/concurrency/thread_local_static_dealloc.rs b/tests/fail/concurrency/thread_local_static_dealloc.rs index e6031b5e4c0..8cca1eba2d8 100644 --- a/tests/fail/concurrency/thread_local_static_dealloc.rs +++ b/tests/fail/concurrency/thread_local_static_dealloc.rs @@ -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. diff --git a/tests/fail/concurrency/too_few_args.rs b/tests/fail/concurrency/too_few_args.rs index 23fa38d8812..5d173b38480 100644 --- a/tests/fail/concurrency/too_few_args.rs +++ b/tests/fail/concurrency/too_few_args.rs @@ -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. diff --git a/tests/fail/concurrency/too_many_args.rs b/tests/fail/concurrency/too_many_args.rs index af5a377a04e..8305765a37a 100644 --- a/tests/fail/concurrency/too_many_args.rs +++ b/tests/fail/concurrency/too_many_args.rs @@ -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. diff --git a/tests/fail/concurrency/unwind_top_of_stack.rs b/tests/fail/concurrency/unwind_top_of_stack.rs index 39f7ae8bafb..d5dfcd0871d 100644 --- a/tests/fail/concurrency/unwind_top_of_stack.rs +++ b/tests/fail/concurrency/unwind_top_of_stack.rs @@ -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. diff --git a/tests/fail/dangling_pointers/dangling_pointer_addr_of.rs b/tests/fail/dangling_pointers/dangling_pointer_addr_of.rs index 5de41387117..a38a44c18f4 100644 --- a/tests/fail/dangling_pointers/dangling_pointer_addr_of.rs +++ b/tests/fail/dangling_pointers/dangling_pointer_addr_of.rs @@ -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() { diff --git a/tests/fail/dangling_pointers/dangling_pointer_deref.rs b/tests/fail/dangling_pointers/dangling_pointer_deref.rs index e088a553258..55b5205a8b3 100644 --- a/tests/fail/dangling_pointers/dangling_pointer_deref.rs +++ b/tests/fail/dangling_pointers/dangling_pointer_deref.rs @@ -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 = { diff --git a/tests/fail/dangling_pointers/dangling_zst_deref.rs b/tests/fail/dangling_pointers/dangling_zst_deref.rs index 01e864213df..2a09dc4b0e8 100644 --- a/tests/fail/dangling_pointers/dangling_zst_deref.rs +++ b/tests/fail/dangling_pointers/dangling_zst_deref.rs @@ -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 = { diff --git a/tests/fail/dangling_pointers/deref-invalid-ptr.rs b/tests/fail/dangling_pointers/deref-invalid-ptr.rs index 31b52da774b..924021e8cb9 100644 --- a/tests/fail/dangling_pointers/deref-invalid-ptr.rs +++ b/tests/fail/dangling_pointers/deref-invalid-ptr.rs @@ -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; diff --git a/tests/fail/dangling_pointers/dyn_size.rs b/tests/fail/dangling_pointers/dyn_size.rs index 56de3970f1b..adb7febe507 100644 --- a/tests/fail/dangling_pointers/dyn_size.rs +++ b/tests/fail/dangling_pointers/dyn_size.rs @@ -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]); diff --git a/tests/fail/dangling_pointers/maybe_null_pointer_deref_zst.rs b/tests/fail/dangling_pointers/maybe_null_pointer_deref_zst.rs index 357eadf91c7..37fb91e28f2 100644 --- a/tests/fail/dangling_pointers/maybe_null_pointer_deref_zst.rs +++ b/tests/fail/dangling_pointers/maybe_null_pointer_deref_zst.rs @@ -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 diff --git a/tests/fail/dangling_pointers/maybe_null_pointer_write_zst.rs b/tests/fail/dangling_pointers/maybe_null_pointer_write_zst.rs index 4a8d498aa1f..de8034bbbac 100644 --- a/tests/fail/dangling_pointers/maybe_null_pointer_write_zst.rs +++ b/tests/fail/dangling_pointers/maybe_null_pointer_write_zst.rs @@ -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. diff --git a/tests/fail/dangling_pointers/null_pointer_deref_zst.rs b/tests/fail/dangling_pointers/null_pointer_deref_zst.rs index 21b0ce37d8d..1f73983a816 100644 --- a/tests/fail/dangling_pointers/null_pointer_deref_zst.rs +++ b/tests/fail/dangling_pointers/null_pointer_deref_zst.rs @@ -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() { diff --git a/tests/fail/dangling_pointers/stack_temporary.rs b/tests/fail/dangling_pointers/stack_temporary.rs index cbd788bbf41..dc446ca4b3c 100644 --- a/tests/fail/dangling_pointers/stack_temporary.rs +++ b/tests/fail/dangling_pointers/stack_temporary.rs @@ -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 diff --git a/tests/fail/dangling_pointers/storage_dead_dangling.rs b/tests/fail/dangling_pointers/storage_dead_dangling.rs index 64ed37d1511..10c6e7f97d2 100644 --- a/tests/fail/dangling_pointers/storage_dead_dangling.rs +++ b/tests/fail/dangling_pointers/storage_dead_dangling.rs @@ -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; diff --git a/tests/fail/dangling_pointers/wild_pointer_deref.rs b/tests/fail/dangling_pointers/wild_pointer_deref.rs index 9f6b370c050..15d71a6bccc 100644 --- a/tests/fail/dangling_pointers/wild_pointer_deref.rs +++ b/tests/fail/dangling_pointers/wild_pointer_deref.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-permissive-provenance +//@compile-flags: -Zmiri-permissive-provenance fn main() { let p = 44 as *const i32; diff --git a/tests/fail/data_race/alloc_read_race.rs b/tests/fail/data_race/alloc_read_race.rs index 1eac8ce0f26..e3c003a343a 100644 --- a/tests/fail/data_race/alloc_read_race.rs +++ b/tests/fail/data_race/alloc_read_race.rs @@ -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; diff --git a/tests/fail/data_race/alloc_write_race.rs b/tests/fail/data_race/alloc_write_race.rs index e618b72a822..4ad03ee87dd 100644 --- a/tests/fail/data_race/alloc_write_race.rs +++ b/tests/fail/data_race/alloc_write_race.rs @@ -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; diff --git a/tests/fail/data_race/atomic_read_na_write_race1.rs b/tests/fail/data_race/atomic_read_na_write_race1.rs index 3b948eea980..71d7a66597d 100644 --- a/tests/fail/data_race/atomic_read_na_write_race1.rs +++ b/tests/fail/data_race/atomic_read_na_write_race1.rs @@ -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; diff --git a/tests/fail/data_race/atomic_read_na_write_race2.rs b/tests/fail/data_race/atomic_read_na_write_race2.rs index 44b4eebee80..a490f47da7c 100644 --- a/tests/fail/data_race/atomic_read_na_write_race2.rs +++ b/tests/fail/data_race/atomic_read_na_write_race2.rs @@ -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; diff --git a/tests/fail/data_race/atomic_write_na_read_race1.rs b/tests/fail/data_race/atomic_write_na_read_race1.rs index 44dc1a90841..40066d91b1f 100644 --- a/tests/fail/data_race/atomic_write_na_read_race1.rs +++ b/tests/fail/data_race/atomic_write_na_read_race1.rs @@ -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; diff --git a/tests/fail/data_race/atomic_write_na_read_race2.rs b/tests/fail/data_race/atomic_write_na_read_race2.rs index b4b21b64fc1..0bfadcba3ed 100644 --- a/tests/fail/data_race/atomic_write_na_read_race2.rs +++ b/tests/fail/data_race/atomic_write_na_read_race2.rs @@ -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; diff --git a/tests/fail/data_race/atomic_write_na_write_race1.rs b/tests/fail/data_race/atomic_write_na_write_race1.rs index b1a4cfb98bd..258f5dd142e 100644 --- a/tests/fail/data_race/atomic_write_na_write_race1.rs +++ b/tests/fail/data_race/atomic_write_na_write_race1.rs @@ -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; diff --git a/tests/fail/data_race/atomic_write_na_write_race2.rs b/tests/fail/data_race/atomic_write_na_write_race2.rs index dbdce8f6237..51068262d58 100644 --- a/tests/fail/data_race/atomic_write_na_write_race2.rs +++ b/tests/fail/data_race/atomic_write_na_write_race2.rs @@ -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; diff --git a/tests/fail/data_race/dangling_thread_async_race.rs b/tests/fail/data_race/dangling_thread_async_race.rs index 65325b60f2f..7bb20adfcd5 100644 --- a/tests/fail/data_race/dangling_thread_async_race.rs +++ b/tests/fail/data_race/dangling_thread_async_race.rs @@ -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}; diff --git a/tests/fail/data_race/dangling_thread_race.rs b/tests/fail/data_race/dangling_thread_race.rs index 09e7032c933..7e198eef6e9 100644 --- a/tests/fail/data_race/dangling_thread_race.rs +++ b/tests/fail/data_race/dangling_thread_race.rs @@ -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}; diff --git a/tests/fail/data_race/dealloc_read_race1.rs b/tests/fail/data_race/dealloc_read_race1.rs index ff2ac8ca522..634904cbfdc 100644 --- a/tests/fail/data_race/dealloc_read_race1.rs +++ b/tests/fail/data_race/dealloc_read_race1.rs @@ -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; diff --git a/tests/fail/data_race/dealloc_read_race2.rs b/tests/fail/data_race/dealloc_read_race2.rs index 4bb6444f6a6..91ec3c2bd87 100644 --- a/tests/fail/data_race/dealloc_read_race2.rs +++ b/tests/fail/data_race/dealloc_read_race2.rs @@ -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; diff --git a/tests/fail/data_race/dealloc_read_race_stack.rs b/tests/fail/data_race/dealloc_read_race_stack.rs index e079581a0d8..a43c96a6701 100644 --- a/tests/fail/data_race/dealloc_read_race_stack.rs +++ b/tests/fail/data_race/dealloc_read_race_stack.rs @@ -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}; diff --git a/tests/fail/data_race/dealloc_write_race1.rs b/tests/fail/data_race/dealloc_write_race1.rs index 9cd0ebc6425..f95a9be1727 100644 --- a/tests/fail/data_race/dealloc_write_race1.rs +++ b/tests/fail/data_race/dealloc_write_race1.rs @@ -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; diff --git a/tests/fail/data_race/dealloc_write_race2.rs b/tests/fail/data_race/dealloc_write_race2.rs index 9b1b8f06147..922738354fb 100644 --- a/tests/fail/data_race/dealloc_write_race2.rs +++ b/tests/fail/data_race/dealloc_write_race2.rs @@ -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; diff --git a/tests/fail/data_race/dealloc_write_race_stack.rs b/tests/fail/data_race/dealloc_write_race_stack.rs index 2f125708927..6b87cbe61ca 100644 --- a/tests/fail/data_race/dealloc_write_race_stack.rs +++ b/tests/fail/data_race/dealloc_write_race_stack.rs @@ -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}; diff --git a/tests/fail/data_race/enable_after_join_to_main.rs b/tests/fail/data_race/enable_after_join_to_main.rs index 6f0735fac89..757a41adc93 100644 --- a/tests/fail/data_race/enable_after_join_to_main.rs +++ b/tests/fail/data_race/enable_after_join_to_main.rs @@ -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; diff --git a/tests/fail/data_race/fence_after_load.rs b/tests/fail/data_race/fence_after_load.rs index 5a8c2e585f4..7a8d66bf8f2 100644 --- a/tests/fail/data_race/fence_after_load.rs +++ b/tests/fail/data_race/fence_after_load.rs @@ -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; diff --git a/tests/fail/data_race/read_write_race.rs b/tests/fail/data_race/read_write_race.rs index eeb49bb42ab..cffbba1a70f 100644 --- a/tests/fail/data_race/read_write_race.rs +++ b/tests/fail/data_race/read_write_race.rs @@ -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; diff --git a/tests/fail/data_race/read_write_race_stack.rs b/tests/fail/data_race/read_write_race_stack.rs index 124f12d1ecd..3999c57bcf4 100644 --- a/tests/fail/data_race/read_write_race_stack.rs +++ b/tests/fail/data_race/read_write_race_stack.rs @@ -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. diff --git a/tests/fail/data_race/relax_acquire_race.rs b/tests/fail/data_race/relax_acquire_race.rs index faa23a150e3..3038efe99ef 100644 --- a/tests/fail/data_race/relax_acquire_race.rs +++ b/tests/fail/data_race/relax_acquire_race.rs @@ -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; diff --git a/tests/fail/data_race/release_seq_race.rs b/tests/fail/data_race/release_seq_race.rs index ab6926102a2..ca227bf5ad2 100644 --- a/tests/fail/data_race/release_seq_race.rs +++ b/tests/fail/data_race/release_seq_race.rs @@ -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}; diff --git a/tests/fail/data_race/release_seq_race_same_thread.rs b/tests/fail/data_race/release_seq_race_same_thread.rs index d3d18f0e254..c9b0cd7773e 100644 --- a/tests/fail/data_race/release_seq_race_same_thread.rs +++ b/tests/fail/data_race/release_seq_race_same_thread.rs @@ -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; diff --git a/tests/fail/data_race/rmw_race.rs b/tests/fail/data_race/rmw_race.rs index 800b1043c00..ca8123177ab 100644 --- a/tests/fail/data_race/rmw_race.rs +++ b/tests/fail/data_race/rmw_race.rs @@ -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; diff --git a/tests/fail/data_race/stack_pop_race.rs b/tests/fail/data_race/stack_pop_race.rs index bae88560014..a31c434604b 100644 --- a/tests/fail/data_race/stack_pop_race.rs +++ b/tests/fail/data_race/stack_pop_race.rs @@ -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)] diff --git a/tests/fail/data_race/write_write_race.rs b/tests/fail/data_race/write_write_race.rs index 989ae31a6d2..ddd710bce08 100644 --- a/tests/fail/data_race/write_write_race.rs +++ b/tests/fail/data_race/write_write_race.rs @@ -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; diff --git a/tests/fail/data_race/write_write_race_stack.rs b/tests/fail/data_race/write_write_race_stack.rs index 3c1eabbf251..96b40affaed 100644 --- a/tests/fail/data_race/write_write_race_stack.rs +++ b/tests/fail/data_race/write_write_race_stack.rs @@ -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}; diff --git a/tests/fail/environ-gets-deallocated.rs b/tests/fail/environ-gets-deallocated.rs index f50a66e2c76..34941b94492 100644 --- a/tests/fail/environ-gets-deallocated.rs +++ b/tests/fail/environ-gets-deallocated.rs @@ -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 { diff --git a/tests/fail/erroneous_const.rs b/tests/fail/erroneous_const.rs index 8975694f51c..ce1392d102b 100644 --- a/tests/fail/erroneous_const.rs +++ b/tests/fail/erroneous_const.rs @@ -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)] diff --git a/tests/fail/fs/close_stdout.rs b/tests/fail/fs/close_stdout.rs index 4f10d5e0c99..27370111287 100644 --- a/tests/fail/fs/close_stdout.rs +++ b/tests/fail/fs/close_stdout.rs @@ -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) diff --git a/tests/fail/fs/isolated_stdin.rs b/tests/fail/fs/isolated_stdin.rs index 4098a104761..b41534c5c3a 100644 --- a/tests/fail/fs/isolated_stdin.rs +++ b/tests/fail/fs/isolated_stdin.rs @@ -1,4 +1,4 @@ -// ignore-windows: No libc on Windows +//@ignore-windows: No libc on Windows #![feature(rustc_private)] diff --git a/tests/fail/fs/read_from_stdout.rs b/tests/fail/fs/read_from_stdout.rs index 17f1735f6ad..4862bf0a162 100644 --- a/tests/fail/fs/read_from_stdout.rs +++ b/tests/fail/fs/read_from_stdout.rs @@ -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)] diff --git a/tests/fail/fs/unix_open_missing_required_mode.rs b/tests/fail/fs/unix_open_missing_required_mode.rs index bd2ae6094be..e714d26e783 100644 --- a/tests/fail/fs/unix_open_missing_required_mode.rs +++ b/tests/fail/fs/unix_open_missing_required_mode.rs @@ -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)] diff --git a/tests/fail/fs/write_to_stdin.rs b/tests/fail/fs/write_to_stdin.rs index c2754636c86..9d55a60b64b 100644 --- a/tests/fail/fs/write_to_stdin.rs +++ b/tests/fail/fs/write_to_stdin.rs @@ -1,4 +1,4 @@ -// ignore-windows: No libc on Windows +//@ignore-windows: No libc on Windows #![feature(rustc_private)] diff --git a/tests/fail/function_calls/exported_symbol_abi_mismatch.rs b/tests/fail/function_calls/exported_symbol_abi_mismatch.rs index c337e1f29f1..e7372d5ec50 100644 --- a/tests/fail/function_calls/exported_symbol_abi_mismatch.rs +++ b/tests/fail/function_calls/exported_symbol_abi_mismatch.rs @@ -1,4 +1,4 @@ -// revisions: no_cache cache fn_ptr +//@revisions: no_cache cache fn_ptr #[no_mangle] fn foo() {} diff --git a/tests/fail/function_calls/exported_symbol_bad_unwind1.rs b/tests/fail/function_calls/exported_symbol_bad_unwind1.rs index 91b0e8fc03f..0a5636138d8 100644 --- a/tests/fail/function_calls/exported_symbol_bad_unwind1.rs +++ b/tests/fail/function_calls/exported_symbol_bad_unwind1.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-disable-abi-check +//@compile-flags: -Zmiri-disable-abi-check #![feature(c_unwind)] #[no_mangle] diff --git a/tests/fail/function_calls/exported_symbol_bad_unwind2.rs b/tests/fail/function_calls/exported_symbol_bad_unwind2.rs index e80a79d1028..861789f862e 100644 --- a/tests/fail/function_calls/exported_symbol_bad_unwind2.rs +++ b/tests/fail/function_calls/exported_symbol_bad_unwind2.rs @@ -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)] diff --git a/tests/fail/function_pointers/cast_box_int_to_fn_ptr.rs b/tests/fail/function_pointers/cast_box_int_to_fn_ptr.rs index f7640cadcbc..6edf88a543d 100644 --- a/tests/fail/function_pointers/cast_box_int_to_fn_ptr.rs +++ b/tests/fail/function_pointers/cast_box_int_to_fn_ptr.rs @@ -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); diff --git a/tests/fail/function_pointers/cast_int_to_fn_ptr.rs b/tests/fail/function_pointers/cast_int_to_fn_ptr.rs index e287533ffc7..272376307d7 100644 --- a/tests/fail/function_pointers/cast_int_to_fn_ptr.rs +++ b/tests/fail/function_pointers/cast_int_to_fn_ptr.rs @@ -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::(42) }; diff --git a/tests/fail/function_pointers/execute_memory.rs b/tests/fail/function_pointers/execute_memory.rs index 2e6b58a753c..0ca29a3594e 100644 --- a/tests/fail/function_pointers/execute_memory.rs +++ b/tests/fail/function_pointers/execute_memory.rs @@ -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)] diff --git a/tests/fail/function_pointers/fn_ptr_offset.rs b/tests/fail/function_pointers/fn_ptr_offset.rs index 04c54c01592..5f269760f11 100644 --- a/tests/fail/function_pointers/fn_ptr_offset.rs +++ b/tests/fail/function_pointers/fn_ptr_offset.rs @@ -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; diff --git a/tests/fail/generator-pinned-moved.rs b/tests/fail/generator-pinned-moved.rs index 8c8e8284700..915dcdea82e 100644 --- a/tests/fail/generator-pinned-moved.rs +++ b/tests/fail/generator-pinned-moved.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-disable-validation +//@compile-flags: -Zmiri-disable-validation #![feature(generators, generator_trait)] use std::{ diff --git a/tests/fail/invalid_bool.rs b/tests/fail/invalid_bool.rs index c0c982b8ca2..b2052d982ed 100644 --- a/tests/fail/invalid_bool.rs +++ b/tests/fail/invalid_bool.rs @@ -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() { diff --git a/tests/fail/invalid_char.rs b/tests/fail/invalid_char.rs index 9d485b73f24..8d814fd92e0 100644 --- a/tests/fail/invalid_char.rs +++ b/tests/fail/invalid_char.rs @@ -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; diff --git a/tests/fail/invalid_int.rs b/tests/fail/invalid_int.rs index 26a85802079..6914c66faec 100644 --- a/tests/fail/invalid_int.rs +++ b/tests/fail/invalid_int.rs @@ -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::::uninit().assume_init() }; diff --git a/tests/fail/modifying_constants.rs b/tests/fail/modifying_constants.rs index 0c884142bf1..3c47661a4b2 100644 --- a/tests/fail/modifying_constants.rs +++ b/tests/fail/modifying_constants.rs @@ -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 diff --git a/tests/fail/never_say_never.rs b/tests/fail/never_say_never.rs index 7aae8a29211..6beaada56e9 100644 --- a/tests/fail/never_say_never.rs +++ b/tests/fail/never_say_never.rs @@ -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)] diff --git a/tests/fail/never_transmute_humans.rs b/tests/fail/never_transmute_humans.rs index 8a7d7bfcc68..010c9d4146d 100644 --- a/tests/fail/never_transmute_humans.rs +++ b/tests/fail/never_transmute_humans.rs @@ -1,5 +1,5 @@ // This should fail even without validation -// compile-flags: -Zmiri-disable-validation +//@compile-flags: -Zmiri-disable-validation #![feature(never_type)] diff --git a/tests/fail/never_transmute_void.rs b/tests/fail/never_transmute_void.rs index f5d0f914dac..d9c34aa7a5c 100644 --- a/tests/fail/never_transmute_void.rs +++ b/tests/fail/never_transmute_void.rs @@ -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)] diff --git a/tests/fail/panic/bad_miri_start_panic.rs b/tests/fail/panic/bad_miri_start_panic.rs index 089cd86f1b8..9beeccd1d22 100644 --- a/tests/fail/panic/bad_miri_start_panic.rs +++ b/tests/fail/panic/bad_miri_start_panic.rs @@ -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)] diff --git a/tests/fail/panic/unwind_panic_abort.rs b/tests/fail/panic/unwind_panic_abort.rs index 6afcd7ae7ff..40dcf1bc2a3 100644 --- a/tests/fail/panic/unwind_panic_abort.rs +++ b/tests/fail/panic/unwind_panic_abort.rs @@ -1,4 +1,4 @@ -// compile-flags: -Cpanic=abort +//@compile-flags: -Cpanic=abort //! Unwinding despite `-C panic=abort` is an error. diff --git a/tests/fail/pointer_partial_overwrite.rs b/tests/fail/pointer_partial_overwrite.rs index 1bbb33aa2bb..95af3569f35 100644 --- a/tests/fail/pointer_partial_overwrite.rs +++ b/tests/fail/pointer_partial_overwrite.rs @@ -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 . diff --git a/tests/fail/provenance/provenance_transmute.rs b/tests/fail/provenance/provenance_transmute.rs index 28e6ba62308..90208c88d69 100644 --- a/tests/fail/provenance/provenance_transmute.rs +++ b/tests/fail/provenance/provenance_transmute.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-permissive-provenance +//@compile-flags: -Zmiri-permissive-provenance #![feature(strict_provenance)] use std::mem; diff --git a/tests/fail/provenance/ptr_int_unexposed.rs b/tests/fail/provenance/ptr_int_unexposed.rs index ad29d38dc3f..5522aa33c74 100644 --- a/tests/fail/provenance/ptr_int_unexposed.rs +++ b/tests/fail/provenance/ptr_int_unexposed.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-permissive-provenance +//@compile-flags: -Zmiri-permissive-provenance #![feature(strict_provenance)] fn main() { diff --git a/tests/fail/provenance/strict_provenance_cast.rs b/tests/fail/provenance/strict_provenance_cast.rs index 968c4dfded3..bca7ea90a31 100644 --- a/tests/fail/provenance/strict_provenance_cast.rs +++ b/tests/fail/provenance/strict_provenance_cast.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-strict-provenance +//@compile-flags: -Zmiri-strict-provenance fn main() { let addr = &0 as *const i32 as usize; diff --git a/tests/fail/rc_as_ptr.rs b/tests/fail/rc_as_ptr.rs index 049330ef363..9aafa262842 100644 --- a/tests/fail/rc_as_ptr.rs +++ b/tests/fail/rc_as_ptr.rs @@ -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}; diff --git a/tests/fail/shim_arg_size.rs b/tests/fail/shim_arg_size.rs index 37557de0a5e..d1ffdf8cddb 100644 --- a/tests/fail/shim_arg_size.rs +++ b/tests/fail/shim_arg_size.rs @@ -1,4 +1,4 @@ -// stderr-per-bitwidth +//@stderr-per-bitwidth fn main() { extern "C" { diff --git a/tests/fail/stacked_borrows/exposed_only_ro.rs b/tests/fail/stacked_borrows/exposed_only_ro.rs index 9b4234499df..f2fdc213b14 100644 --- a/tests/fail/stacked_borrows/exposed_only_ro.rs +++ b/tests/fail/stacked_borrows/exposed_only_ro.rs @@ -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. diff --git a/tests/fail/stacked_borrows/illegal_read5.rs b/tests/fail/stacked_borrows/illegal_read5.rs index 71af84e5b5f..8f86a4f0a6b 100644 --- a/tests/fail/stacked_borrows/illegal_read5.rs +++ b/tests/fail/stacked_borrows/illegal_read5.rs @@ -1,6 +1,6 @@ // We *can* have aliasing &RefCell 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}; diff --git a/tests/fail/stacked_borrows/illegal_read_despite_exposed1.rs b/tests/fail/stacked_borrows/illegal_read_despite_exposed1.rs index 61a5e05d34c..d779d4e4465 100644 --- a/tests/fail/stacked_borrows/illegal_read_despite_exposed1.rs +++ b/tests/fail/stacked_borrows/illegal_read_despite_exposed1.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-permissive-provenance +//@compile-flags: -Zmiri-permissive-provenance fn main() { unsafe { diff --git a/tests/fail/stacked_borrows/illegal_read_despite_exposed2.rs b/tests/fail/stacked_borrows/illegal_read_despite_exposed2.rs index 19d0784591e..20b44e9e027 100644 --- a/tests/fail/stacked_borrows/illegal_read_despite_exposed2.rs +++ b/tests/fail/stacked_borrows/illegal_read_despite_exposed2.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-permissive-provenance +//@compile-flags: -Zmiri-permissive-provenance fn main() { unsafe { diff --git a/tests/fail/stacked_borrows/illegal_write_despite_exposed1.rs b/tests/fail/stacked_borrows/illegal_write_despite_exposed1.rs index b50399b9df5..f14fcb14793 100644 --- a/tests/fail/stacked_borrows/illegal_write_despite_exposed1.rs +++ b/tests/fail/stacked_borrows/illegal_write_despite_exposed1.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-permissive-provenance +//@compile-flags: -Zmiri-permissive-provenance fn main() { unsafe { diff --git a/tests/fail/stacked_borrows/load_invalid_mut.rs b/tests/fail/stacked_borrows/load_invalid_mut.rs index c2c4ce6726d..f0ae77f8610 100644 --- a/tests/fail/stacked_borrows/load_invalid_mut.rs +++ b/tests/fail/stacked_borrows/load_invalid_mut.rs @@ -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() { diff --git a/tests/fail/stacked_borrows/load_invalid_shr.rs b/tests/fail/stacked_borrows/load_invalid_shr.rs index 7d681f649a1..36ffef656e7 100644 --- a/tests/fail/stacked_borrows/load_invalid_shr.rs +++ b/tests/fail/stacked_borrows/load_invalid_shr.rs @@ -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() { diff --git a/tests/fail/stacked_borrows/shared_rw_borrows_are_weak2.rs b/tests/fail/stacked_borrows/shared_rw_borrows_are_weak2.rs index 07163456ceb..2fc05c2bf4c 100644 --- a/tests/fail/stacked_borrows/shared_rw_borrows_are_weak2.rs +++ b/tests/fail/stacked_borrows/shared_rw_borrows_are_weak2.rs @@ -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; diff --git a/tests/fail/stacked_borrows/unescaped_local.rs b/tests/fail/stacked_borrows/unescaped_local.rs index c994f6c3818..e6cd8f09b1a 100644 --- a/tests/fail/stacked_borrows/unescaped_local.rs +++ b/tests/fail/stacked_borrows/unescaped_local.rs @@ -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. diff --git a/tests/fail/stacked_borrows/zst_slice.rs b/tests/fail/stacked_borrows/zst_slice.rs index 336b1041df0..3e27f514bc8 100644 --- a/tests/fail/stacked_borrows/zst_slice.rs +++ b/tests/fail/stacked_borrows/zst_slice.rs @@ -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() { diff --git a/tests/fail/static_memory_modification1.rs b/tests/fail/static_memory_modification1.rs index 6284fec1601..38e8af4c4f1 100644 --- a/tests/fail/static_memory_modification1.rs +++ b/tests/fail/static_memory_modification1.rs @@ -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; diff --git a/tests/fail/static_memory_modification2.rs b/tests/fail/static_memory_modification2.rs index 558070d8a79..2e9d123c6d3 100644 --- a/tests/fail/static_memory_modification2.rs +++ b/tests/fail/static_memory_modification2.rs @@ -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; diff --git a/tests/fail/static_memory_modification3.rs b/tests/fail/static_memory_modification3.rs index 93df1c59453..34ccd13c429 100644 --- a/tests/fail/static_memory_modification3.rs +++ b/tests/fail/static_memory_modification3.rs @@ -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; diff --git a/tests/fail/sync/libc_pthread_cond_double_destroy.rs b/tests/fail/sync/libc_pthread_cond_double_destroy.rs index 18be75b308c..d358b3d4f63 100644 --- a/tests/fail/sync/libc_pthread_cond_double_destroy.rs +++ b/tests/fail/sync/libc_pthread_cond_double_destroy.rs @@ -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 diff --git a/tests/fail/sync/libc_pthread_condattr_double_destroy.rs b/tests/fail/sync/libc_pthread_condattr_double_destroy.rs index 1543a5841ad..bf6b038a212 100644 --- a/tests/fail/sync/libc_pthread_condattr_double_destroy.rs +++ b/tests/fail/sync/libc_pthread_condattr_double_destroy.rs @@ -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 diff --git a/tests/fail/sync/libc_pthread_mutex_NULL_deadlock.rs b/tests/fail/sync/libc_pthread_mutex_NULL_deadlock.rs index 3a737b2e3e1..22dd656023b 100644 --- a/tests/fail/sync/libc_pthread_mutex_NULL_deadlock.rs +++ b/tests/fail/sync/libc_pthread_mutex_NULL_deadlock.rs @@ -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. diff --git a/tests/fail/sync/libc_pthread_mutex_deadlock.rs b/tests/fail/sync/libc_pthread_mutex_deadlock.rs index 5d04635a36c..597d7721b12 100644 --- a/tests/fail/sync/libc_pthread_mutex_deadlock.rs +++ b/tests/fail/sync/libc_pthread_mutex_deadlock.rs @@ -1,4 +1,4 @@ -// ignore-windows: No libc on Windows +//@ignore-windows: No libc on Windows #![feature(rustc_private)] diff --git a/tests/fail/sync/libc_pthread_mutex_default_deadlock.rs b/tests/fail/sync/libc_pthread_mutex_default_deadlock.rs index 0f6f570d70b..e34dfe5e367 100644 --- a/tests/fail/sync/libc_pthread_mutex_default_deadlock.rs +++ b/tests/fail/sync/libc_pthread_mutex_default_deadlock.rs @@ -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. diff --git a/tests/fail/sync/libc_pthread_mutex_destroy_locked.rs b/tests/fail/sync/libc_pthread_mutex_destroy_locked.rs index 85a37db341f..ada3d311134 100644 --- a/tests/fail/sync/libc_pthread_mutex_destroy_locked.rs +++ b/tests/fail/sync/libc_pthread_mutex_destroy_locked.rs @@ -1,4 +1,4 @@ -// ignore-windows: No libc on Windows +//@ignore-windows: No libc on Windows #![feature(rustc_private)] diff --git a/tests/fail/sync/libc_pthread_mutex_double_destroy.rs b/tests/fail/sync/libc_pthread_mutex_double_destroy.rs index 3710810cd2c..4cf006437b3 100644 --- a/tests/fail/sync/libc_pthread_mutex_double_destroy.rs +++ b/tests/fail/sync/libc_pthread_mutex_double_destroy.rs @@ -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 diff --git a/tests/fail/sync/libc_pthread_mutex_normal_deadlock.rs b/tests/fail/sync/libc_pthread_mutex_normal_deadlock.rs index 7e29a41920e..8ecad494cfe 100644 --- a/tests/fail/sync/libc_pthread_mutex_normal_deadlock.rs +++ b/tests/fail/sync/libc_pthread_mutex_normal_deadlock.rs @@ -1,4 +1,4 @@ -// ignore-windows: No libc on Windows +//@ignore-windows: No libc on Windows #![feature(rustc_private)] diff --git a/tests/fail/sync/libc_pthread_mutex_normal_unlock_unlocked.rs b/tests/fail/sync/libc_pthread_mutex_normal_unlock_unlocked.rs index 1f1a2ef34b7..0109907a118 100644 --- a/tests/fail/sync/libc_pthread_mutex_normal_unlock_unlocked.rs +++ b/tests/fail/sync/libc_pthread_mutex_normal_unlock_unlocked.rs @@ -1,4 +1,4 @@ -// ignore-windows: No libc on Windows +//@ignore-windows: No libc on Windows #![feature(rustc_private)] diff --git a/tests/fail/sync/libc_pthread_mutex_wrong_owner.rs b/tests/fail/sync/libc_pthread_mutex_wrong_owner.rs index d69929d4ed4..d91245104b0 100644 --- a/tests/fail/sync/libc_pthread_mutex_wrong_owner.rs +++ b/tests/fail/sync/libc_pthread_mutex_wrong_owner.rs @@ -1,4 +1,4 @@ -// ignore-windows: No libc on Windows +//@ignore-windows: No libc on Windows #![feature(rustc_private)] diff --git a/tests/fail/sync/libc_pthread_mutexattr_double_destroy.rs b/tests/fail/sync/libc_pthread_mutexattr_double_destroy.rs index c232780ee2e..ffa786b6589 100644 --- a/tests/fail/sync/libc_pthread_mutexattr_double_destroy.rs +++ b/tests/fail/sync/libc_pthread_mutexattr_double_destroy.rs @@ -1,4 +1,4 @@ -// ignore-windows: No libc on Windows +//@ignore-windows: No libc on Windows #![feature(rustc_private)] /// Test that destroying a pthread_mutexattr twice fails, even without a check for number validity diff --git a/tests/fail/sync/libc_pthread_rwlock_destroy_read_locked.rs b/tests/fail/sync/libc_pthread_rwlock_destroy_read_locked.rs index 8750a7388fc..6a9f548d1a3 100644 --- a/tests/fail/sync/libc_pthread_rwlock_destroy_read_locked.rs +++ b/tests/fail/sync/libc_pthread_rwlock_destroy_read_locked.rs @@ -1,4 +1,4 @@ -// ignore-windows: No libc on Windows +//@ignore-windows: No libc on Windows #![feature(rustc_private)] diff --git a/tests/fail/sync/libc_pthread_rwlock_destroy_write_locked.rs b/tests/fail/sync/libc_pthread_rwlock_destroy_write_locked.rs index aecccfa5031..5f5f16d2cf0 100644 --- a/tests/fail/sync/libc_pthread_rwlock_destroy_write_locked.rs +++ b/tests/fail/sync/libc_pthread_rwlock_destroy_write_locked.rs @@ -1,4 +1,4 @@ -// ignore-windows: No libc on Windows +//@ignore-windows: No libc on Windows #![feature(rustc_private)] diff --git a/tests/fail/sync/libc_pthread_rwlock_double_destroy.rs b/tests/fail/sync/libc_pthread_rwlock_double_destroy.rs index 055bb1af489..1ba89fb22cf 100644 --- a/tests/fail/sync/libc_pthread_rwlock_double_destroy.rs +++ b/tests/fail/sync/libc_pthread_rwlock_double_destroy.rs @@ -1,4 +1,4 @@ -// ignore-windows: No libc on Windows +//@ignore-windows: No libc on Windows #![feature(rustc_private)] /// Test that destroying a pthread_rwlock twice fails, even without a check for number validity diff --git a/tests/fail/sync/libc_pthread_rwlock_read_write_deadlock_single_thread.rs b/tests/fail/sync/libc_pthread_rwlock_read_write_deadlock_single_thread.rs index dd4707d60e4..9c8d22310ca 100644 --- a/tests/fail/sync/libc_pthread_rwlock_read_write_deadlock_single_thread.rs +++ b/tests/fail/sync/libc_pthread_rwlock_read_write_deadlock_single_thread.rs @@ -1,4 +1,4 @@ -// ignore-windows: No libc on Windows +//@ignore-windows: No libc on Windows #![feature(rustc_private)] diff --git a/tests/fail/sync/libc_pthread_rwlock_read_wrong_owner.rs b/tests/fail/sync/libc_pthread_rwlock_read_wrong_owner.rs index a73a8496a32..361cc7cdd85 100644 --- a/tests/fail/sync/libc_pthread_rwlock_read_wrong_owner.rs +++ b/tests/fail/sync/libc_pthread_rwlock_read_wrong_owner.rs @@ -1,4 +1,4 @@ -// ignore-windows: No libc on Windows +//@ignore-windows: No libc on Windows #![feature(rustc_private)] diff --git a/tests/fail/sync/libc_pthread_rwlock_unlock_unlocked.rs b/tests/fail/sync/libc_pthread_rwlock_unlock_unlocked.rs index 8b3de53828d..7918a9665a0 100644 --- a/tests/fail/sync/libc_pthread_rwlock_unlock_unlocked.rs +++ b/tests/fail/sync/libc_pthread_rwlock_unlock_unlocked.rs @@ -1,4 +1,4 @@ -// ignore-windows: No libc on Windows +//@ignore-windows: No libc on Windows #![feature(rustc_private)] diff --git a/tests/fail/sync/libc_pthread_rwlock_write_read_deadlock.rs b/tests/fail/sync/libc_pthread_rwlock_write_read_deadlock.rs index 19dce431c8b..3158b944a7f 100644 --- a/tests/fail/sync/libc_pthread_rwlock_write_read_deadlock.rs +++ b/tests/fail/sync/libc_pthread_rwlock_write_read_deadlock.rs @@ -1,4 +1,4 @@ -// ignore-windows: No libc on Windows +//@ignore-windows: No libc on Windows #![feature(rustc_private)] diff --git a/tests/fail/sync/libc_pthread_rwlock_write_read_deadlock_single_thread.rs b/tests/fail/sync/libc_pthread_rwlock_write_read_deadlock_single_thread.rs index 1b460e7174d..c6b468eb89b 100644 --- a/tests/fail/sync/libc_pthread_rwlock_write_read_deadlock_single_thread.rs +++ b/tests/fail/sync/libc_pthread_rwlock_write_read_deadlock_single_thread.rs @@ -1,4 +1,4 @@ -// ignore-windows: No libc on Windows +//@ignore-windows: No libc on Windows #![feature(rustc_private)] diff --git a/tests/fail/sync/libc_pthread_rwlock_write_write_deadlock.rs b/tests/fail/sync/libc_pthread_rwlock_write_write_deadlock.rs index 098c1c2fe26..91adaf85499 100644 --- a/tests/fail/sync/libc_pthread_rwlock_write_write_deadlock.rs +++ b/tests/fail/sync/libc_pthread_rwlock_write_write_deadlock.rs @@ -1,4 +1,4 @@ -// ignore-windows: No libc on Windows +//@ignore-windows: No libc on Windows #![feature(rustc_private)] diff --git a/tests/fail/sync/libc_pthread_rwlock_write_write_deadlock_single_thread.rs b/tests/fail/sync/libc_pthread_rwlock_write_write_deadlock_single_thread.rs index cc327ec46bc..13a7ceefc7b 100644 --- a/tests/fail/sync/libc_pthread_rwlock_write_write_deadlock_single_thread.rs +++ b/tests/fail/sync/libc_pthread_rwlock_write_write_deadlock_single_thread.rs @@ -1,4 +1,4 @@ -// ignore-windows: No libc on Windows +//@ignore-windows: No libc on Windows #![feature(rustc_private)] diff --git a/tests/fail/sync/libc_pthread_rwlock_write_wrong_owner.rs b/tests/fail/sync/libc_pthread_rwlock_write_wrong_owner.rs index 663dedb6f6f..a205bbcb6b5 100644 --- a/tests/fail/sync/libc_pthread_rwlock_write_wrong_owner.rs +++ b/tests/fail/sync/libc_pthread_rwlock_write_wrong_owner.rs @@ -1,4 +1,4 @@ -// ignore-windows: No libc on Windows +//@ignore-windows: No libc on Windows #![feature(rustc_private)] diff --git a/tests/fail/type-too-large.rs b/tests/fail/type-too-large.rs index 08f7a49b025..932964ebdd7 100644 --- a/tests/fail/type-too-large.rs +++ b/tests/fail/type-too-large.rs @@ -1,4 +1,4 @@ -// ignore-32bit +//@ignore-32bit fn main() { let _fat: [u8; (1 << 61) + (1 << 31)]; diff --git a/tests/fail/unaligned_pointers/alignment.rs b/tests/fail/unaligned_pointers/alignment.rs index abee75ec71b..438e74e5b8d 100644 --- a/tests/fail/unaligned_pointers/alignment.rs +++ b/tests/fail/unaligned_pointers/alignment.rs @@ -1,4 +1,4 @@ -// normalize-stderr-test: "\| +\^+" -> "| ^" +//@normalize-stderr-test: "\| +\^+" -> "| ^" fn main() { // No retry needed, this fails reliably. diff --git a/tests/fail/unaligned_pointers/atomic_unaligned.rs b/tests/fail/unaligned_pointers/atomic_unaligned.rs index 74dd0b415c9..68b0efdbfeb 100644 --- a/tests/fail/unaligned_pointers/atomic_unaligned.rs +++ b/tests/fail/unaligned_pointers/atomic_unaligned.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-symbolic-alignment-check +//@compile-flags: -Zmiri-symbolic-alignment-check #![feature(core_intrinsics)] fn main() { diff --git a/tests/fail/unaligned_pointers/dyn_alignment.rs b/tests/fail/unaligned_pointers/dyn_alignment.rs index 730dd87cbb1..fe9c3952302 100644 --- a/tests/fail/unaligned_pointers/dyn_alignment.rs +++ b/tests/fail/unaligned_pointers/dyn_alignment.rs @@ -1,5 +1,5 @@ // should find the bug even without validation and stacked borrows, 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 #[repr(align(256))] #[derive(Debug)] diff --git a/tests/fail/unaligned_pointers/intptrcast_alignment_check.rs b/tests/fail/unaligned_pointers/intptrcast_alignment_check.rs index dea9335ab75..172461424ec 100644 --- a/tests/fail/unaligned_pointers/intptrcast_alignment_check.rs +++ b/tests/fail/unaligned_pointers/intptrcast_alignment_check.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-symbolic-alignment-check -Zmiri-permissive-provenance +//@compile-flags: -Zmiri-symbolic-alignment-check -Zmiri-permissive-provenance // With the symbolic alignment check, even with intptrcast and without // validation, we want to be *sure* to catch bugs that arise from pointers being // insufficiently aligned. The only way to achieve that is not not let programs diff --git a/tests/fail/unaligned_pointers/reference_to_packed.rs b/tests/fail/unaligned_pointers/reference_to_packed.rs index c42f0e27aea..b4659805745 100644 --- a/tests/fail/unaligned_pointers/reference_to_packed.rs +++ b/tests/fail/unaligned_pointers/reference_to_packed.rs @@ -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 #![allow(dead_code, unused_variables, unaligned_references)] diff --git a/tests/fail/unaligned_pointers/unaligned_ptr1.rs b/tests/fail/unaligned_pointers/unaligned_ptr1.rs index 7d192e5d392..a3b48328113 100644 --- a/tests/fail/unaligned_pointers/unaligned_ptr1.rs +++ b/tests/fail/unaligned_pointers/unaligned_ptr1.rs @@ -1,5 +1,5 @@ // This should fail even without validation or Stacked Borrows. -// compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows +//@compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows fn main() { // Try many times as this might work by chance. diff --git a/tests/fail/unaligned_pointers/unaligned_ptr2.rs b/tests/fail/unaligned_pointers/unaligned_ptr2.rs index 49612e2b8a0..88fcd30278d 100644 --- a/tests/fail/unaligned_pointers/unaligned_ptr2.rs +++ b/tests/fail/unaligned_pointers/unaligned_ptr2.rs @@ -1,5 +1,5 @@ // This should fail even without validation or Stacked Borrows. -// compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows +//@compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows fn main() { // No retry needed, this fails reliably. diff --git a/tests/fail/unaligned_pointers/unaligned_ptr3.rs b/tests/fail/unaligned_pointers/unaligned_ptr3.rs index 748a31681a7..3a4b1497ae6 100644 --- a/tests/fail/unaligned_pointers/unaligned_ptr3.rs +++ b/tests/fail/unaligned_pointers/unaligned_ptr3.rs @@ -1,5 +1,5 @@ // This should fail even without validation or Stacked Borrows. -// compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows +//@compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows fn main() { // Try many times as this might work by chance. diff --git a/tests/fail/unaligned_pointers/unaligned_ptr4.rs b/tests/fail/unaligned_pointers/unaligned_ptr4.rs index d01cabfa31c..659fbf1470c 100644 --- a/tests/fail/unaligned_pointers/unaligned_ptr4.rs +++ b/tests/fail/unaligned_pointers/unaligned_ptr4.rs @@ -1,5 +1,5 @@ // This should fail even without validation or Stacked Borrows. -// compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows +//@compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows fn main() { // Make sure we notice when a u16 is loaded at offset 1 into a u8 allocation. diff --git a/tests/fail/unaligned_pointers/unaligned_ptr_addr_of.rs b/tests/fail/unaligned_pointers/unaligned_ptr_addr_of.rs index dff92d56d70..28a58556eb3 100644 --- a/tests/fail/unaligned_pointers/unaligned_ptr_addr_of.rs +++ b/tests/fail/unaligned_pointers/unaligned_ptr_addr_of.rs @@ -1,5 +1,5 @@ // This should fail even without validation or Stacked Borrows. -// compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows +//@compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows use std::ptr; fn main() { diff --git a/tests/fail/unaligned_pointers/unaligned_ptr_zst.rs b/tests/fail/unaligned_pointers/unaligned_ptr_zst.rs index 8252ea83c87..26c315d34bf 100644 --- a/tests/fail/unaligned_pointers/unaligned_ptr_zst.rs +++ b/tests/fail/unaligned_pointers/unaligned_ptr_zst.rs @@ -1,6 +1,6 @@ // This should fail even without validation // Some optimizations remove ZST accesses, thus masking this UB. -// compile-flags: -Zmir-opt-level=0 -Zmiri-disable-validation +//@compile-flags: -Zmir-opt-level=0 -Zmiri-disable-validation fn main() { // Try many times as this might work by chance. diff --git a/tests/fail/uninit_byte_read.rs b/tests/fail/uninit_byte_read.rs index 683088e78bf..e08d34d1385 100644 --- a/tests/fail/uninit_byte_read.rs +++ b/tests/fail/uninit_byte_read.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-disable-stacked-borrows +//@compile-flags: -Zmiri-disable-stacked-borrows fn main() { let v: Vec = Vec::with_capacity(10); let undef = unsafe { *v.get_unchecked(5) }; //~ ERROR uninitialized diff --git a/tests/fail/unsupported_signal.rs b/tests/fail/unsupported_signal.rs index 3e76d1c3f38..9cdf3cfdc66 100644 --- a/tests/fail/unsupported_signal.rs +++ b/tests/fail/unsupported_signal.rs @@ -1,6 +1,6 @@ //! `signal()` is special on Linux and macOS that it's only supported within libstd. //! The implementation is not complete enough to permit user code to call it. -// ignore-windows: No libc on Windows +//@ignore-windows: No libc on Windows #![feature(rustc_private)] extern crate libc; diff --git a/tests/fail/validity/cast_fn_ptr1.rs b/tests/fail/validity/cast_fn_ptr1.rs index eb5774fe799..1bd889e8999 100644 --- a/tests/fail/validity/cast_fn_ptr1.rs +++ b/tests/fail/validity/cast_fn_ptr1.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-permissive-provenance +//@compile-flags: -Zmiri-permissive-provenance fn main() { // Cast a function pointer such that on a call, the argument gets transmuted diff --git a/tests/fail/validity/cast_fn_ptr2.rs b/tests/fail/validity/cast_fn_ptr2.rs index 1cf4ca7d19d..7e7ad4710f5 100644 --- a/tests/fail/validity/cast_fn_ptr2.rs +++ b/tests/fail/validity/cast_fn_ptr2.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-permissive-provenance +//@compile-flags: -Zmiri-permissive-provenance fn main() { // Cast a function pointer such that when returning, the return value gets transmuted diff --git a/tests/fail/validity/dangling_ref1.rs b/tests/fail/validity/dangling_ref1.rs index 78425cde4a8..cc94cc6ca0e 100644 --- a/tests/fail/validity/dangling_ref1.rs +++ b/tests/fail/validity/dangling_ref1.rs @@ -1,5 +1,5 @@ // Make sure we catch this even without Stacked Borrows -// compile-flags: -Zmiri-disable-stacked-borrows +//@compile-flags: -Zmiri-disable-stacked-borrows use std::mem; fn main() { diff --git a/tests/fail/validity/dangling_ref2.rs b/tests/fail/validity/dangling_ref2.rs index 7aff1a49785..eba026fdda8 100644 --- a/tests/fail/validity/dangling_ref2.rs +++ b/tests/fail/validity/dangling_ref2.rs @@ -1,5 +1,5 @@ // Make sure we catch this even without Stacked Borrows -// compile-flags: -Zmiri-disable-stacked-borrows +//@compile-flags: -Zmiri-disable-stacked-borrows use std::mem; fn main() { diff --git a/tests/fail/validity/dangling_ref3.rs b/tests/fail/validity/dangling_ref3.rs index 495a266a85d..8decc845ecb 100644 --- a/tests/fail/validity/dangling_ref3.rs +++ b/tests/fail/validity/dangling_ref3.rs @@ -1,5 +1,5 @@ // Make sure we catch this even without Stacked Borrows -// compile-flags: -Zmiri-disable-stacked-borrows +//@compile-flags: -Zmiri-disable-stacked-borrows use std::mem; fn dangling() -> *const u8 { diff --git a/tests/fail/validity/invalid_enum_tag_256variants_uninit.rs b/tests/fail/validity/invalid_enum_tag_256variants_uninit.rs index 7573a64d0eb..10e30cf85fe 100644 --- a/tests/fail/validity/invalid_enum_tag_256variants_uninit.rs +++ b/tests/fail/validity/invalid_enum_tag_256variants_uninit.rs @@ -1,5 +1,5 @@ // Even when uninit numbers are allowed, this enum is not. -// compile-flags: -Zmiri-allow-uninit-numbers +//@compile-flags: -Zmiri-allow-uninit-numbers #![allow(unused, deprecated, invalid_value)] #[derive(Copy, Clone)] diff --git a/tests/fail/validity/nonzero.rs b/tests/fail/validity/nonzero.rs index 8ff19a2b438..6344bb61ae2 100644 --- a/tests/fail/validity/nonzero.rs +++ b/tests/fail/validity/nonzero.rs @@ -1,5 +1,5 @@ // gets masked by optimizations -// compile-flags: -Zmir-opt-level=0 +//@compile-flags: -Zmir-opt-level=0 #![feature(rustc_attrs)] #![allow(unused_attributes)] diff --git a/tests/fail/weak_memory/racing_mixed_size.rs b/tests/fail/weak_memory/racing_mixed_size.rs index 6d53670a4e9..3608377e919 100644 --- a/tests/fail/weak_memory/racing_mixed_size.rs +++ b/tests/fail/weak_memory/racing_mixed_size.rs @@ -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)] diff --git a/tests/fail/weak_memory/racing_mixed_size_read.rs b/tests/fail/weak_memory/racing_mixed_size_read.rs index 0129b55aff6..e87b6d6fd01 100644 --- a/tests/fail/weak_memory/racing_mixed_size_read.rs +++ b/tests/fail/weak_memory/racing_mixed_size_read.rs @@ -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)] diff --git a/tests/fail/zst2.rs b/tests/fail/zst2.rs index 9f92e8994d2..55c78fe8f94 100644 --- a/tests/fail/zst2.rs +++ b/tests/fail/zst2.rs @@ -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() { // Not using the () type here, as writes of that type do not even have MIR generated. diff --git a/tests/fail/zst3.rs b/tests/fail/zst3.rs index 3f3b0af14db..47a7c0d3c2a 100644 --- a/tests/fail/zst3.rs +++ b/tests/fail/zst3.rs @@ -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() { // Not using the () type here, as writes of that type do not even have MIR generated. diff --git a/tests/panic/panic/panic1.rs b/tests/panic/panic/panic1.rs index e15d7656de8..dbddf41fdbf 100644 --- a/tests/panic/panic/panic1.rs +++ b/tests/panic/panic/panic1.rs @@ -1,5 +1,5 @@ -// rustc-env: RUST_BACKTRACE=1 -// compile-flags: -Zmiri-disable-isolation +//@rustc-env: RUST_BACKTRACE=1 +//@compile-flags: -Zmiri-disable-isolation fn main() { std::panic!("panicking from libstd"); diff --git a/tests/panic/panic/unsupported_foreign_function.rs b/tests/panic/panic/unsupported_foreign_function.rs index bc3d02c5f27..a78646528fb 100644 --- a/tests/panic/panic/unsupported_foreign_function.rs +++ b/tests/panic/panic/unsupported_foreign_function.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-panic-on-unsupported +//@compile-flags: -Zmiri-panic-on-unsupported fn main() { extern "Rust" { diff --git a/tests/panic/panic/unsupported_syscall.rs b/tests/panic/panic/unsupported_syscall.rs index 2e62a5d8ae8..3338c46c04e 100644 --- a/tests/panic/panic/unsupported_syscall.rs +++ b/tests/panic/panic/unsupported_syscall.rs @@ -1,6 +1,6 @@ -// ignore-windows: No libc on Windows -// ignore-apple: `syscall` is not supported on macOS -// compile-flags: -Zmiri-panic-on-unsupported +//@ignore-windows: No libc on Windows +//@ignore-apple: `syscall` is not supported on macOS +//@compile-flags: -Zmiri-panic-on-unsupported #![feature(rustc_private)] extern crate libc; diff --git a/tests/pass/0weak_memory_consistency.rs b/tests/pass/0weak_memory_consistency.rs index 0f798d2b575..19e19b47cfe 100644 --- a/tests/pass/0weak_memory_consistency.rs +++ b/tests/pass/0weak_memory_consistency.rs @@ -1,5 +1,5 @@ -// ignore-windows: Concurrency on Windows is not supported yet. -// compile-flags: -Zmiri-ignore-leaks -Zmiri-disable-stacked-borrows +//@ignore-windows: Concurrency on Windows is not supported yet. +//@compile-flags: -Zmiri-ignore-leaks -Zmiri-disable-stacked-borrows // The following tests check whether our weak memory emulation produces // any inconsistent execution outcomes diff --git a/tests/pass/adjacent-allocs.rs b/tests/pass/adjacent-allocs.rs index d0dc8b5d876..0051c62121c 100644 --- a/tests/pass/adjacent-allocs.rs +++ b/tests/pass/adjacent-allocs.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-permissive-provenance +//@compile-flags: -Zmiri-permissive-provenance fn ensure_allocs_can_be_adjacent() { for _ in 0..512 { diff --git a/tests/pass/align.rs b/tests/pass/align.rs index f412541bde1..997abd73392 100644 --- a/tests/pass/align.rs +++ b/tests/pass/align.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-permissive-provenance +//@compile-flags: -Zmiri-permissive-provenance /// This manually makes sure that we have a pointer with the proper alignment. fn manual_alignment() { diff --git a/tests/pass/align_offset_symbolic.rs b/tests/pass/align_offset_symbolic.rs index b57a23ab836..b3e57338363 100644 --- a/tests/pass/align_offset_symbolic.rs +++ b/tests/pass/align_offset_symbolic.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-symbolic-alignment-check +//@compile-flags: -Zmiri-symbolic-alignment-check fn test_align_offset() { let d = Box::new([0u32; 4]); diff --git a/tests/pass/atomic-compare-exchange-weak-never-fail.rs b/tests/pass/atomic-compare-exchange-weak-never-fail.rs index 2c2d4e61d9f..8d3d71869f4 100644 --- a/tests/pass/atomic-compare-exchange-weak-never-fail.rs +++ b/tests/pass/atomic-compare-exchange-weak-never-fail.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-compare-exchange-weak-failure-rate=0.0 +//@compile-flags: -Zmiri-compare-exchange-weak-failure-rate=0.0 use std::sync::atomic::{AtomicBool, Ordering::*}; // Ensure that compare_exchange_weak never fails. diff --git a/tests/pass/atomic.rs b/tests/pass/atomic.rs index 75e9cbdf132..9b82e006fa1 100644 --- a/tests/pass/atomic.rs +++ b/tests/pass/atomic.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-strict-provenance +//@compile-flags: -Zmiri-strict-provenance #![feature(strict_provenance, strict_provenance_atomic_ptr)] use std::sync::atomic::{ compiler_fence, fence, AtomicBool, AtomicIsize, AtomicPtr, AtomicU64, Ordering::*, diff --git a/tests/pass/backtrace/backtrace-api-v0.rs b/tests/pass/backtrace/backtrace-api-v0.rs index 32fd47d8c58..5cd12959ca4 100644 --- a/tests/pass/backtrace/backtrace-api-v0.rs +++ b/tests/pass/backtrace/backtrace-api-v0.rs @@ -1,4 +1,4 @@ -// normalize-stderr-test: "::<.*>" -> "" +//@normalize-stderr-test: "::<.*>" -> "" #[inline(never)] fn func_a() -> Box<[*mut ()]> { diff --git a/tests/pass/backtrace/backtrace-api-v1.rs b/tests/pass/backtrace/backtrace-api-v1.rs index c24a5f3e812..1e35574b39b 100644 --- a/tests/pass/backtrace/backtrace-api-v1.rs +++ b/tests/pass/backtrace/backtrace-api-v1.rs @@ -1,4 +1,4 @@ -// normalize-stderr-test: "::<.*>" -> "" +//@normalize-stderr-test: "::<.*>" -> "" #[inline(never)] fn func_a() -> Box<[*mut ()]> { diff --git a/tests/pass/backtrace/backtrace-global-alloc.rs b/tests/pass/backtrace/backtrace-global-alloc.rs index 8c51bf62706..45d6535bc13 100644 --- a/tests/pass/backtrace/backtrace-global-alloc.rs +++ b/tests/pass/backtrace/backtrace-global-alloc.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-disable-isolation +//@compile-flags: -Zmiri-disable-isolation #![feature(backtrace)] diff --git a/tests/pass/backtrace/backtrace-std.rs b/tests/pass/backtrace/backtrace-std.rs index 5de7cdd6a54..488b87ede8f 100644 --- a/tests/pass/backtrace/backtrace-std.rs +++ b/tests/pass/backtrace/backtrace-std.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-disable-isolation +//@compile-flags: -Zmiri-disable-isolation #![feature(backtrace)] diff --git a/tests/pass/btreemap.rs b/tests/pass/btreemap.rs index 413d7ef53d1..040c648d474 100644 --- a/tests/pass/btreemap.rs +++ b/tests/pass/btreemap.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-strict-provenance +//@compile-flags: -Zmiri-strict-provenance #![feature(btree_drain_filter)] use std::collections::{BTreeMap, BTreeSet}; use std::mem; diff --git a/tests/pass/calloc.rs b/tests/pass/calloc.rs index 9f614ce971b..a75bb060611 100644 --- a/tests/pass/calloc.rs +++ b/tests/pass/calloc.rs @@ -1,4 +1,4 @@ -// ignore-windows: No libc on Windows +//@ignore-windows: No libc on Windows #![feature(rustc_private)] diff --git a/tests/pass/concurrency/channels.rs b/tests/pass/concurrency/channels.rs index 0d6c1749eb5..e94c69b286d 100644 --- a/tests/pass/concurrency/channels.rs +++ b/tests/pass/concurrency/channels.rs @@ -1,5 +1,5 @@ -// ignore-windows: Concurrency on Windows is not supported yet. -// compile-flags: -Zmiri-strict-provenance +//@ignore-windows: Concurrency on Windows is not supported yet. +//@compile-flags: -Zmiri-strict-provenance use std::sync::mpsc::{channel, sync_channel}; use std::thread; diff --git a/tests/pass/concurrency/concurrent_caller_location.rs b/tests/pass/concurrency/concurrent_caller_location.rs index 003b9e9ca9f..6bd601abd56 100644 --- a/tests/pass/concurrency/concurrent_caller_location.rs +++ b/tests/pass/concurrency/concurrent_caller_location.rs @@ -1,4 +1,4 @@ -// ignore-windows: Concurrency on Windows is not supported yet. +//@ignore-windows: Concurrency on Windows is not supported yet. use std::panic::Location; use std::thread::spawn; diff --git a/tests/pass/concurrency/data_race.rs b/tests/pass/concurrency/data_race.rs index 812003ef4d9..69b6c53a2b7 100644 --- a/tests/pass/concurrency/data_race.rs +++ b/tests/pass/concurrency/data_race.rs @@ -1,5 +1,5 @@ -// ignore-windows: Concurrency on Windows is not supported yet. -// compile-flags: -Zmiri-disable-weak-memory-emulation +//@ignore-windows: Concurrency on Windows is not supported yet. +//@compile-flags: -Zmiri-disable-weak-memory-emulation use std::sync::atomic::{fence, AtomicUsize, Ordering}; use std::thread::spawn; diff --git a/tests/pass/concurrency/disable_data_race_detector.rs b/tests/pass/concurrency/disable_data_race_detector.rs index 14e2d5651de..a3c1e4621a3 100644 --- a/tests/pass/concurrency/disable_data_race_detector.rs +++ b/tests/pass/concurrency/disable_data_race_detector.rs @@ -1,5 +1,5 @@ -// ignore-windows: Concurrency on Windows is not supported yet. -// compile-flags: -Zmiri-disable-data-race-detector +//@ignore-windows: Concurrency on Windows is not supported yet. +//@compile-flags: -Zmiri-disable-data-race-detector use std::thread::spawn; diff --git a/tests/pass/concurrency/issue1643.rs b/tests/pass/concurrency/issue1643.rs index 1238a1bd6f5..cfe9cf4cc2f 100644 --- a/tests/pass/concurrency/issue1643.rs +++ b/tests/pass/concurrency/issue1643.rs @@ -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; diff --git a/tests/pass/concurrency/libc_pthread_cond.rs b/tests/pass/concurrency/libc_pthread_cond.rs index 1f6f46cbeb5..8d245e2f8dd 100644 --- a/tests/pass/concurrency/libc_pthread_cond.rs +++ b/tests/pass/concurrency/libc_pthread_cond.rs @@ -1,6 +1,6 @@ -// ignore-windows: No libc on Windows -// ignore-apple: pthread_condattr_setclock is not supported on MacOS. -// compile-flags: -Zmiri-disable-isolation +//@ignore-windows: No libc on Windows +//@ignore-apple: pthread_condattr_setclock is not supported on MacOS. +//@compile-flags: -Zmiri-disable-isolation #![feature(rustc_private)] diff --git a/tests/pass/concurrency/linux-futex.rs b/tests/pass/concurrency/linux-futex.rs index b65dd46d597..1ec0ec599f7 100644 --- a/tests/pass/concurrency/linux-futex.rs +++ b/tests/pass/concurrency/linux-futex.rs @@ -1,5 +1,5 @@ -// only-linux -// compile-flags: -Zmiri-disable-isolation +//@only-linux +//@compile-flags: -Zmiri-disable-isolation #![feature(rustc_private)] extern crate libc; diff --git a/tests/pass/concurrency/mutex_leak.rs b/tests/pass/concurrency/mutex_leak.rs index 7fbc6dd3016..3ac0c9336b7 100644 --- a/tests/pass/concurrency/mutex_leak.rs +++ b/tests/pass/concurrency/mutex_leak.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-ignore-leaks +//@compile-flags: -Zmiri-ignore-leaks use std::mem; use std::sync::Mutex; diff --git a/tests/pass/concurrency/simple.rs b/tests/pass/concurrency/simple.rs index 48c1f3d9fb5..ac268dab5e9 100644 --- a/tests/pass/concurrency/simple.rs +++ b/tests/pass/concurrency/simple.rs @@ -1,5 +1,5 @@ -// ignore-windows: Concurrency on Windows is not supported yet. -// compile-flags: -Zmiri-strict-provenance +//@ignore-windows: Concurrency on Windows is not supported yet. +//@compile-flags: -Zmiri-strict-provenance use std::thread; diff --git a/tests/pass/concurrency/spin_loop.rs b/tests/pass/concurrency/spin_loop.rs index e11f0789bb5..e1c47258990 100644 --- a/tests/pass/concurrency/spin_loop.rs +++ b/tests/pass/concurrency/spin_loop.rs @@ -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, Ordering}; use std::thread; diff --git a/tests/pass/concurrency/spin_loops_nopreempt.rs b/tests/pass/concurrency/spin_loops_nopreempt.rs index 99a5410c95d..823d2ec7654 100644 --- a/tests/pass/concurrency/spin_loops_nopreempt.rs +++ b/tests/pass/concurrency/spin_loops_nopreempt.rs @@ -1,6 +1,6 @@ -// ignore-windows: Concurrency on Windows is not supported yet. +//@ignore-windows: Concurrency on Windows is not supported yet. // This specifically tests behavior *without* preemption. -// compile-flags: -Zmiri-preemption-rate=0 +//@compile-flags: -Zmiri-preemption-rate=0 use std::cell::Cell; use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering}; diff --git a/tests/pass/concurrency/sync.rs b/tests/pass/concurrency/sync.rs index 396c1a97e07..b7e6f229faa 100644 --- a/tests/pass/concurrency/sync.rs +++ b/tests/pass/concurrency/sync.rs @@ -1,5 +1,5 @@ -// ignore-windows: Concurrency on Windows is not supported yet. -// compile-flags: -Zmiri-disable-isolation -Zmiri-strict-provenance +//@ignore-windows: Concurrency on Windows is not supported yet. +//@compile-flags: -Zmiri-disable-isolation -Zmiri-strict-provenance use std::sync::{Arc, Barrier, Condvar, Mutex, Once, RwLock}; use std::thread; diff --git a/tests/pass/concurrency/sync_nopreempt.rs b/tests/pass/concurrency/sync_nopreempt.rs index b5e726dac7b..e6ee4fe594f 100644 --- a/tests/pass/concurrency/sync_nopreempt.rs +++ b/tests/pass/concurrency/sync_nopreempt.rs @@ -1,6 +1,6 @@ -// ignore-windows: Concurrency on Windows is not supported yet. +//@ignore-windows: Concurrency on Windows is not supported yet. // We are making scheduler assumptions here. -// compile-flags: -Zmiri-strict-provenance -Zmiri-preemption-rate=0 +//@compile-flags: -Zmiri-strict-provenance -Zmiri-preemption-rate=0 use std::sync::{Arc, Condvar, Mutex, RwLock}; use std::thread; diff --git a/tests/pass/concurrency/thread_locals.rs b/tests/pass/concurrency/thread_locals.rs index 5b11539f7f1..82ce61d958d 100644 --- a/tests/pass/concurrency/thread_locals.rs +++ b/tests/pass/concurrency/thread_locals.rs @@ -1,5 +1,5 @@ -// ignore-windows: Concurrency on Windows is not supported yet. -// compile-flags: -Zmiri-strict-provenance +//@ignore-windows: Concurrency on Windows is not supported yet. +//@compile-flags: -Zmiri-strict-provenance //! The main purpose of this test is to check that if we take a pointer to //! thread's `t1` thread-local `A` and send it to another thread `t2`, diff --git a/tests/pass/concurrency/tls_lib_drop.rs b/tests/pass/concurrency/tls_lib_drop.rs index fe46406c283..74ba8ee7620 100644 --- a/tests/pass/concurrency/tls_lib_drop.rs +++ b/tests/pass/concurrency/tls_lib_drop.rs @@ -1,4 +1,4 @@ -// ignore-windows: Concurrency on Windows is not supported yet. +//@ignore-windows: Concurrency on Windows is not supported yet. use std::cell::RefCell; use std::thread; diff --git a/tests/pass/concurrency/tls_pthread_drop_order.rs b/tests/pass/concurrency/tls_pthread_drop_order.rs index 29c57bf49a3..b265e7da0b2 100644 --- a/tests/pass/concurrency/tls_pthread_drop_order.rs +++ b/tests/pass/concurrency/tls_pthread_drop_order.rs @@ -1,4 +1,4 @@ -// ignore-windows: No libc on Windows +//@ignore-windows: No libc on Windows #![feature(rustc_private)] extern crate libc; diff --git a/tests/pass/current_dir.rs b/tests/pass/current_dir.rs index a88f820951c..069b462ab37 100644 --- a/tests/pass/current_dir.rs +++ b/tests/pass/current_dir.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-disable-isolation +//@compile-flags: -Zmiri-disable-isolation use std::env; use std::io::ErrorKind; diff --git a/tests/pass/current_dir_with_isolation.rs b/tests/pass/current_dir_with_isolation.rs index 98c44d57b65..9dbcfeae2d6 100644 --- a/tests/pass/current_dir_with_isolation.rs +++ b/tests/pass/current_dir_with_isolation.rs @@ -1,6 +1,6 @@ -// compile-flags: -Zmiri-isolation-error=warn-nobacktrace -// normalize-stderr-test: "(getcwd|GetCurrentDirectoryW)" -> "$$GETCWD" -// normalize-stderr-test: "(chdir|SetCurrentDirectoryW)" -> "$$SETCWD" +//@compile-flags: -Zmiri-isolation-error=warn-nobacktrace +//@normalize-stderr-test: "(getcwd|GetCurrentDirectoryW)" -> "$$GETCWD" +//@normalize-stderr-test: "(chdir|SetCurrentDirectoryW)" -> "$$SETCWD" use std::env; use std::io::ErrorKind; diff --git a/tests/pass/disable-alignment-check.rs b/tests/pass/disable-alignment-check.rs index 2fb0dd8369d..366aff4a9f8 100644 --- a/tests/pass/disable-alignment-check.rs +++ b/tests/pass/disable-alignment-check.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-disable-alignment-check +//@compile-flags: -Zmiri-disable-alignment-check fn main() { let mut x = [0u8; 20]; diff --git a/tests/pass/enum_discriminant_ptr_value.rs b/tests/pass/enum_discriminant_ptr_value.rs index 618d503cd5f..4a3820777cf 100644 --- a/tests/pass/enum_discriminant_ptr_value.rs +++ b/tests/pass/enum_discriminant_ptr_value.rs @@ -1,6 +1,6 @@ // A niche-optimized enum where the discriminant is a pointer value -- relies on ptr-to-int casts in // the niche handling code. -// compile-flags: -Zmiri-disable-stacked-borrows -Zmiri-disable-validation +//@compile-flags: -Zmiri-disable-stacked-borrows -Zmiri-disable-validation fn main() { let x = 42; diff --git a/tests/pass/env-exclude.rs b/tests/pass/env-exclude.rs index 1e251084f02..14ad827463a 100644 --- a/tests/pass/env-exclude.rs +++ b/tests/pass/env-exclude.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-disable-isolation -Zmiri-env-exclude=MIRI_ENV_VAR_TEST +//@compile-flags: -Zmiri-disable-isolation -Zmiri-env-exclude=MIRI_ENV_VAR_TEST fn main() { assert!(std::env::var("MIRI_ENV_VAR_TEST").is_err()); diff --git a/tests/pass/env-forward.rs b/tests/pass/env-forward.rs index 8eebc45f55a..da7730b00f0 100644 --- a/tests/pass/env-forward.rs +++ b/tests/pass/env-forward.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-env-forward=MIRI_ENV_VAR_TEST +//@compile-flags: -Zmiri-env-forward=MIRI_ENV_VAR_TEST fn main() { assert_eq!(std::env::var("MIRI_ENV_VAR_TEST"), Ok("0".to_owned())); diff --git a/tests/pass/env-without-isolation.rs b/tests/pass/env-without-isolation.rs index 63847620988..3d7461eecfe 100644 --- a/tests/pass/env-without-isolation.rs +++ b/tests/pass/env-without-isolation.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-disable-isolation +//@compile-flags: -Zmiri-disable-isolation fn main() { assert_eq!(std::env::var("MIRI_ENV_VAR_TEST"), Ok("0".to_owned())); diff --git a/tests/pass/fs.rs b/tests/pass/fs.rs index e106ca5d02b..ced7831568e 100644 --- a/tests/pass/fs.rs +++ b/tests/pass/fs.rs @@ -1,5 +1,5 @@ -// ignore-windows: File handling is not implemented yet -// compile-flags: -Zmiri-disable-isolation +//@ignore-windows: File handling is not implemented yet +//@compile-flags: -Zmiri-disable-isolation #![feature(rustc_private)] #![feature(io_error_more)] diff --git a/tests/pass/fs_with_isolation.rs b/tests/pass/fs_with_isolation.rs index 6753145e92b..719882702cd 100644 --- a/tests/pass/fs_with_isolation.rs +++ b/tests/pass/fs_with_isolation.rs @@ -1,6 +1,6 @@ -// ignore-windows: File handling is not implemented yet -// compile-flags: -Zmiri-isolation-error=warn-nobacktrace -// normalize-stderr-test: "(stat(x)?)" -> "$$STAT" +//@ignore-windows: File handling is not implemented yet +//@compile-flags: -Zmiri-isolation-error=warn-nobacktrace +//@normalize-stderr-test: "(stat(x)?)" -> "$$STAT" #![feature(rustc_private)] diff --git a/tests/pass/function_calls/disable_abi_check.rs b/tests/pass/function_calls/disable_abi_check.rs index 1f855474137..e6251b53558 100644 --- a/tests/pass/function_calls/disable_abi_check.rs +++ b/tests/pass/function_calls/disable_abi_check.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-disable-abi-check +//@compile-flags: -Zmiri-disable-abi-check #![feature(core_intrinsics)] fn main() { diff --git a/tests/pass/getpid.rs b/tests/pass/getpid.rs index 258fdeaa849..733545462eb 100644 --- a/tests/pass/getpid.rs +++ b/tests/pass/getpid.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-disable-isolation +//@compile-flags: -Zmiri-disable-isolation fn getpid() -> u32 { std::process::id() diff --git a/tests/pass/hide_stdout.rs b/tests/pass/hide_stdout.rs index 3ee68d01f43..cfd05a8396c 100644 --- a/tests/pass/hide_stdout.rs +++ b/tests/pass/hide_stdout.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-mute-stdout-stderr +//@compile-flags: -Zmiri-mute-stdout-stderr fn main() { println!("print to stdout"); diff --git a/tests/pass/integer-ops.rs b/tests/pass/integer-ops.rs index 8e2799d6890..8608d12d4d8 100644 --- a/tests/pass/integer-ops.rs +++ b/tests/pass/integer-ops.rs @@ -1,4 +1,4 @@ -// compile-flags: -Coverflow-checks=off +//@compile-flags: -Coverflow-checks=off #![feature(int_log)] #![allow(arithmetic_overflow)] diff --git a/tests/pass/intptrcast.rs b/tests/pass/intptrcast.rs index aebf5b22238..e7ff90cb6bf 100644 --- a/tests/pass/intptrcast.rs +++ b/tests/pass/intptrcast.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-permissive-provenance +//@compile-flags: -Zmiri-permissive-provenance use std::mem; diff --git a/tests/pass/intrinsics.rs b/tests/pass/intrinsics.rs index 0042872a3b4..756744badaf 100644 --- a/tests/pass/intrinsics.rs +++ b/tests/pass/intrinsics.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-permissive-provenance +//@compile-flags: -Zmiri-permissive-provenance #![feature(core_intrinsics, const_raw_ptr_comparison)] #![feature(layout_for_ptr)] diff --git a/tests/pass/issues/issue-miri-1925.rs b/tests/pass/issues/issue-miri-1925.rs index 262889f56ea..86556813491 100644 --- a/tests/pass/issues/issue-miri-1925.rs +++ b/tests/pass/issues/issue-miri-1925.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-symbolic-alignment-check +//@compile-flags: -Zmiri-symbolic-alignment-check use std::mem::size_of; diff --git a/tests/pass/issues/issue-miri-2068-2.rs b/tests/pass/issues/issue-miri-2068-2.rs index 204a4dd0564..f33806e8b44 100644 --- a/tests/pass/issues/issue-miri-2068-2.rs +++ b/tests/pass/issues/issue-miri-2068-2.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-disable-validation +//@compile-flags: -Zmiri-disable-validation use std::mem::MaybeUninit; diff --git a/tests/pass/libc.rs b/tests/pass/libc.rs index d08430a4326..53c85d2b07d 100644 --- a/tests/pass/libc.rs +++ b/tests/pass/libc.rs @@ -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)] diff --git a/tests/pass/linux-getrandom-without-isolation.rs b/tests/pass/linux-getrandom-without-isolation.rs index 56a53699477..90e054533c1 100644 --- a/tests/pass/linux-getrandom-without-isolation.rs +++ b/tests/pass/linux-getrandom-without-isolation.rs @@ -1,5 +1,5 @@ -// only-linux -// compile-flags: -Zmiri-disable-isolation +//@only-linux +//@compile-flags: -Zmiri-disable-isolation #![feature(rustc_private)] extern crate libc; diff --git a/tests/pass/linux-getrandom.rs b/tests/pass/linux-getrandom.rs index a3596e4c7a9..70c106f6460 100644 --- a/tests/pass/linux-getrandom.rs +++ b/tests/pass/linux-getrandom.rs @@ -1,4 +1,4 @@ -// only-linux +//@only-linux #![feature(rustc_private)] extern crate libc; diff --git a/tests/pass/malloc.rs b/tests/pass/malloc.rs index 72abc68bb96..c0a6a89fbed 100644 --- a/tests/pass/malloc.rs +++ b/tests/pass/malloc.rs @@ -1,4 +1,4 @@ -// ignore-windows: No libc on Windows +//@ignore-windows: No libc on Windows #![feature(rustc_private)] diff --git a/tests/pass/memleak_ignored.rs b/tests/pass/memleak_ignored.rs index fddf14121ef..60e06094e17 100644 --- a/tests/pass/memleak_ignored.rs +++ b/tests/pass/memleak_ignored.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-ignore-leaks +//@compile-flags: -Zmiri-ignore-leaks fn main() { std::mem::forget(Box::new(42)); diff --git a/tests/pass/move-uninit-primval.rs b/tests/pass/move-uninit-primval.rs index 1ca3873d1d3..220470b637f 100644 --- a/tests/pass/move-uninit-primval.rs +++ b/tests/pass/move-uninit-primval.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-allow-uninit-numbers +//@compile-flags: -Zmiri-allow-uninit-numbers #![allow(deprecated)] struct Foo { diff --git a/tests/pass/no_std.rs b/tests/pass/no_std.rs index 6808dab8143..d8a462daf5a 100644 --- a/tests/pass/no_std.rs +++ b/tests/pass/no_std.rs @@ -3,7 +3,7 @@ // windows tls dtors go through libstd right now, thus this test // cannot pass. When windows tls dtors go through the special magic // windows linker section, we can run this test on windows again. -// ignore-windows +//@ignore-windows #[start] fn start(_: isize, _: *const *const u8) -> isize { diff --git a/tests/pass/observed_local_mut.rs b/tests/pass/observed_local_mut.rs index 888b6f85e3f..ca0f569860b 100644 --- a/tests/pass/observed_local_mut.rs +++ b/tests/pass/observed_local_mut.rs @@ -1,5 +1,5 @@ // Stacked Borrows catches this (correctly) as UB. -// compile-flags: -Zmiri-disable-stacked-borrows +//@compile-flags: -Zmiri-disable-stacked-borrows // This test is intended to guard against the problem described in commit // 39bb1254d1eaf74f45a4e741097e33fc942168d5. diff --git a/tests/pass/overflow_checks_off.rs b/tests/pass/overflow_checks_off.rs index 2896d3161f7..79aa510ef97 100644 --- a/tests/pass/overflow_checks_off.rs +++ b/tests/pass/overflow_checks_off.rs @@ -1,4 +1,4 @@ -// compile-flags: -C overflow-checks=off +//@compile-flags: -C overflow-checks=off // Check that we correctly implement the intended behavior of these operators // when they are not being overflow-checked. diff --git a/tests/pass/panic/catch_panic.rs b/tests/pass/panic/catch_panic.rs index 3979fb3b071..30890440653 100644 --- a/tests/pass/panic/catch_panic.rs +++ b/tests/pass/panic/catch_panic.rs @@ -1,5 +1,5 @@ // We test the `align_offset` panic below, make sure we test the interpreter impl and not the "real" one. -// compile-flags: -Zmiri-symbolic-alignment-check -Zmiri-permissive-provenance +//@compile-flags: -Zmiri-symbolic-alignment-check -Zmiri-permissive-provenance #![feature(never_type)] #![allow(unconditional_panic, non_fmt_panics)] diff --git a/tests/pass/panic/concurrent-panic.rs b/tests/pass/panic/concurrent-panic.rs index 7b17ac4fa79..1231760865f 100644 --- a/tests/pass/panic/concurrent-panic.rs +++ b/tests/pass/panic/concurrent-panic.rs @@ -1,6 +1,6 @@ -// ignore-windows: Concurrency on Windows is not supported yet. +//@ignore-windows: Concurrency on Windows is not supported yet. // We are making scheduler assumptions here. -// compile-flags: -Zmiri-preemption-rate=0 +//@compile-flags: -Zmiri-preemption-rate=0 //! Cause a panic in one thread while another thread is unwinding. This checks //! that separate threads have their own panicking state. diff --git a/tests/pass/portable-simd.rs b/tests/pass/portable-simd.rs index ffbaa1832ec..0dfe617bd8d 100644 --- a/tests/pass/portable-simd.rs +++ b/tests/pass/portable-simd.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-strict-provenance +//@compile-flags: -Zmiri-strict-provenance #![feature(portable_simd, platform_intrinsics)] use std::simd::*; diff --git a/tests/pass/ptr_int_casts.rs b/tests/pass/ptr_int_casts.rs index ffe6a114c66..3044ac092b7 100644 --- a/tests/pass/ptr_int_casts.rs +++ b/tests/pass/ptr_int_casts.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-permissive-provenance +//@compile-flags: -Zmiri-permissive-provenance use std::mem; use std::ptr; diff --git a/tests/pass/ptr_int_from_exposed.rs b/tests/pass/ptr_int_from_exposed.rs index dc9cb393b78..ef7ff34d26b 100644 --- a/tests/pass/ptr_int_from_exposed.rs +++ b/tests/pass/ptr_int_from_exposed.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-permissive-provenance +//@compile-flags: -Zmiri-permissive-provenance #![feature(strict_provenance)] use std::ptr; diff --git a/tests/pass/ptr_offset.rs b/tests/pass/ptr_offset.rs index b16a06a7260..5270e8663b2 100644 --- a/tests/pass/ptr_offset.rs +++ b/tests/pass/ptr_offset.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-permissive-provenance +//@compile-flags: -Zmiri-permissive-provenance use std::{mem, ptr}; fn main() { diff --git a/tests/pass/rc.rs b/tests/pass/rc.rs index 260e350f27a..569dbc459a5 100644 --- a/tests/pass/rc.rs +++ b/tests/pass/rc.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-strict-provenance +//@compile-flags: -Zmiri-strict-provenance #![feature(new_uninit)] #![feature(get_mut_unchecked)] diff --git a/tests/pass/slices.rs b/tests/pass/slices.rs index 3a13ec59a02..a56b97a5088 100644 --- a/tests/pass/slices.rs +++ b/tests/pass/slices.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-strict-provenance +//@compile-flags: -Zmiri-strict-provenance #![feature(new_uninit)] #![feature(slice_as_chunks)] #![feature(slice_partition_dedup)] diff --git a/tests/pass/stacked-borrows/int-to-ptr.rs b/tests/pass/stacked-borrows/int-to-ptr.rs index dc367540627..c3e30627a7c 100644 --- a/tests/pass/stacked-borrows/int-to-ptr.rs +++ b/tests/pass/stacked-borrows/int-to-ptr.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-permissive-provenance +//@compile-flags: -Zmiri-permissive-provenance #![feature(strict_provenance)] use std::ptr; diff --git a/tests/pass/stacked-borrows/interior_mutability.rs b/tests/pass/stacked-borrows/interior_mutability.rs index 96ad67505a7..c6373a7eaf1 100644 --- a/tests/pass/stacked-borrows/interior_mutability.rs +++ b/tests/pass/stacked-borrows/interior_mutability.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-retag-fields +//@compile-flags: -Zmiri-retag-fields use std::cell::{Cell, Ref, RefCell, RefMut, UnsafeCell}; use std::mem::{self, MaybeUninit}; diff --git a/tests/pass/stacked-borrows/stacked-borrows.rs b/tests/pass/stacked-borrows/stacked-borrows.rs index b915a2ddf8f..ef6eb346c17 100644 --- a/tests/pass/stacked-borrows/stacked-borrows.rs +++ b/tests/pass/stacked-borrows/stacked-borrows.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-retag-fields +//@compile-flags: -Zmiri-retag-fields #![feature(allocator_api)] use std::ptr; diff --git a/tests/pass/strings.rs b/tests/pass/strings.rs index ccefc69bd18..5e2d2e9b5b5 100644 --- a/tests/pass/strings.rs +++ b/tests/pass/strings.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-strict-provenance +//@compile-flags: -Zmiri-strict-provenance fn empty() -> &'static str { "" diff --git a/tests/pass/threadleak_ignored.rs b/tests/pass/threadleak_ignored.rs index 36d39a72b79..2ba0b453ff3 100644 --- a/tests/pass/threadleak_ignored.rs +++ b/tests/pass/threadleak_ignored.rs @@ -1,6 +1,6 @@ -// ignore-windows: Concurrency on Windows is not supported yet. +//@ignore-windows: Concurrency on Windows is not supported yet. // FIXME: disallow preemption to work around https://github.com/rust-lang/rust/issues/55005 -// compile-flags: -Zmiri-ignore-leaks -Zmiri-preemption-rate=0 +//@compile-flags: -Zmiri-ignore-leaks -Zmiri-preemption-rate=0 //! Test that leaking threads works, and that their destructors are not executed. diff --git a/tests/pass/time.rs b/tests/pass/time.rs index 38e846309d7..e1094006fb1 100644 --- a/tests/pass/time.rs +++ b/tests/pass/time.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-disable-isolation +//@compile-flags: -Zmiri-disable-isolation use std::time::{Duration, Instant, SystemTime}; diff --git a/tests/pass/track-alloc-1.rs b/tests/pass/track-alloc-1.rs index bbd88ed5d53..427c800dc51 100644 --- a/tests/pass/track-alloc-1.rs +++ b/tests/pass/track-alloc-1.rs @@ -1,6 +1,6 @@ // Ensure that tracking early allocations doesn't ICE Miri. // Early allocations are probably part of the runtime and therefore uninteresting, but they // shouldn't cause a crash. -// compile-flags: -Zmiri-track-alloc-id=1 -// normalize-stderr-test: "[48] bytes" -> "SIZE bytes" +//@compile-flags: -Zmiri-track-alloc-id=1 +//@normalize-stderr-test: "[48] bytes" -> "SIZE bytes" fn main() {} diff --git a/tests/pass/transmute_fat.rs b/tests/pass/transmute_fat.rs index b752e5504d4..dfd78ace520 100644 --- a/tests/pass/transmute_fat.rs +++ b/tests/pass/transmute_fat.rs @@ -1,5 +1,5 @@ // Stacked Borrows disallows this becuase the reference is never cast to a raw pointer. -// compile-flags: -Zmiri-disable-stacked-borrows +//@compile-flags: -Zmiri-disable-stacked-borrows fn main() { // If we are careful, we can exploit data layout... diff --git a/tests/pass/uninit_number_ignored.rs b/tests/pass/uninit_number_ignored.rs index 13aac61ba84..44f6fa26798 100644 --- a/tests/pass/uninit_number_ignored.rs +++ b/tests/pass/uninit_number_ignored.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-allow-uninit-numbers +//@compile-flags: -Zmiri-allow-uninit-numbers // This test is adapted from https://github.com/rust-lang/miri/issues/1340#issue-600900312. fn main() { diff --git a/tests/pass/vec.rs b/tests/pass/vec.rs index 89c2561acd9..26732cec5eb 100644 --- a/tests/pass/vec.rs +++ b/tests/pass/vec.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-strict-provenance +//@compile-flags: -Zmiri-strict-provenance // Gather all references from a mutable iterator and make sure Miri notices if // using them is dangerous. fn test_all_refs<'a, T: 'a>(dummy: &mut T, iter: impl Iterator) { diff --git a/tests/pass/vecdeque.rs b/tests/pass/vecdeque.rs index d2295a7afb5..6f56f9d103e 100644 --- a/tests/pass/vecdeque.rs +++ b/tests/pass/vecdeque.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-strict-provenance +//@compile-flags: -Zmiri-strict-provenance use std::collections::VecDeque; fn test_all_refs<'a, T: 'a>(dummy: &mut T, iter: impl Iterator) { diff --git a/tests/pass/weak_memory/extra_cpp.rs b/tests/pass/weak_memory/extra_cpp.rs index 750c628458b..61ba1ab9224 100644 --- a/tests/pass/weak_memory/extra_cpp.rs +++ b/tests/pass/weak_memory/extra_cpp.rs @@ -1,5 +1,5 @@ -// ignore-windows: Concurrency on Windows is not supported yet. -// compile-flags: -Zmiri-ignore-leaks +//@ignore-windows: Concurrency on Windows is not supported yet. +//@compile-flags: -Zmiri-ignore-leaks // Tests operations not perfomable through C++'s atomic API // but doable in safe (at least sound) Rust. diff --git a/tests/pass/weak_memory/extra_cpp_unsafe.rs b/tests/pass/weak_memory/extra_cpp_unsafe.rs index d77a090e6e4..0aff70ab7b7 100644 --- a/tests/pass/weak_memory/extra_cpp_unsafe.rs +++ b/tests/pass/weak_memory/extra_cpp_unsafe.rs @@ -1,5 +1,5 @@ -// ignore-windows: Concurrency on Windows is not supported yet. -// compile-flags: -Zmiri-ignore-leaks +//@ignore-windows: Concurrency on Windows is not supported yet. +//@compile-flags: -Zmiri-ignore-leaks // Tests operations not perfomable through C++'s atomic API // but doable in unsafe Rust which we think *should* be fine. diff --git a/tests/pass/weak_memory/weak.rs b/tests/pass/weak_memory/weak.rs index b9ceb61f0c9..1d82b85844f 100644 --- a/tests/pass/weak_memory/weak.rs +++ b/tests/pass/weak_memory/weak.rs @@ -1,5 +1,5 @@ -// ignore-windows: Concurrency on Windows is not supported yet. -// compile-flags: -Zmiri-ignore-leaks -Zmiri-preemption-rate=0 +//@ignore-windows: Concurrency on Windows is not supported yet. +//@compile-flags: -Zmiri-ignore-leaks -Zmiri-preemption-rate=0 // Tests showing weak memory behaviours are exhibited. All tests // return true when the desired behaviour is seen. diff --git a/tests/pass/without-validation.rs b/tests/pass/without-validation.rs index 8cff3a5c4b2..934c44a7deb 100644 --- a/tests/pass/without-validation.rs +++ b/tests/pass/without-validation.rs @@ -1,5 +1,5 @@ // When we notice something breaks only without validation, we add a test here. -// compile-flags: -Zmiri-disable-validation +//@compile-flags: -Zmiri-disable-validation use std::cell::*; fn refcell_unsize() { diff --git a/tests/pass/wtf8.rs b/tests/pass/wtf8.rs index e31b00e9524..bf23f65c7f0 100644 --- a/tests/pass/wtf8.rs +++ b/tests/pass/wtf8.rs @@ -1,4 +1,4 @@ -// only-windows +//@only-windows use std::ffi::{OsStr, OsString}; use std::os::windows::ffi::{OsStrExt, OsStringExt}; diff --git a/tests/pass/zst.rs b/tests/pass/zst.rs index fade1e0dad8..a56386a691f 100644 --- a/tests/pass/zst.rs +++ b/tests/pass/zst.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmiri-permissive-provenance +//@compile-flags: -Zmiri-permissive-provenance #[derive(PartialEq, Debug)] struct A; diff --git a/ui_test/src/comments.rs b/ui_test/src/comments.rs index 2b6108f255f..4046a9fc0dd 100644 --- a/ui_test/src/comments.rs +++ b/ui_test/src/comments.rs @@ -74,10 +74,7 @@ impl Comments { /// Parse comments in `content`. /// `path` is only used to emit diagnostics if parsing fails. - /// - /// This function will only parse `//@` and `//~` style comments (and the `//[xxx]~` variant) - /// and ignore all others - fn parse_checked(path: &Path, content: &str) -> Result { + pub(crate) fn parse(path: &Path, content: &str) -> Result { let mut this = Self::default(); let mut fallthrough_to = None; // The line that a `|` will refer to. @@ -108,83 +105,10 @@ impl Comments { } } - /// Parse comments in `content`. - /// `path` is only used to emit diagnostics if parsing fails. - pub(crate) fn parse(path: &Path, content: &str) -> Result { - let mut this = Self::parse_checked(path, content)?; - if content.contains("//@") { - // Migration mode: if new syntax is used, ignore all old syntax - return Ok(this); - } - - for (l, line) in content.lines().enumerate() { - let l = l + 1; // enumerate starts at 0, but line numbers start at 1 - if let Some(revisions) = line.strip_prefix("// revisions:") { - assert_eq!( - this.revisions, - None, - "{}:{l}, cannot specifiy revisions twice", - path.display() - ); - this.revisions = - Some(revisions.split_whitespace().map(|s| s.to_string()).collect()); - } - if let Some(s) = line.strip_prefix("// ignore-") { - let s = s - .split_once(|c: char| c == ':' || c.is_whitespace()) - .map(|(s, _)| s) - .unwrap_or(s); - this.ignore.push(Condition::parse(s)); - } - if let Some(s) = line.strip_prefix("// only-") { - let s = s - .split_once(|c: char| c == ':' || c.is_whitespace()) - .map(|(s, _)| s) - .unwrap_or(s); - this.only.push(Condition::parse(s)); - } - if line.starts_with("// stderr-per-bitwidth") { - assert!( - !this.stderr_per_bitwidth, - "{}:{l}, cannot specifiy stderr-per-bitwidth twice", - path.display() - ); - this.stderr_per_bitwidth = true; - } - if let Some(s) = line.strip_prefix("// compile-flags:") { - this.compile_flags.extend(s.split_whitespace().map(|s| s.to_string())); - } - if let Some(s) = line.strip_prefix("// rustc-env:") { - for env in s.split_whitespace() { - if let Some((k, v)) = env.split_once('=') { - this.env_vars.push((k.to_string(), v.to_string())); - } - } - } - if let Some(s) = line.strip_prefix("// normalize-stderr-test:") { - let (from, to) = s.split_once("->").expect("normalize-stderr-test needs a `->`"); - let from = from.trim().trim_matches('"'); - let to = to.trim().trim_matches('"'); - let from = Regex::new(from).unwrap(); - this.normalize_stderr.push((from, to.to_string())); - } - if let Some(s) = line.strip_prefix("// error-pattern:") { - assert_eq!( - this.error_pattern, - None, - "{}:{l}, cannot specifiy error_pattern twice", - path.display() - ); - this.error_pattern = Some((s.trim().to_string(), l)); - } - } - Ok(this) - } - fn parse_command(&mut self, command: &str, l: usize) -> Result<()> { // Commands are letters or dashes, grab everything until the first character that is neither of those. let (command, args) = - match command.chars().position(|c: char| !c.is_alphabetic() && c != '-') { + match command.chars().position(|c: char| !c.is_alphanumeric() && c != '-') { None => (command, ""), Some(i) => { let (command, args) = command.split_at(i);