diff --git a/Cargo.lock b/Cargo.lock index 81aecf1cea77f..1497d2d463af6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -104,15 +104,6 @@ dependencies = [ "unicode-width", ] -[[package]] -name = "ansi_term" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -dependencies = [ - "winapi", -] - [[package]] name = "anstream" version = "0.6.15" @@ -714,7 +705,7 @@ dependencies = [ "miow", "miropt-test-tools", "regex", - "rustfix 0.8.1", + "rustfix", "serde", "serde_json", "tracing", @@ -2278,7 +2269,7 @@ dependencies = [ "rustc_version", "smallvec", "tempfile", - "ui_test 0.21.2", + "ui_test 0.26.5", "windows-sys 0.52.0", ] @@ -2807,16 +2798,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" -[[package]] -name = "prettydiff" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ff1fec61082821f8236cf6c0c14e8172b62ce8a72a0eedc30d3b247bb68dc11" -dependencies = [ - "ansi_term", - "pad", -] - [[package]] name = "prettydiff" version = "0.7.0" @@ -4625,18 +4606,6 @@ dependencies = [ "rustdoc", ] -[[package]] -name = "rustfix" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd2853d9e26988467753bd9912c3a126f642d05d229a4b53f5752ee36c56481" -dependencies = [ - "anyhow", - "log", - "serde", - "serde_json", -] - [[package]] name = "rustfix" version = "0.8.1" @@ -5518,15 +5487,15 @@ checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" [[package]] name = "ui_test" -version = "0.21.2" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaf4bf7c184b8dfc7a4d3b90df789b1eb992ee42811cd115f32a7a1eb781058d" +checksum = "f7e4f339f62edc873975c47115f9e71c5454ddaa37c1142b42fc0b2672c8dacb" dependencies = [ - "annotate-snippets 0.9.2", + "annotate-snippets 0.11.4", "anyhow", "bstr", "cargo-platform", - "cargo_metadata 0.15.4", + "cargo_metadata 0.18.1", "color-eyre", "colored", "comma", @@ -5534,20 +5503,20 @@ dependencies = [ "indicatif", "lazy_static", "levenshtein", - "prettydiff 0.6.4", + "prettydiff", "regex", "rustc_version", - "rustfix 0.6.1", + "rustfix", "serde", "serde_json", - "tempfile", + "spanned", ] [[package]] name = "ui_test" -version = "0.25.0" +version = "0.26.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7e4f339f62edc873975c47115f9e71c5454ddaa37c1142b42fc0b2672c8dacb" +checksum = "32ee4c40e5a5f9fa6864ff976473e5d6a6e9884b6ce68b40690d9f87e1994c83" dependencies = [ "annotate-snippets 0.11.4", "anyhow", @@ -5559,12 +5528,11 @@ dependencies = [ "comma", "crossbeam-channel", "indicatif", - "lazy_static", "levenshtein", - "prettydiff 0.7.0", + "prettydiff", "regex", "rustc_version", - "rustfix 0.8.1", + "rustfix", "serde", "serde_json", "spanned", diff --git a/compiler/rustc_fluent_macro/src/fluent.rs b/compiler/rustc_fluent_macro/src/fluent.rs index ca8bace28f3d1..37e610a85a64b 100644 --- a/compiler/rustc_fluent_macro/src/fluent.rs +++ b/compiler/rustc_fluent_macro/src/fluent.rs @@ -138,25 +138,8 @@ pub(crate) fn fluent_messages(input: proc_macro::TokenStream) -> proc_macro::Tok // with a lowercase as rustc errors do. err.replace_range(0..1, &err.chars().next().unwrap().to_lowercase().to_string()); - let line_starts: Vec = std::iter::once(0) - .chain( - this.source() - .char_indices() - .filter_map(|(i, c)| Some(i + 1).filter(|_| c == '\n')), - ) - .collect(); - let line_start = line_starts - .iter() - .enumerate() - .map(|(line, idx)| (line + 1, idx)) - .filter(|(_, idx)| **idx <= pos.start) - .last() - .unwrap() - .0; - let message = annotate_snippets::Level::Error.title(&err).snippet( Snippet::source(this.source()) - .line_start(line_start) .origin(&relative_ftl_path) .fold(true) .annotation(annotate_snippets::Level::Error.span(pos.start..pos.end - 1)), diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp index 74d9e02cc2f52..4a4ba165b574e 100644 --- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp @@ -1211,11 +1211,7 @@ struct LLVMRustThinLTOData { // Not 100% sure what these are, but they impact what's internalized and // what's inlined across modules, I believe. #if LLVM_VERSION_GE(18, 0) -#if LLVM_VERSION_GE(20, 0) - FunctionImporter::ImportListsTy ImportLists; -#else DenseMap ImportLists; -#endif DenseMap ExportLists; DenseMap ModuleToDefinedGVSummaries; #else @@ -1424,13 +1420,13 @@ LLVMRustPrepareThinLTOInternalize(const LLVMRustThinLTOData *Data, return true; } -extern "C" bool LLVMRustPrepareThinLTOImport(LLVMRustThinLTOData *Data, +extern "C" bool LLVMRustPrepareThinLTOImport(const LLVMRustThinLTOData *Data, LLVMModuleRef M, LLVMTargetMachineRef TM) { Module &Mod = *unwrap(M); TargetMachine &Target = *unwrap(TM); - const auto &ImportList = Data->ImportLists[Mod.getModuleIdentifier()]; + const auto &ImportList = Data->ImportLists.lookup(Mod.getModuleIdentifier()); auto Loader = [&](StringRef Identifier) { const auto &Memory = Data->ModuleMap.lookup(Identifier); auto &Context = Mod.getContext(); @@ -1613,7 +1609,7 @@ extern "C" void LLVMRustComputeLTOCacheKey(RustStringRef KeyOut, LLVMRustThinLTOData *Data) { SmallString<40> Key; llvm::lto::Config conf; - const auto &ImportList = Data->ImportLists[ModId]; + const auto &ImportList = Data->ImportLists.lookup(ModId); const auto &ExportList = Data->ExportLists.lookup(ModId); const auto &ResolvedODR = Data->ResolvedODR.lookup(ModId); const auto &DefinedGlobals = Data->ModuleToDefinedGVSummaries.lookup(ModId); diff --git a/library/alloc/src/rc.rs b/library/alloc/src/rc.rs index 88c7a12db23ca..b9a92749aaea8 100644 --- a/library/alloc/src/rc.rs +++ b/library/alloc/src/rc.rs @@ -460,42 +460,7 @@ impl Rc { where F: FnOnce(&Weak) -> T, { - // Construct the inner in the "uninitialized" state with a single - // weak reference. - let uninit_ptr: NonNull<_> = Box::leak(Box::new(RcBox { - strong: Cell::new(0), - weak: Cell::new(1), - value: mem::MaybeUninit::::uninit(), - })) - .into(); - - let init_ptr: NonNull> = uninit_ptr.cast(); - - let weak = Weak { ptr: init_ptr, alloc: Global }; - - // It's important we don't give up ownership of the weak pointer, or - // else the memory might be freed by the time `data_fn` returns. If - // we really wanted to pass ownership, we could create an additional - // weak pointer for ourselves, but this would result in additional - // updates to the weak reference count which might not be necessary - // otherwise. - let data = data_fn(&weak); - - let strong = unsafe { - let inner = init_ptr.as_ptr(); - ptr::write(ptr::addr_of_mut!((*inner).value), data); - - let prev_value = (*inner).strong.get(); - debug_assert_eq!(prev_value, 0, "No prior strong references should exist"); - (*inner).strong.set(1); - - Rc::from_inner(init_ptr) - }; - - // Strong references should collectively own a shared weak reference, - // so don't run the destructor for our old weak reference. - mem::forget(weak); - strong + Self::new_cyclic_in(data_fn, Global) } /// Constructs a new `Rc` with uninitialized contents. @@ -762,6 +727,84 @@ impl Rc { } } + /// Constructs a new `Rc` in the given allocator while giving you a `Weak` to the allocation, + /// to allow you to construct a `T` which holds a weak pointer to itself. + /// + /// Generally, a structure circularly referencing itself, either directly or + /// indirectly, should not hold a strong reference to itself to prevent a memory leak. + /// Using this function, you get access to the weak pointer during the + /// initialization of `T`, before the `Rc` is created, such that you can + /// clone and store it inside the `T`. + /// + /// `new_cyclic_in` first allocates the managed allocation for the `Rc`, + /// then calls your closure, giving it a `Weak` to this allocation, + /// and only afterwards completes the construction of the `Rc` by placing + /// the `T` returned from your closure into the allocation. + /// + /// Since the new `Rc` is not fully-constructed until `Rc::new_cyclic_in` + /// returns, calling [`upgrade`] on the weak reference inside your closure will + /// fail and result in a `None` value. + /// + /// # Panics + /// + /// If `data_fn` panics, the panic is propagated to the caller, and the + /// temporary [`Weak`] is dropped normally. + /// + /// # Examples + /// + /// See [`new_cyclic`]. + /// + /// [`new_cyclic`]: Rc::new_cyclic + /// [`upgrade`]: Weak::upgrade + #[cfg(not(no_global_oom_handling))] + #[unstable(feature = "allocator_api", issue = "32838")] + pub fn new_cyclic_in(data_fn: F, alloc: A) -> Rc + where + F: FnOnce(&Weak) -> T, + { + // Construct the inner in the "uninitialized" state with a single + // weak reference. + let (uninit_raw_ptr, alloc) = Box::into_raw_with_allocator(Box::new_in( + RcBox { + strong: Cell::new(0), + weak: Cell::new(1), + value: mem::MaybeUninit::::uninit(), + }, + alloc, + )); + let uninit_ptr: NonNull<_> = (unsafe { &mut *uninit_raw_ptr }).into(); + let init_ptr: NonNull> = uninit_ptr.cast(); + + let weak = Weak { ptr: init_ptr, alloc: alloc }; + + // It's important we don't give up ownership of the weak pointer, or + // else the memory might be freed by the time `data_fn` returns. If + // we really wanted to pass ownership, we could create an additional + // weak pointer for ourselves, but this would result in additional + // updates to the weak reference count which might not be necessary + // otherwise. + let data = data_fn(&weak); + + let strong = unsafe { + let inner = init_ptr.as_ptr(); + ptr::write(ptr::addr_of_mut!((*inner).value), data); + + let prev_value = (*inner).strong.get(); + debug_assert_eq!(prev_value, 0, "No prior strong references should exist"); + (*inner).strong.set(1); + + // Strong references should collectively own a shared weak reference, + // so don't run the destructor for our old weak reference. + // Calling into_raw_with_allocator has the double effect of giving us back the allocator, + // and forgetting the weak reference. + let alloc = weak.into_raw_with_allocator().1; + + Rc::from_inner_in(init_ptr, alloc) + }; + + strong + } + /// Constructs a new `Rc` in the provided allocator, returning an error if the allocation /// fails /// diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs index 43684f31cb723..4d4e84bfda587 100644 --- a/library/alloc/src/sync.rs +++ b/library/alloc/src/sync.rs @@ -450,54 +450,7 @@ impl Arc { where F: FnOnce(&Weak) -> T, { - // Construct the inner in the "uninitialized" state with a single - // weak reference. - let uninit_ptr: NonNull<_> = Box::leak(Box::new(ArcInner { - strong: atomic::AtomicUsize::new(0), - weak: atomic::AtomicUsize::new(1), - data: mem::MaybeUninit::::uninit(), - })) - .into(); - let init_ptr: NonNull> = uninit_ptr.cast(); - - let weak = Weak { ptr: init_ptr, alloc: Global }; - - // It's important we don't give up ownership of the weak pointer, or - // else the memory might be freed by the time `data_fn` returns. If - // we really wanted to pass ownership, we could create an additional - // weak pointer for ourselves, but this would result in additional - // updates to the weak reference count which might not be necessary - // otherwise. - let data = data_fn(&weak); - - // Now we can properly initialize the inner value and turn our weak - // reference into a strong reference. - let strong = unsafe { - let inner = init_ptr.as_ptr(); - ptr::write(ptr::addr_of_mut!((*inner).data), data); - - // The above write to the data field must be visible to any threads which - // observe a non-zero strong count. Therefore we need at least "Release" ordering - // in order to synchronize with the `compare_exchange_weak` in `Weak::upgrade`. - // - // "Acquire" ordering is not required. When considering the possible behaviours - // of `data_fn` we only need to look at what it could do with a reference to a - // non-upgradeable `Weak`: - // - It can *clone* the `Weak`, increasing the weak reference count. - // - It can drop those clones, decreasing the weak reference count (but never to zero). - // - // These side effects do not impact us in any way, and no other side effects are - // possible with safe code alone. - let prev_value = (*inner).strong.fetch_add(1, Release); - debug_assert_eq!(prev_value, 0, "No prior strong references should exist"); - - Arc::from_inner(init_ptr) - }; - - // Strong references should collectively own a shared weak reference, - // so don't run the destructor for our old weak reference. - mem::forget(weak); - strong + Self::new_cyclic_in(data_fn, Global) } /// Constructs a new `Arc` with uninitialized contents. @@ -781,6 +734,98 @@ impl Arc { } } + /// Constructs a new `Arc` in the given allocator while giving you a `Weak` to the allocation, + /// to allow you to construct a `T` which holds a weak pointer to itself. + /// + /// Generally, a structure circularly referencing itself, either directly or + /// indirectly, should not hold a strong reference to itself to prevent a memory leak. + /// Using this function, you get access to the weak pointer during the + /// initialization of `T`, before the `Arc` is created, such that you can + /// clone and store it inside the `T`. + /// + /// `new_cyclic_in` first allocates the managed allocation for the `Arc`, + /// then calls your closure, giving it a `Weak` to this allocation, + /// and only afterwards completes the construction of the `Arc` by placing + /// the `T` returned from your closure into the allocation. + /// + /// Since the new `Arc` is not fully-constructed until `Arc::new_cyclic_in` + /// returns, calling [`upgrade`] on the weak reference inside your closure will + /// fail and result in a `None` value. + /// + /// # Panics + /// + /// If `data_fn` panics, the panic is propagated to the caller, and the + /// temporary [`Weak`] is dropped normally. + /// + /// # Example + /// + /// See [`new_cyclic`] + /// + /// [`new_cyclic`]: Arc::new_cyclic + /// [`upgrade`]: Weak::upgrade + #[cfg(not(no_global_oom_handling))] + #[inline] + #[unstable(feature = "allocator_api", issue = "32838")] + pub fn new_cyclic_in(data_fn: F, alloc: A) -> Arc + where + F: FnOnce(&Weak) -> T, + { + // Construct the inner in the "uninitialized" state with a single + // weak reference. + let (uninit_raw_ptr, alloc) = Box::into_raw_with_allocator(Box::new_in( + ArcInner { + strong: atomic::AtomicUsize::new(0), + weak: atomic::AtomicUsize::new(1), + data: mem::MaybeUninit::::uninit(), + }, + alloc, + )); + let uninit_ptr: NonNull<_> = (unsafe { &mut *uninit_raw_ptr }).into(); + let init_ptr: NonNull> = uninit_ptr.cast(); + + let weak = Weak { ptr: init_ptr, alloc: alloc }; + + // It's important we don't give up ownership of the weak pointer, or + // else the memory might be freed by the time `data_fn` returns. If + // we really wanted to pass ownership, we could create an additional + // weak pointer for ourselves, but this would result in additional + // updates to the weak reference count which might not be necessary + // otherwise. + let data = data_fn(&weak); + + // Now we can properly initialize the inner value and turn our weak + // reference into a strong reference. + let strong = unsafe { + let inner = init_ptr.as_ptr(); + ptr::write(ptr::addr_of_mut!((*inner).data), data); + + // The above write to the data field must be visible to any threads which + // observe a non-zero strong count. Therefore we need at least "Release" ordering + // in order to synchronize with the `compare_exchange_weak` in `Weak::upgrade`. + // + // "Acquire" ordering is not required. When considering the possible behaviours + // of `data_fn` we only need to look at what it could do with a reference to a + // non-upgradeable `Weak`: + // - It can *clone* the `Weak`, increasing the weak reference count. + // - It can drop those clones, decreasing the weak reference count (but never to zero). + // + // These side effects do not impact us in any way, and no other side effects are + // possible with safe code alone. + let prev_value = (*inner).strong.fetch_add(1, Release); + debug_assert_eq!(prev_value, 0, "No prior strong references should exist"); + + // Strong references should collectively own a shared weak reference, + // so don't run the destructor for our old weak reference. + // Calling into_raw_with_allocator has the double effect of giving us back the allocator, + // and forgetting the weak reference. + let alloc = weak.into_raw_with_allocator().1; + + Arc::from_inner_in(init_ptr, alloc) + }; + + strong + } + /// Constructs a new `Pin>` in the provided allocator. If `T` does not implement `Unpin`, /// then `data` will be pinned in memory and unable to be moved. #[cfg(not(no_global_oom_handling))] diff --git a/src/doc/rustc/src/platform-support/trusty.md b/src/doc/rustc/src/platform-support/trusty.md index dec3b96ff6449..6b37543b600a7 100644 --- a/src/doc/rustc/src/platform-support/trusty.md +++ b/src/doc/rustc/src/platform-support/trusty.md @@ -8,7 +8,8 @@ Environment (TEE) for Android. ## Target maintainers - Nicole LeGare (@randomPoison) -- Stephen Crane (@rinon) +- Andrei Homescu (@ahomescu) +- Chris Wailes (chriswailes@google.com) - As a fallback trusty-dev-team@google.com can be contacted ## Requirements diff --git a/src/tools/miri/.github/workflows/sysroots.yml b/src/tools/miri/.github/workflows/sysroots.yml index 73a10768db908..6a4f44ddd507a 100644 --- a/src/tools/miri/.github/workflows/sysroots.yml +++ b/src/tools/miri/.github/workflows/sysroots.yml @@ -13,7 +13,7 @@ jobs: name: Build the sysroots runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build the sysroots run: | cargo install -f rustup-toolchain-install-master diff --git a/src/tools/miri/Cargo.lock b/src/tools/miri/Cargo.lock index e4bfd9bd12282..002c44b0cc56f 100644 --- a/src/tools/miri/Cargo.lock +++ b/src/tools/miri/Cargo.lock @@ -39,22 +39,19 @@ dependencies = [ [[package]] name = "annotate-snippets" -version = "0.9.2" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccaf7e9dfbb6ab22c82e473cd1a8a7bd313c19a5b7e40970f3d89ef5a5c9e81e" +checksum = "24e35ed54e5ea7997c14ed4c70ba043478db1112e98263b3b035907aa197d991" dependencies = [ + "anstyle", "unicode-width", - "yansi-term", ] [[package]] -name = "ansi_term" -version = "0.12.1" +name = "anstyle" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -dependencies = [ - "winapi", -] +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" [[package]] name = "anyhow" @@ -126,9 +123,9 @@ dependencies = [ [[package]] name = "cargo_metadata" -version = "0.15.4" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" +checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", @@ -737,11 +734,11 @@ dependencies = [ [[package]] name = "prettydiff" -version = "0.6.4" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ff1fec61082821f8236cf6c0c14e8172b62ce8a72a0eedc30d3b247bb68dc11" +checksum = "abec3fb083c10660b3854367697da94c674e9e82aa7511014dc958beeb7215e9" dependencies = [ - "ansi_term", + "owo-colors", "pad", ] @@ -865,14 +862,14 @@ dependencies = [ [[package]] name = "rustfix" -version = "0.6.1" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd2853d9e26988467753bd9912c3a126f642d05d229a4b53f5752ee36c56481" +checksum = "70f5b7fc8060f4f8373f9381a630304b42e1183535d9beb1d3f596b236c9106a" dependencies = [ - "anyhow", - "log", "serde", "serde_json", + "thiserror", + "tracing", ] [[package]] @@ -962,6 +959,16 @@ version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +[[package]] +name = "spanned" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86af297923fbcfd107c20a189a6e9c872160df71a7190ae4a7a6c5dce4b2feb6" +dependencies = [ + "bstr", + "color-eyre", +] + [[package]] name = "syn" version = "2.0.72" @@ -1065,9 +1072,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ui_test" -version = "0.21.2" +version = "0.26.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaf4bf7c184b8dfc7a4d3b90df789b1eb992ee42811cd115f32a7a1eb781058d" +checksum = "32ee4c40e5a5f9fa6864ff976473e5d6a6e9884b6ce68b40690d9f87e1994c83" dependencies = [ "annotate-snippets", "anyhow", @@ -1079,7 +1086,6 @@ dependencies = [ "comma", "crossbeam-channel", "indicatif", - "lazy_static", "levenshtein", "prettydiff", "regex", @@ -1087,7 +1093,7 @@ dependencies = [ "rustfix", "serde", "serde_json", - "tempfile", + "spanned", ] [[package]] @@ -1120,28 +1126,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - [[package]] name = "windows-sys" version = "0.48.0" @@ -1281,15 +1265,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" -[[package]] -name = "yansi-term" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe5c30ade05e61656247b2e334a031dfd0cc466fadef865bdcdea8d537951bf1" -dependencies = [ - "winapi", -] - [[package]] name = "zerocopy" version = "0.7.35" diff --git a/src/tools/miri/Cargo.toml b/src/tools/miri/Cargo.toml index d8cfa5b886dad..30cea9da3732c 100644 --- a/src/tools/miri/Cargo.toml +++ b/src/tools/miri/Cargo.toml @@ -49,7 +49,7 @@ windows-sys = { version = "0.52", features = [ [dev-dependencies] colored = "2" -ui_test = "0.21.1" +ui_test = "0.26.5" rustc_version = "0.4" regex = "1.5.5" tempfile = "3" diff --git a/src/tools/miri/README.md b/src/tools/miri/README.md index dbb0e8a2925b3..d8636915ea80e 100644 --- a/src/tools/miri/README.md +++ b/src/tools/miri/README.md @@ -187,7 +187,7 @@ Here is an example job for GitHub Actions: name: "Miri" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Miri run: | rustup toolchain install nightly --component miri @@ -216,9 +216,9 @@ degree documented below): - For every other target with OS `linux`, `macos`, or `windows`, Miri should generally work, but we make no promises and we don't run tests for such targets. - We have unofficial support (not maintained by the Miri team itself) for some further operating systems. + - `solaris` / `illumos`: maintained by @devnexen. Supports `std::{env, thread, sync}`, but not `std::fs`. - `freebsd`: **maintainer wanted**. Supports `std::env` and parts of `std::{thread, fs}`, but not `std::sync`. - `android`: **maintainer wanted**. Support very incomplete, but a basic "hello world" works. - - `solaris` / `illumos`: maintained by @devnexen. Support very incomplete, but a basic "hello world" works. - `wasm`: **maintainer wanted**. Support very incomplete, not even standard output works, but an empty `main` function works. - For targets on other operating systems, Miri might fail before even reaching the `main` function. diff --git a/src/tools/miri/ci/ci.sh b/src/tools/miri/ci/ci.sh index 1f66b6fa776d9..c7be71662bd5f 100755 --- a/src/tools/miri/ci/ci.sh +++ b/src/tools/miri/ci/ci.sh @@ -26,7 +26,7 @@ time ./miri install # We enable all features to make sure the Stacked Borrows consistency check runs. echo "Building debug version of Miri" export CARGO_EXTRA_FLAGS="$CARGO_EXTRA_FLAGS --all-features" -time ./miri build --all-targets # the build that all the `./miri test` below will use +time ./miri build # the build that all the `./miri test` below will use endgroup @@ -66,7 +66,7 @@ function run_tests { time MIRIFLAGS="${MIRIFLAGS-} -O -Zmir-opt-level=4 -Cdebug-assertions=yes" MIRI_SKIP_UI_CHECKS=1 ./miri test $TARGET_FLAG tests/{pass,panic} fi if [ -n "${MANY_SEEDS-}" ]; then - # Also run some many-seeds tests. + # Also run some many-seeds tests. (Also tests `./miri run`.) time for FILE in tests/many-seeds/*.rs; do ./miri run "--many-seeds=0..$MANY_SEEDS" $TARGET_FLAG "$FILE" done @@ -75,6 +75,8 @@ function run_tests { # Check that the benchmarks build and run, but only once. time HYPERFINE="hyperfine -w0 -r1" ./miri bench $TARGET_FLAG fi + # Smoke-test `./miri run --dep`. + ./miri run $TARGET_FLAG --dep tests/pass-dep/getrandom.rs ## test-cargo-miri # On Windows, there is always "python", not "python3" or "python2". @@ -148,11 +150,11 @@ case $HOST_TARGET in # Partially supported targets (tier 2) BASIC="empty_main integer vec string btreemap hello hashmap heap_alloc align" # ensures we have the basics: stdout/stderr, system allocator, randomness (for HashMap initialization) UNIX="panic/panic panic/unwind concurrency/simple atomic libc-mem libc-misc libc-random env num_cpus" # the things that are very similar across all Unixes, and hence easily supported there - TEST_TARGET=x86_64-unknown-freebsd run_tests_minimal $BASIC $UNIX threadname libc-time fs - TEST_TARGET=i686-unknown-freebsd run_tests_minimal $BASIC $UNIX threadname libc-time fs - TEST_TARGET=x86_64-unknown-illumos run_tests_minimal $BASIC $UNIX threadname pthread-sync available-parallelism libc-time tls - TEST_TARGET=x86_64-pc-solaris run_tests_minimal $BASIC $UNIX threadname pthread-sync available-parallelism libc-time tls - TEST_TARGET=aarch64-linux-android run_tests_minimal $BASIC $UNIX + TEST_TARGET=x86_64-unknown-freebsd run_tests_minimal $BASIC $UNIX threadname pthread time fs + TEST_TARGET=i686-unknown-freebsd run_tests_minimal $BASIC $UNIX threadname pthread time fs + TEST_TARGET=x86_64-unknown-illumos run_tests_minimal $BASIC $UNIX thread sync available-parallelism time tls + TEST_TARGET=x86_64-pc-solaris run_tests_minimal $BASIC $UNIX thread sync available-parallelism time tls + TEST_TARGET=aarch64-linux-android run_tests_minimal $BASIC $UNIX pthread --skip threadname --skip pthread_cond_timedwait TEST_TARGET=wasm32-wasip2 run_tests_minimal empty_main wasm heap_alloc libc-mem TEST_TARGET=wasm32-unknown-unknown run_tests_minimal empty_main wasm TEST_TARGET=thumbv7em-none-eabihf run_tests_minimal no_std diff --git a/src/tools/miri/miri-script/Cargo.lock b/src/tools/miri/miri-script/Cargo.lock index 5e792abac175d..8f19576c51db2 100644 --- a/src/tools/miri/miri-script/Cargo.lock +++ b/src/tools/miri/miri-script/Cargo.lock @@ -61,9 +61,9 @@ checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -98,6 +98,12 @@ dependencies = [ "either", ] +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + [[package]] name = "libc" version = "0.2.153" @@ -117,9 +123,15 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "miri-script" @@ -131,6 +143,7 @@ dependencies = [ "itertools", "path_macro", "rustc_version", + "serde_json", "shell-words", "walkdir", "which", @@ -204,9 +217,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.31" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ "bitflags 2.4.2", "errno", @@ -215,6 +228,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + [[package]] name = "same-file" version = "1.0.6" @@ -230,6 +249,38 @@ version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +[[package]] +name = "serde" +version = "1.0.210" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.210" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.128" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + [[package]] name = "shell-words" version = "1.1.0" @@ -347,7 +398,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.3", + "windows-targets 0.52.6", ] [[package]] @@ -367,17 +418,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.3" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d380ba1dc7187569a8a9e91ed34b8ccfc33123bbacb8c0aed2d1ad7f3ef2dc5f" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.3", - "windows_aarch64_msvc 0.52.3", - "windows_i686_gnu 0.52.3", - "windows_i686_msvc 0.52.3", - "windows_x86_64_gnu 0.52.3", - "windows_x86_64_gnullvm 0.52.3", - "windows_x86_64_msvc 0.52.3", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -388,9 +440,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.3" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68e5dcfb9413f53afd9c8f86e56a7b4d86d9a2fa26090ea2dc9e40fba56c6ec6" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -400,9 +452,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.3" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dab469ebbc45798319e69eebf92308e541ce46760b49b18c6b3fe5e8965b30f" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -412,9 +464,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.3" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a4e9b6a7cac734a8b4138a4e1044eac3404d8326b6c0f939276560687a033fb" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -424,9 +482,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.3" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b0ec9c422ca95ff34a78755cfa6ad4a51371da2a5ace67500cf7ca5f232c58" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -436,9 +494,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.3" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "704131571ba93e89d7cd43482277d6632589b18ecf4468f591fbae0a8b101614" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -448,9 +506,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.3" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42079295511643151e98d61c38c0acc444e52dd42ab456f7ccfd5152e8ecf21c" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -460,9 +518,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.3" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0770833d60a970638e989b3fa9fd2bb1aaadcf88963d1659fd7d9990196ed2d6" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "xshell" diff --git a/src/tools/miri/miri-script/Cargo.toml b/src/tools/miri/miri-script/Cargo.toml index 631d3a82102b5..2922c24d6c09c 100644 --- a/src/tools/miri/miri-script/Cargo.toml +++ b/src/tools/miri/miri-script/Cargo.toml @@ -23,3 +23,4 @@ xshell = "0.2.6" rustc_version = "0.4" dunce = "1.0.4" directories = "5" +serde_json = "1" diff --git a/src/tools/miri/miri-script/src/commands.rs b/src/tools/miri/miri-script/src/commands.rs index a9a8017590117..b18c8453d661e 100644 --- a/src/tools/miri/miri-script/src/commands.rs +++ b/src/tools/miri/miri-script/src/commands.rs @@ -494,23 +494,25 @@ impl Command { flags: Vec, ) -> Result<()> { let mut e = MiriEnv::new()?; + + // Preparation: get a sysroot, and get the miri binary. + let miri_sysroot = e.build_miri_sysroot(/* quiet */ !verbose, target.as_deref())?; + let miri_bin = + e.build_get_binary(".").context("failed to get filename of miri executable")?; + // More flags that we will pass before `flags` // (because `flags` may contain `--`). let mut early_flags = Vec::::new(); - // Add target, edition to flags. - if let Some(target) = &target { - early_flags.push("--target".into()); - early_flags.push(target.into()); - } - if verbose { - early_flags.push("--verbose".into()); + // In `dep` mode, the target is already passed via `MIRI_TEST_TARGET` + if !dep { + if let Some(target) = &target { + early_flags.push("--target".into()); + early_flags.push(target.into()); + } } early_flags.push("--edition".into()); early_flags.push(edition.as_deref().unwrap_or("2021").into()); - - // Prepare a sysroot, add it to the flags. (Also builds cargo-miri, which we need.) - let miri_sysroot = e.build_miri_sysroot(/* quiet */ !verbose, target.as_deref())?; early_flags.push("--sysroot".into()); early_flags.push(miri_sysroot.into()); @@ -523,18 +525,19 @@ impl Command { let run_miri = |e: &MiriEnv, seed_flag: Option| -> Result<()> { // The basic command that executes the Miri driver. let mut cmd = if dep { + // We invoke the test suite as that has all the logic for running with dependencies. e.cargo_cmd(".", "test") .args(&["--test", "ui"]) .args(quiet_flag) .arg("--") .args(&["--miri-run-dep-mode"]) } else { - e.cargo_cmd(".", "run").args(quiet_flag).arg("--") + cmd!(e.sh, "{miri_bin}") }; cmd.set_quiet(!verbose); // Add Miri flags let mut cmd = cmd.args(&miri_flags).args(&seed_flag).args(&early_flags).args(&flags); - // For `--dep` we also need to set the env var. + // For `--dep` we also need to set the target in the env var. if dep { if let Some(target) = &target { cmd = cmd.env("MIRI_TEST_TARGET", target); diff --git a/src/tools/miri/miri-script/src/util.rs b/src/tools/miri/miri-script/src/util.rs index 35c604b407e1e..9d1a8e4fb1d5b 100644 --- a/src/tools/miri/miri-script/src/util.rs +++ b/src/tools/miri/miri-script/src/util.rs @@ -1,10 +1,11 @@ use std::ffi::{OsStr, OsString}; +use std::io::BufRead; use std::ops::Range; use std::path::{Path, PathBuf}; use std::sync::atomic::{AtomicBool, AtomicU32, Ordering}; -use std::thread; +use std::{env, iter, thread}; -use anyhow::{anyhow, Context, Result}; +use anyhow::{anyhow, bail, Context, Result}; use dunce::canonicalize; use path_macro::path; use xshell::{cmd, Cmd, Shell}; @@ -73,8 +74,11 @@ impl MiriEnv { let rustflags = { let mut flags = OsString::new(); // We set the rpath so that Miri finds the private rustc libraries it needs. - flags.push("-C link-args=-Wl,-rpath,"); - flags.push(libdir); + // (This only makes sense on Unix.) + if cfg!(unix) { + flags.push("-C link-args=-Wl,-rpath,"); + flags.push(&libdir); + } // Enable rustc-specific lints (ignored without `-Zunstable-options`). flags.push( " -Zunstable-options -Wrustc::internal -Wrust_2018_idioms -Wunused_lifetimes", @@ -88,6 +92,14 @@ impl MiriEnv { }; sh.set_var("RUSTFLAGS", rustflags); + // On Windows, the `-Wl,-rpath,` above does not help. Instead we add the libdir to the PATH, + // so that Windows can find the DLLs. + if cfg!(windows) { + let old_path = sh.var("PATH")?; + let new_path = env::join_paths(iter::once(libdir).chain(env::split_paths(&old_path)))?; + sh.set_var("PATH", new_path); + } + // Get extra flags for cargo. let cargo_extra_flags = std::env::var("CARGO_EXTRA_FLAGS").unwrap_or_default(); let cargo_extra_flags = flagsplit(&cargo_extra_flags); @@ -126,21 +138,40 @@ impl MiriEnv { pub fn build(&self, crate_dir: impl AsRef, args: &[String], quiet: bool) -> Result<()> { let quiet_flag = if quiet { Some("--quiet") } else { None }; - // We build the tests as well, (a) to avoid having rebuilds when building the tests later - // and (b) to have more parallelism during the build of Miri and its tests. - // This means `./miri run` without `--dep` will build Miri twice (for the sysroot with - // dev-dependencies, and then for running without dev-dependencies), but the way more common - // `./miri test` will avoid building Miri twice. - let mut cmd = self - .cargo_cmd(crate_dir, "build") - .args(&["--bins", "--tests"]) - .args(quiet_flag) - .args(args); + // We build all targets, since building *just* the bin target doesnot include + // `dev-dependencies` and that changes feature resolution. This also gets us more + // parallelism in `./miri test` as we build Miri and its tests together. + let mut cmd = + self.cargo_cmd(crate_dir, "build").args(&["--all-targets"]).args(quiet_flag).args(args); cmd.set_quiet(quiet); cmd.run()?; Ok(()) } + /// Returns the path to the main crate binary. Assumes that `build` has been called before. + pub fn build_get_binary(&self, crate_dir: impl AsRef) -> Result { + let cmd = + self.cargo_cmd(crate_dir, "build").args(&["--all-targets", "--message-format=json"]); + let output = cmd.output()?; + let mut bin = None; + for line in output.stdout.lines() { + let line = line?; + if line.starts_with("{") { + let json: serde_json::Value = serde_json::from_str(&line)?; + if json["reason"] == "compiler-artifact" + && !json["profile"]["test"].as_bool().unwrap() + && !json["executable"].is_null() + { + if bin.is_some() { + bail!("found two binaries in cargo output"); + } + bin = Some(PathBuf::from(json["executable"].as_str().unwrap())) + } + } + } + bin.ok_or_else(|| anyhow!("found no binary in cargo output")) + } + pub fn check(&self, crate_dir: impl AsRef, args: &[String]) -> Result<()> { self.cargo_cmd(crate_dir, "check").arg("--all-targets").args(args).run()?; Ok(()) diff --git a/src/tools/miri/rust-version b/src/tools/miri/rust-version index 3fdad2a91e9fc..3f4d095fc1961 100644 --- a/src/tools/miri/rust-version +++ b/src/tools/miri/rust-version @@ -1 +1 @@ -54fdef7799d9ff9470bb5cabd29fde9471a99eaa +e2dc1a1c0f97a90319181a721ab317210307617a diff --git a/src/tools/miri/src/concurrency/data_race.rs b/src/tools/miri/src/concurrency/data_race.rs index f686b331ad6c7..b5b43f589f699 100644 --- a/src/tools/miri/src/concurrency/data_race.rs +++ b/src/tools/miri/src/concurrency/data_race.rs @@ -1165,7 +1165,7 @@ impl FrameState { } else { // This can fail to exist if `race_detecting` was false when the allocation // occurred, in which case we can backdate this to the beginning of time. - let clocks = clocks.entry(local).or_insert_with(Default::default); + let clocks = clocks.entry(local).or_default(); clocks.write = thread_clocks.clock[index]; clocks.write_type = NaWriteType::Write; } @@ -1186,7 +1186,7 @@ impl FrameState { // This can fail to exist if `race_detecting` was false when the allocation // occurred, in which case we can backdate this to the beginning of time. let mut clocks = self.local_clocks.borrow_mut(); - let clocks = clocks.entry(local).or_insert_with(Default::default); + let clocks = clocks.entry(local).or_default(); clocks.read = thread_clocks.clock[index]; } diff --git a/src/tools/miri/src/concurrency/init_once.rs b/src/tools/miri/src/concurrency/init_once.rs index d709e4e6eaedb..9c2c6ae133023 100644 --- a/src/tools/miri/src/concurrency/init_once.rs +++ b/src/tools/miri/src/concurrency/init_once.rs @@ -1,7 +1,6 @@ use std::collections::VecDeque; use rustc_index::Idx; -use rustc_middle::ty::layout::TyAndLayout; use super::sync::EvalContextExtPriv as _; use super::vector_clock::VClock; @@ -30,14 +29,12 @@ impl<'tcx> EvalContextExt<'tcx> for crate::MiriInterpCx<'tcx> {} pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { fn init_once_get_or_create_id( &mut self, - lock_op: &OpTy<'tcx>, - lock_layout: TyAndLayout<'tcx>, + lock: &MPlaceTy<'tcx>, offset: u64, ) -> InterpResult<'tcx, InitOnceId> { let this = self.eval_context_mut(); this.get_or_create_id( - lock_op, - lock_layout, + lock, offset, |ecx| &mut ecx.machine.sync.init_onces, |_| Ok(Default::default()), diff --git a/src/tools/miri/src/concurrency/sync.rs b/src/tools/miri/src/concurrency/sync.rs index 97e910df6a2c0..1f910d885ca5a 100644 --- a/src/tools/miri/src/concurrency/sync.rs +++ b/src/tools/miri/src/concurrency/sync.rs @@ -1,10 +1,11 @@ +use std::any::Any; use std::collections::{hash_map::Entry, VecDeque}; use std::ops::Not; use std::time::Duration; use rustc_data_structures::fx::FxHashMap; use rustc_index::{Idx, IndexVec}; -use rustc_middle::ty::layout::TyAndLayout; +use rustc_target::abi::Size; use super::init_once::InitOnce; use super::vector_clock::VClock; @@ -66,27 +67,6 @@ pub(super) use declare_id; declare_id!(MutexId); -/// The mutex kind. -#[derive(Debug, Clone, Copy)] -#[non_exhaustive] -pub enum MutexKind { - Invalid, - Normal, - Default, - Recursive, - ErrorCheck, -} - -#[derive(Debug)] -/// Additional data that may be used by shim implementations. -pub struct AdditionalMutexData { - /// The mutex kind, used by some mutex implementations like pthreads mutexes. - pub kind: MutexKind, - - /// The address of the mutex. - pub address: u64, -} - /// The mutex state. #[derive(Default, Debug)] struct Mutex { @@ -100,7 +80,7 @@ struct Mutex { clock: VClock, /// Additional data that can be set by shim implementations. - data: Option, + data: Option>, } declare_id!(RwLockId); @@ -137,6 +117,9 @@ struct RwLock { /// locks. /// This is only relevant when there is an active reader. clock_current_readers: VClock, + + /// Additional data that can be set by shim implementations. + data: Option>, } declare_id!(CondvarId); @@ -151,6 +134,9 @@ struct Condvar { /// Contains the clock of the last thread to /// perform a condvar-signal. clock: VClock, + + /// Additional data that can be set by shim implementations. + data: Option>, } /// The futex state. @@ -196,21 +182,21 @@ pub(super) trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> { #[inline] fn get_or_create_id( &mut self, - lock_op: &OpTy<'tcx>, - lock_layout: TyAndLayout<'tcx>, + lock: &MPlaceTy<'tcx>, offset: u64, get_objs: impl for<'a> Fn(&'a mut MiriInterpCx<'tcx>) -> &'a mut IndexVec, create_obj: impl for<'a> FnOnce(&'a mut MiriInterpCx<'tcx>) -> InterpResult<'tcx, T>, ) -> InterpResult<'tcx, Option> { let this = self.eval_context_mut(); - let value_place = - this.deref_pointer_and_offset(lock_op, offset, lock_layout, this.machine.layouts.u32)?; + let offset = Size::from_bytes(offset); + assert!(lock.layout.size >= offset + this.machine.layouts.u32.size); + let id_place = lock.offset(offset, this.machine.layouts.u32, this)?; let next_index = get_objs(this).next_index(); // Since we are lazy, this update has to be atomic. let (old, success) = this .atomic_compare_exchange_scalar( - &value_place, + &id_place, &ImmTy::from_uint(0u32, this.machine.layouts.u32), Scalar::from_u32(next_index.to_u32()), AtomicRwOrd::Relaxed, // deliberately *no* synchronization @@ -248,18 +234,18 @@ pub(super) trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> { /// - `obj` must be the new sync object. fn create_id( &mut self, - lock_op: &OpTy<'tcx>, - lock_layout: TyAndLayout<'tcx>, + lock: &MPlaceTy<'tcx>, offset: u64, get_objs: impl for<'a> Fn(&'a mut MiriInterpCx<'tcx>) -> &'a mut IndexVec, obj: T, ) -> InterpResult<'tcx, Id> { let this = self.eval_context_mut(); - let value_place = - this.deref_pointer_and_offset(lock_op, offset, lock_layout, this.machine.layouts.u32)?; + let offset = Size::from_bytes(offset); + assert!(lock.layout.size >= offset + this.machine.layouts.u32.size); + let id_place = lock.offset(offset, this.machine.layouts.u32, this)?; let new_index = get_objs(this).push(obj); - this.write_scalar(Scalar::from_u32(new_index.to_u32()), &value_place)?; + this.write_scalar(Scalar::from_u32(new_index.to_u32()), &id_place)?; Ok(new_index) } @@ -292,15 +278,13 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { /// Eagerly create and initialize a new mutex. fn mutex_create( &mut self, - lock_op: &OpTy<'tcx>, - lock_layout: TyAndLayout<'tcx>, + lock: &MPlaceTy<'tcx>, offset: u64, - data: Option, + data: Option>, ) -> InterpResult<'tcx, MutexId> { let this = self.eval_context_mut(); this.create_id( - lock_op, - lock_layout, + lock, offset, |ecx| &mut ecx.machine.sync.mutexes, Mutex { data, ..Default::default() }, @@ -311,17 +295,15 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { /// `initialize_data` must return any additional data that a user wants to associate with the mutex. fn mutex_get_or_create_id( &mut self, - lock_op: &OpTy<'tcx>, - lock_layout: TyAndLayout<'tcx>, + lock: &MPlaceTy<'tcx>, offset: u64, initialize_data: impl for<'a> FnOnce( &'a mut MiriInterpCx<'tcx>, - ) -> InterpResult<'tcx, Option>, + ) -> InterpResult<'tcx, Option>>, ) -> InterpResult<'tcx, MutexId> { let this = self.eval_context_mut(); this.get_or_create_id( - lock_op, - lock_layout, + lock, offset, |ecx| &mut ecx.machine.sync.mutexes, |ecx| initialize_data(ecx).map(|data| Mutex { data, ..Default::default() }), @@ -330,48 +312,84 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { } /// Retrieve the additional data stored for a mutex. - fn mutex_get_data<'a>(&'a mut self, id: MutexId) -> Option<&'a AdditionalMutexData> + fn mutex_get_data<'a, T: 'static>(&'a mut self, id: MutexId) -> Option<&'a T> where 'tcx: 'a, { let this = self.eval_context_ref(); - this.machine.sync.mutexes[id].data.as_ref() + this.machine.sync.mutexes[id].data.as_deref().and_then(|p| p.downcast_ref::()) } fn rwlock_get_or_create_id( &mut self, - lock_op: &OpTy<'tcx>, - lock_layout: TyAndLayout<'tcx>, + lock: &MPlaceTy<'tcx>, offset: u64, + initialize_data: impl for<'a> FnOnce( + &'a mut MiriInterpCx<'tcx>, + ) -> InterpResult<'tcx, Option>>, ) -> InterpResult<'tcx, RwLockId> { let this = self.eval_context_mut(); this.get_or_create_id( - lock_op, - lock_layout, + lock, offset, |ecx| &mut ecx.machine.sync.rwlocks, - |_| Ok(Default::default()), + |ecx| initialize_data(ecx).map(|data| RwLock { data, ..Default::default() }), )? .ok_or_else(|| err_ub_format!("rwlock has invalid ID").into()) } + /// Retrieve the additional data stored for a rwlock. + fn rwlock_get_data<'a, T: 'static>(&'a mut self, id: RwLockId) -> Option<&'a T> + where + 'tcx: 'a, + { + let this = self.eval_context_ref(); + this.machine.sync.rwlocks[id].data.as_deref().and_then(|p| p.downcast_ref::()) + } + + /// Eagerly create and initialize a new condvar. + fn condvar_create( + &mut self, + condvar: &MPlaceTy<'tcx>, + offset: u64, + data: Option>, + ) -> InterpResult<'tcx, CondvarId> { + let this = self.eval_context_mut(); + this.create_id( + condvar, + offset, + |ecx| &mut ecx.machine.sync.condvars, + Condvar { data, ..Default::default() }, + ) + } + fn condvar_get_or_create_id( &mut self, - lock_op: &OpTy<'tcx>, - lock_layout: TyAndLayout<'tcx>, + lock: &MPlaceTy<'tcx>, offset: u64, + initialize_data: impl for<'a> FnOnce( + &'a mut MiriInterpCx<'tcx>, + ) -> InterpResult<'tcx, Option>>, ) -> InterpResult<'tcx, CondvarId> { let this = self.eval_context_mut(); this.get_or_create_id( - lock_op, - lock_layout, + lock, offset, |ecx| &mut ecx.machine.sync.condvars, - |_| Ok(Default::default()), + |ecx| initialize_data(ecx).map(|data| Condvar { data, ..Default::default() }), )? .ok_or_else(|| err_ub_format!("condvar has invalid ID").into()) } + /// Retrieve the additional data stored for a condvar. + fn condvar_get_data<'a, T: 'static>(&'a mut self, id: CondvarId) -> Option<&'a T> + where + 'tcx: 'a, + { + let this = self.eval_context_ref(); + this.machine.sync.condvars[id].data.as_deref().and_then(|p| p.downcast_ref::()) + } + #[inline] /// Get the id of the thread that currently owns this lock. fn mutex_get_owner(&mut self, id: MutexId) -> ThreadId { diff --git a/src/tools/miri/src/lib.rs b/src/tools/miri/src/lib.rs index 85b4b02ff5f53..8a59206943d18 100644 --- a/src/tools/miri/src/lib.rs +++ b/src/tools/miri/src/lib.rs @@ -133,10 +133,7 @@ pub use crate::concurrency::{ cpu_affinity::MAX_CPUS, data_race::{AtomicFenceOrd, AtomicReadOrd, AtomicRwOrd, AtomicWriteOrd, EvalContextExt as _}, init_once::{EvalContextExt as _, InitOnceId}, - sync::{ - AdditionalMutexData, CondvarId, EvalContextExt as _, MutexId, MutexKind, RwLockId, - SynchronizationObjects, - }, + sync::{CondvarId, EvalContextExt as _, MutexId, RwLockId, SynchronizationObjects}, thread::{ BlockReason, EvalContextExt as _, StackEmptyCallback, ThreadId, ThreadManager, TimeoutAnchor, TimeoutClock, UnblockCallback, diff --git a/src/tools/miri/src/machine.rs b/src/tools/miri/src/machine.rs index c2b0aedbde1fc..bde94cec87f8d 100644 --- a/src/tools/miri/src/machine.rs +++ b/src/tools/miri/src/machine.rs @@ -602,12 +602,8 @@ impl<'tcx> MiriMachine<'tcx> { let layouts = PrimitiveLayouts::new(layout_cx).expect("Couldn't get layouts of primitive types"); let profiler = config.measureme_out.as_ref().map(|out| { - let crate_name = tcx - .sess - .opts - .crate_name - .clone() - .unwrap_or_else(|| "unknown-crate".to_string()); + let crate_name = + tcx.sess.opts.crate_name.clone().unwrap_or_else(|| "unknown-crate".to_string()); let pid = process::id(); // We adopt the same naming scheme for the profiler output that rustc uses. In rustc, // the PID is padded so that the nondeterministic value of the PID does not spread diff --git a/src/tools/miri/src/shims/unix/fd.rs b/src/tools/miri/src/shims/unix/fd.rs index 3ca5f6bb2dff5..48bf959538b4f 100644 --- a/src/tools/miri/src/shims/unix/fd.rs +++ b/src/tools/miri/src/shims/unix/fd.rs @@ -21,7 +21,7 @@ pub(crate) enum FlockOp { Unlock, } -/// Represents an open file descriptor. +/// Represents an open file description. pub trait FileDescription: std::fmt::Debug + Any { fn name(&self) -> &'static str; @@ -303,7 +303,7 @@ pub struct FdTable { impl VisitProvenance for FdTable { fn visit_provenance(&self, _visit: &mut VisitWith<'_>) { - // All our FileDescriptor do not have any tags. + // All our FileDescription instances do not have any tags. } } @@ -337,18 +337,18 @@ impl FdTable { } pub fn insert(&mut self, fd_ref: FileDescriptionRef) -> i32 { - self.insert_ref_with_min_fd(fd_ref, 0) + self.insert_with_min_num(fd_ref, 0) } - /// Insert a file description, giving it a file descriptor that is at least `min_fd`. - fn insert_ref_with_min_fd(&mut self, file_handle: FileDescriptionRef, min_fd: i32) -> i32 { + /// Insert a file description, giving it a file descriptor that is at least `min_fd_num`. + fn insert_with_min_num(&mut self, file_handle: FileDescriptionRef, min_fd_num: i32) -> i32 { // Find the lowest unused FD, starting from min_fd. If the first such unused FD is in // between used FDs, the find_map combinator will return it. If the first such unused FD // is after all other used FDs, the find_map combinator will return None, and we will use // the FD following the greatest FD thus far. let candidate_new_fd = - self.fds.range(min_fd..).zip(min_fd..).find_map(|((fd, _fh), counter)| { - if *fd != counter { + self.fds.range(min_fd_num..).zip(min_fd_num..).find_map(|((fd_num, _fd), counter)| { + if *fd_num != counter { // There was a gap in the fds stored, return the first unused one // (note that this relies on BTreeMap iterating in key order) Some(counter) @@ -357,61 +357,61 @@ impl FdTable { None } }); - let new_fd = candidate_new_fd.unwrap_or_else(|| { + let new_fd_num = candidate_new_fd.unwrap_or_else(|| { // find_map ran out of BTreeMap entries before finding a free fd, use one plus the // maximum fd in the map - self.fds.last_key_value().map(|(fd, _)| fd.strict_add(1)).unwrap_or(min_fd) + self.fds.last_key_value().map(|(fd_num, _)| fd_num.strict_add(1)).unwrap_or(min_fd_num) }); - self.fds.try_insert(new_fd, file_handle).unwrap(); - new_fd + self.fds.try_insert(new_fd_num, file_handle).unwrap(); + new_fd_num } - pub fn get(&self, fd: i32) -> Option { - let fd = self.fds.get(&fd)?; + pub fn get(&self, fd_num: i32) -> Option { + let fd = self.fds.get(&fd_num)?; Some(fd.clone()) } - pub fn remove(&mut self, fd: i32) -> Option { - self.fds.remove(&fd) + pub fn remove(&mut self, fd_num: i32) -> Option { + self.fds.remove(&fd_num) } - pub fn is_fd(&self, fd: i32) -> bool { - self.fds.contains_key(&fd) + pub fn is_fd_num(&self, fd_num: i32) -> bool { + self.fds.contains_key(&fd_num) } } impl<'tcx> EvalContextExt<'tcx> for crate::MiriInterpCx<'tcx> {} pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { - fn dup(&mut self, old_fd: i32) -> InterpResult<'tcx, Scalar> { + fn dup(&mut self, old_fd_num: i32) -> InterpResult<'tcx, Scalar> { let this = self.eval_context_mut(); - let Some(dup_fd) = this.machine.fds.get(old_fd) else { + let Some(fd) = this.machine.fds.get(old_fd_num) else { return Ok(Scalar::from_i32(this.fd_not_found()?)); }; - Ok(Scalar::from_i32(this.machine.fds.insert_ref_with_min_fd(dup_fd, 0))) + Ok(Scalar::from_i32(this.machine.fds.insert(fd))) } - fn dup2(&mut self, old_fd: i32, new_fd: i32) -> InterpResult<'tcx, Scalar> { + fn dup2(&mut self, old_fd_num: i32, new_fd_num: i32) -> InterpResult<'tcx, Scalar> { let this = self.eval_context_mut(); - let Some(dup_fd) = this.machine.fds.get(old_fd) else { + let Some(fd) = this.machine.fds.get(old_fd_num) else { return Ok(Scalar::from_i32(this.fd_not_found()?)); }; - if new_fd != old_fd { + if new_fd_num != old_fd_num { // Close new_fd if it is previously opened. // If old_fd and new_fd point to the same description, then `dup_fd` ensures we keep the underlying file description alive. - if let Some(file_description) = this.machine.fds.fds.insert(new_fd, dup_fd) { + if let Some(old_new_fd) = this.machine.fds.fds.insert(new_fd_num, fd) { // Ignore close error (not interpreter's) according to dup2() doc. - file_description.close(this.machine.communicate(), this)?.ok(); + old_new_fd.close(this.machine.communicate(), this)?.ok(); } } - Ok(Scalar::from_i32(new_fd)) + Ok(Scalar::from_i32(new_fd_num)) } - fn flock(&mut self, fd: i32, op: i32) -> InterpResult<'tcx, Scalar> { + fn flock(&mut self, fd_num: i32, op: i32) -> InterpResult<'tcx, Scalar> { let this = self.eval_context_mut(); - let Some(file_descriptor) = this.machine.fds.get(fd) else { + let Some(fd) = this.machine.fds.get(fd_num) else { return Ok(Scalar::from_i32(this.fd_not_found()?)); }; @@ -436,8 +436,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { throw_unsup_format!("unsupported flags {:#x}", op); }; - let result = file_descriptor.flock(this.machine.communicate(), parsed_op)?; - drop(file_descriptor); + let result = fd.flock(this.machine.communicate(), parsed_op)?; + drop(fd); // return `0` if flock is successful let result = result.map(|()| 0i32); Ok(Scalar::from_i32(this.try_unwrap_io_result(result)?)) @@ -452,7 +452,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { args.len() ); } - let fd = this.read_scalar(&args[0])?.to_i32()?; + let fd_num = this.read_scalar(&args[0])?.to_i32()?; let cmd = this.read_scalar(&args[1])?.to_i32()?; // We only support getting the flags for a descriptor. @@ -461,7 +461,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { // `FD_CLOEXEC` value without checking if the flag is set for the file because `std` // always sets this flag when opening a file. However we still need to check that the // file itself is open. - Ok(Scalar::from_i32(if this.machine.fds.is_fd(fd) { + Ok(Scalar::from_i32(if this.machine.fds.is_fd_num(fd_num) { this.eval_libc_i32("FD_CLOEXEC") } else { this.fd_not_found()? @@ -481,9 +481,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { } let start = this.read_scalar(&args[2])?.to_i32()?; - match this.machine.fds.get(fd) { - Some(dup_fd) => - Ok(Scalar::from_i32(this.machine.fds.insert_ref_with_min_fd(dup_fd, start))), + match this.machine.fds.get(fd_num) { + Some(fd) => Ok(Scalar::from_i32(this.machine.fds.insert_with_min_num(fd, start))), None => Ok(Scalar::from_i32(this.fd_not_found()?)), } } else if this.tcx.sess.target.os == "macos" && cmd == this.eval_libc_i32("F_FULLFSYNC") { @@ -494,7 +493,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { return Ok(Scalar::from_i32(-1)); } - this.ffullsync_fd(fd) + this.ffullsync_fd(fd_num) } else { throw_unsup_format!("the {:#x} command is not supported for `fcntl`)", cmd); } @@ -503,12 +502,12 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { fn close(&mut self, fd_op: &OpTy<'tcx>) -> InterpResult<'tcx, Scalar> { let this = self.eval_context_mut(); - let fd = this.read_scalar(fd_op)?.to_i32()?; + let fd_num = this.read_scalar(fd_op)?.to_i32()?; - let Some(file_description) = this.machine.fds.remove(fd) else { + let Some(fd) = this.machine.fds.remove(fd_num) else { return Ok(Scalar::from_i32(this.fd_not_found()?)); }; - let result = file_description.close(this.machine.communicate(), this)?; + let result = fd.close(this.machine.communicate(), this)?; // return `0` if close is successful let result = result.map(|()| 0i32); Ok(Scalar::from_i32(this.try_unwrap_io_result(result)?)) @@ -532,16 +531,16 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { /// and keeps the cursor unchanged. fn read( &mut self, - fd: i32, + fd_num: i32, buf: Pointer, count: u64, offset: Option, ) -> InterpResult<'tcx, Scalar> { let this = self.eval_context_mut(); - // Isolation check is done via `FileDescriptor` trait. + // Isolation check is done via `FileDescription` trait. - trace!("Reading from FD {}, size {}", fd, count); + trace!("Reading from FD {}, size {}", fd_num, count); // Check that the *entire* buffer is actually valid memory. this.check_ptr_access(buf, Size::from_bytes(count), CheckInAllocMsg::MemoryAccessTest)?; @@ -554,7 +553,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { let communicate = this.machine.communicate(); // We temporarily dup the FD to be able to retain mutable access to `this`. - let Some(fd) = this.machine.fds.get(fd) else { + let Some(fd) = this.machine.fds.get(fd_num) else { trace!("read: FD not found"); return Ok(Scalar::from_target_isize(this.fd_not_found()?, this)); }; @@ -597,14 +596,14 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { fn write( &mut self, - fd: i32, + fd_num: i32, buf: Pointer, count: u64, offset: Option, ) -> InterpResult<'tcx, Scalar> { let this = self.eval_context_mut(); - // Isolation check is done via `FileDescriptor` trait. + // Isolation check is done via `FileDescription` trait. // Check that the *entire* buffer is actually valid memory. this.check_ptr_access(buf, Size::from_bytes(count), CheckInAllocMsg::MemoryAccessTest)?; @@ -618,7 +617,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { let bytes = this.read_bytes_ptr_strip_provenance(buf, Size::from_bytes(count))?.to_owned(); // We temporarily dup the FD to be able to retain mutable access to `this`. - let Some(fd) = this.machine.fds.get(fd) else { + let Some(fd) = this.machine.fds.get(fd_num) else { return Ok(Scalar::from_target_isize(this.fd_not_found()?, this)); }; diff --git a/src/tools/miri/src/shims/unix/fs.rs b/src/tools/miri/src/shims/unix/fs.rs index e00758bb98de6..e1697a4741559 100644 --- a/src/tools/miri/src/shims/unix/fs.rs +++ b/src/tools/miri/src/shims/unix/fs.rs @@ -554,10 +554,10 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { Ok(Scalar::from_i32(this.try_unwrap_io_result(fd)?)) } - fn lseek64(&mut self, fd: i32, offset: i128, whence: i32) -> InterpResult<'tcx, Scalar> { + fn lseek64(&mut self, fd_num: i32, offset: i128, whence: i32) -> InterpResult<'tcx, Scalar> { let this = self.eval_context_mut(); - // Isolation check is done via `FileDescriptor` trait. + // Isolation check is done via `FileDescription` trait. let seek_from = if whence == this.eval_libc_i32("SEEK_SET") { if offset < 0 { @@ -580,13 +580,11 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { let communicate = this.machine.communicate(); - let Some(file_description) = this.machine.fds.get(fd) else { + let Some(fd) = this.machine.fds.get(fd_num) else { return Ok(Scalar::from_i64(this.fd_not_found()?)); }; - let result = file_description - .seek(communicate, seek_from)? - .map(|offset| i64::try_from(offset).unwrap()); - drop(file_description); + let result = fd.seek(communicate, seek_from)?.map(|offset| i64::try_from(offset).unwrap()); + drop(fd); let result = this.try_unwrap_io_result(result)?; Ok(Scalar::from_i64(result)) @@ -721,7 +719,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { return Ok(Scalar::from_i32(this.fd_not_found()?)); } - let metadata = match FileMetadata::from_fd(this, fd)? { + let metadata = match FileMetadata::from_fd_num(this, fd)? { Some(metadata) => metadata, None => return Ok(Scalar::from_i32(-1)), }; @@ -808,7 +806,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { // If the path is empty, and the AT_EMPTY_PATH flag is set, we query the open file // represented by dirfd, whether it's a directory or otherwise. let metadata = if path.as_os_str().is_empty() && empty_path_flag { - FileMetadata::from_fd(this, dirfd)? + FileMetadata::from_fd_num(this, dirfd)? } else { FileMetadata::from_path(this, &path, follow_symlink)? }; @@ -1260,7 +1258,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { })) } - fn ftruncate64(&mut self, fd: i32, length: i128) -> InterpResult<'tcx, Scalar> { + fn ftruncate64(&mut self, fd_num: i32, length: i128) -> InterpResult<'tcx, Scalar> { let this = self.eval_context_mut(); // Reject if isolation is enabled. @@ -1270,30 +1268,29 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { return Ok(Scalar::from_i32(this.fd_not_found()?)); } - let Some(file_description) = this.machine.fds.get(fd) else { + let Some(fd) = this.machine.fds.get(fd_num) else { return Ok(Scalar::from_i32(this.fd_not_found()?)); }; // FIXME: Support ftruncate64 for all FDs - let FileHandle { file, writable } = - file_description.downcast::().ok_or_else(|| { - err_unsup_format!("`ftruncate64` is only supported on file-backed file descriptors") - })?; + let FileHandle { file, writable } = fd.downcast::().ok_or_else(|| { + err_unsup_format!("`ftruncate64` is only supported on file-backed file descriptors") + })?; if *writable { if let Ok(length) = length.try_into() { let result = file.set_len(length); - drop(file_description); + drop(fd); let result = this.try_unwrap_io_result(result.map(|_| 0i32))?; Ok(Scalar::from_i32(result)) } else { - drop(file_description); + drop(fd); let einval = this.eval_libc("EINVAL"); this.set_last_error(einval)?; Ok(Scalar::from_i32(-1)) } } else { - drop(file_description); + drop(fd); // The file is not writable let einval = this.eval_libc("EINVAL"); this.set_last_error(einval)?; @@ -1321,18 +1318,17 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { self.ffullsync_fd(fd) } - fn ffullsync_fd(&mut self, fd: i32) -> InterpResult<'tcx, Scalar> { + fn ffullsync_fd(&mut self, fd_num: i32) -> InterpResult<'tcx, Scalar> { let this = self.eval_context_mut(); - let Some(file_description) = this.machine.fds.get(fd) else { + let Some(fd) = this.machine.fds.get(fd_num) else { return Ok(Scalar::from_i32(this.fd_not_found()?)); }; // Only regular files support synchronization. - let FileHandle { file, writable } = - file_description.downcast::().ok_or_else(|| { - err_unsup_format!("`fsync` is only supported on file-backed file descriptors") - })?; + let FileHandle { file, writable } = fd.downcast::().ok_or_else(|| { + err_unsup_format!("`fsync` is only supported on file-backed file descriptors") + })?; let io_result = maybe_sync_file(file, *writable, File::sync_all); - drop(file_description); + drop(fd); Ok(Scalar::from_i32(this.try_unwrap_io_result(io_result)?)) } @@ -1348,16 +1344,15 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { return Ok(Scalar::from_i32(this.fd_not_found()?)); } - let Some(file_description) = this.machine.fds.get(fd) else { + let Some(fd) = this.machine.fds.get(fd) else { return Ok(Scalar::from_i32(this.fd_not_found()?)); }; // Only regular files support synchronization. - let FileHandle { file, writable } = - file_description.downcast::().ok_or_else(|| { - err_unsup_format!("`fdatasync` is only supported on file-backed file descriptors") - })?; + let FileHandle { file, writable } = fd.downcast::().ok_or_else(|| { + err_unsup_format!("`fdatasync` is only supported on file-backed file descriptors") + })?; let io_result = maybe_sync_file(file, *writable, File::sync_data); - drop(file_description); + drop(fd); Ok(Scalar::from_i32(this.try_unwrap_io_result(io_result)?)) } @@ -1396,18 +1391,15 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { return Ok(Scalar::from_i32(this.fd_not_found()?)); } - let Some(file_description) = this.machine.fds.get(fd) else { + let Some(fd) = this.machine.fds.get(fd) else { return Ok(Scalar::from_i32(this.fd_not_found()?)); }; // Only regular files support synchronization. - let FileHandle { file, writable } = - file_description.downcast::().ok_or_else(|| { - err_unsup_format!( - "`sync_data_range` is only supported on file-backed file descriptors" - ) - })?; + let FileHandle { file, writable } = fd.downcast::().ok_or_else(|| { + err_unsup_format!("`sync_data_range` is only supported on file-backed file descriptors") + })?; let io_result = maybe_sync_file(file, *writable, File::sync_data); - drop(file_description); + drop(fd); Ok(Scalar::from_i32(this.try_unwrap_io_result(io_result)?)) } @@ -1699,15 +1691,15 @@ impl FileMetadata { FileMetadata::from_meta(ecx, metadata) } - fn from_fd<'tcx>( + fn from_fd_num<'tcx>( ecx: &mut MiriInterpCx<'tcx>, - fd: i32, + fd_num: i32, ) -> InterpResult<'tcx, Option> { - let Some(file_description) = ecx.machine.fds.get(fd) else { + let Some(fd) = ecx.machine.fds.get(fd_num) else { return ecx.fd_not_found().map(|_: i32| None); }; - let file = &file_description + let file = &fd .downcast::() .ok_or_else(|| { err_unsup_format!( @@ -1717,7 +1709,7 @@ impl FileMetadata { .file; let metadata = file.metadata(); - drop(file_description); + drop(fd); FileMetadata::from_meta(ecx, metadata) } diff --git a/src/tools/miri/src/shims/unix/linux/epoll.rs b/src/tools/miri/src/shims/unix/linux/epoll.rs index ee86cf5f26d7f..3d4fe770e99e9 100644 --- a/src/tools/miri/src/shims/unix/linux/epoll.rs +++ b/src/tools/miri/src/shims/unix/linux/epoll.rs @@ -51,7 +51,10 @@ impl EpollEventInstance { #[derive(Clone, Debug)] pub struct EpollEventInterest { /// The file descriptor value of the file description registered. - file_descriptor: i32, + /// This is only used for ready_list, to inform userspace which FD triggered an event. + /// For that, it is crucial to preserve the original FD number. + /// This FD number must never be "dereferenced" to a file description inside Miri. + fd_num: i32, /// The events bitmask retrieved from `epoll_event`. events: u32, /// The data retrieved from `epoll_event`. @@ -61,8 +64,8 @@ pub struct EpollEventInterest { data: u64, /// Ready list of the epoll instance under which this EpollEventInterest is registered. ready_list: Rc>>, - /// The file descriptor value that this EpollEventInterest is registered under. - epfd: i32, + /// The epoll file description that this EpollEventInterest is registered under. + weak_epfd: WeakFileDescriptionRef, } /// EpollReadyEvents reflects the readiness of a file description. @@ -339,11 +342,11 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { // Create an epoll_interest. let interest = Rc::new(RefCell::new(EpollEventInterest { - file_descriptor: fd, + fd_num: fd, events, data, ready_list: Rc::clone(ready_list), - epfd: epfd_value, + weak_epfd: epfd.downgrade(), })); if op == epoll_ctl_add { @@ -553,12 +556,12 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { if is_updated { // Edge-triggered notification only notify one thread even if there are // multiple threads block on the same epfd. - let epfd = this.machine.fds.get(epoll_interest.borrow().epfd).unwrap(); // This unwrap can never fail because if the current epoll instance were - // closed and its epfd value reused, the upgrade of weak_epoll_interest + // closed, the upgrade of weak_epoll_interest // above would fail. This guarantee holds because only the epoll instance // holds a strong ref to epoll_interest. + let epfd = epoll_interest.borrow().weak_epfd.upgrade().unwrap(); // FIXME: We can randomly pick a thread to unblock. if let Some(thread_id) = epfd.downcast::().unwrap().thread_id.borrow_mut().pop() @@ -615,7 +618,7 @@ fn check_and_update_one_event_interest<'tcx>( // If there is any event that we are interested in being specified as ready, // insert an epoll_return to the ready list. if flags != 0 { - let epoll_key = (id, epoll_event_interest.file_descriptor); + let epoll_key = (id, epoll_event_interest.fd_num); let ready_list = &mut epoll_event_interest.ready_list.borrow_mut(); let event_instance = EpollEventInstance::new(flags, epoll_event_interest.data); // Triggers the notification by inserting it to the ready list. diff --git a/src/tools/miri/src/shims/unix/macos/sync.rs b/src/tools/miri/src/shims/unix/macos/sync.rs index 882c08cca154c..8f9237a1d46ea 100644 --- a/src/tools/miri/src/shims/unix/macos/sync.rs +++ b/src/tools/miri/src/shims/unix/macos/sync.rs @@ -14,12 +14,13 @@ use crate::*; impl<'tcx> EvalContextExtPriv<'tcx> for crate::MiriInterpCx<'tcx> {} trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> { - fn os_unfair_lock_getid(&mut self, lock_op: &OpTy<'tcx>) -> InterpResult<'tcx, MutexId> { + fn os_unfair_lock_getid(&mut self, lock_ptr: &OpTy<'tcx>) -> InterpResult<'tcx, MutexId> { let this = self.eval_context_mut(); + let lock = this.deref_pointer(lock_ptr)?; // os_unfair_lock holds a 32-bit value, is initialized with zero and // must be assumed to be opaque. Therefore, we can just store our // internal mutex ID in the structure without anyone noticing. - this.mutex_get_or_create_id(lock_op, this.libc_ty_layout("os_unfair_lock"), 0, |_| Ok(None)) + this.mutex_get_or_create_id(&lock, 0, |_| Ok(None)) } } diff --git a/src/tools/miri/src/shims/unix/mem.rs b/src/tools/miri/src/shims/unix/mem.rs index de5a5d0759c4b..33ed0e2698226 100644 --- a/src/tools/miri/src/shims/unix/mem.rs +++ b/src/tools/miri/src/shims/unix/mem.rs @@ -42,10 +42,10 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { let map_shared = this.eval_libc_i32("MAP_SHARED"); let map_fixed = this.eval_libc_i32("MAP_FIXED"); - // This is a horrible hack, but on MacOS and Solaris the guard page mechanism uses mmap + // This is a horrible hack, but on MacOS and Solarish the guard page mechanism uses mmap // in a way we do not support. We just give it the return value it expects. if this.frame_in_std() - && matches!(&*this.tcx.sess.target.os, "macos" | "solaris") + && matches!(&*this.tcx.sess.target.os, "macos" | "solaris" | "illumos") && (flags & map_fixed) != 0 { return Ok(Scalar::from_maybe_pointer(Pointer::from_addr_invalid(addr), this)); diff --git a/src/tools/miri/src/shims/unix/sync.rs b/src/tools/miri/src/shims/unix/sync.rs index 57cc9cf4618c8..fea994663c076 100644 --- a/src/tools/miri/src/shims/unix/sync.rs +++ b/src/tools/miri/src/shims/unix/sync.rs @@ -11,17 +11,17 @@ use crate::*; #[inline] fn mutexattr_kind_offset<'tcx>(ecx: &MiriInterpCx<'tcx>) -> InterpResult<'tcx, u64> { Ok(match &*ecx.tcx.sess.target.os { - "linux" | "illumos" | "solaris" | "macos" => 0, + "linux" | "illumos" | "solaris" | "macos" | "freebsd" | "android" => 0, os => throw_unsup_format!("`pthread_mutexattr` is not supported on {os}"), }) } fn mutexattr_get_kind<'tcx>( ecx: &MiriInterpCx<'tcx>, - attr_op: &OpTy<'tcx>, + attr_ptr: &OpTy<'tcx>, ) -> InterpResult<'tcx, i32> { ecx.deref_pointer_and_read( - attr_op, + attr_ptr, mutexattr_kind_offset(ecx)?, ecx.libc_ty_layout("pthread_mutexattr_t"), ecx.machine.layouts.i32, @@ -31,11 +31,11 @@ fn mutexattr_get_kind<'tcx>( fn mutexattr_set_kind<'tcx>( ecx: &mut MiriInterpCx<'tcx>, - attr_op: &OpTy<'tcx>, + attr_ptr: &OpTy<'tcx>, kind: i32, ) -> InterpResult<'tcx, ()> { ecx.deref_pointer_and_write( - attr_op, + attr_ptr, mutexattr_kind_offset(ecx)?, Scalar::from_i32(kind), ecx.libc_ty_layout("pthread_mutexattr_t"), @@ -43,29 +43,40 @@ fn mutexattr_set_kind<'tcx>( ) } -/// A flag that allows to distinguish `PTHREAD_MUTEX_NORMAL` from -/// `PTHREAD_MUTEX_DEFAULT`. Since in `glibc` they have the same numeric values, -/// but different behaviour, we need a way to distinguish them. We do this by -/// setting this bit flag to the `PTHREAD_MUTEX_NORMAL` mutexes. See the comment -/// in `pthread_mutexattr_settype` function. -const PTHREAD_MUTEX_NORMAL_FLAG: i32 = 0x8000000; - -fn is_mutex_kind_default<'tcx>(ecx: &MiriInterpCx<'tcx>, kind: i32) -> InterpResult<'tcx, bool> { - Ok(kind == ecx.eval_libc_i32("PTHREAD_MUTEX_DEFAULT")) +/// To differentiate "the mutex kind has not been changed" from +/// "the mutex kind has been set to PTHREAD_MUTEX_DEFAULT and that is +/// equal to some other mutex kind", we make the default value of this +/// field *not* PTHREAD_MUTEX_DEFAULT but this special flag. +const PTHREAD_MUTEX_KIND_UNCHANGED: i32 = 0x8000000; + +/// The mutex kind. +#[derive(Debug, Clone, Copy)] +pub enum MutexKind { + Normal, + Default, + Recursive, + ErrorCheck, } -fn is_mutex_kind_normal<'tcx>(ecx: &MiriInterpCx<'tcx>, kind: i32) -> InterpResult<'tcx, bool> { - let mutex_normal_kind = ecx.eval_libc_i32("PTHREAD_MUTEX_NORMAL"); - Ok(kind == (mutex_normal_kind | PTHREAD_MUTEX_NORMAL_FLAG)) +#[derive(Debug)] +/// Additional data that we attach with each mutex instance. +pub struct AdditionalMutexData { + /// The mutex kind, used by some mutex implementations like pthreads mutexes. + pub kind: MutexKind, + + /// The address of the mutex. + pub address: u64, } -// pthread_mutex_t is between 24 and 48 bytes, depending on the platform. +// pthread_mutex_t is between 4 and 48 bytes, depending on the platform. // We ignore the platform layout and store our own fields: // - id: u32 fn mutex_id_offset<'tcx>(ecx: &MiriInterpCx<'tcx>) -> InterpResult<'tcx, u64> { + // When adding a new OS, make sure we also support all its static initializers in + // `mutex_kind_from_static_initializer`! let offset = match &*ecx.tcx.sess.target.os { - "linux" | "illumos" | "solaris" => 0, + "linux" | "illumos" | "solaris" | "freebsd" | "android" => 0, // macOS stores a signature in the first bytes, so we have to move to offset 4. "macos" => 4, os => throw_unsup_format!("`pthread_mutex` is not supported on {os}"), @@ -77,15 +88,28 @@ fn mutex_id_offset<'tcx>(ecx: &MiriInterpCx<'tcx>) -> InterpResult<'tcx, u64> { // recursive or error checking mutexes. We should also add thme in this sanity check. static SANITY: AtomicBool = AtomicBool::new(false); if !SANITY.swap(true, Ordering::Relaxed) { - let static_initializer = ecx.eval_path(&["libc", "PTHREAD_MUTEX_INITIALIZER"]); - let id_field = static_initializer - .offset(Size::from_bytes(offset), ecx.machine.layouts.u32, ecx) - .unwrap(); - let id = ecx.read_scalar(&id_field).unwrap().to_u32().unwrap(); - assert_eq!( - id, 0, - "PTHREAD_MUTEX_INITIALIZER is incompatible with our pthread_mutex layout: id is not 0" - ); + let check_static_initializer = |name| { + let static_initializer = ecx.eval_path(&["libc", name]); + let id_field = static_initializer + .offset(Size::from_bytes(offset), ecx.machine.layouts.u32, ecx) + .unwrap(); + let id = ecx.read_scalar(&id_field).unwrap().to_u32().unwrap(); + assert_eq!(id, 0, "{name} is incompatible with our pthread_mutex layout: id is not 0"); + }; + + check_static_initializer("PTHREAD_MUTEX_INITIALIZER"); + // Check non-standard initializers. + match &*ecx.tcx.sess.target.os { + "linux" => { + check_static_initializer("PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP"); + check_static_initializer("PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP"); + check_static_initializer("PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP"); + } + "illumos" | "solaris" | "macos" | "freebsd" | "android" => { + // No non-standard initializers. + } + os => throw_unsup_format!("`pthread_mutex` is not supported on {os}"), + } } Ok(offset) @@ -94,15 +118,13 @@ fn mutex_id_offset<'tcx>(ecx: &MiriInterpCx<'tcx>) -> InterpResult<'tcx, u64> { /// Eagerly create and initialize a new mutex. fn mutex_create<'tcx>( ecx: &mut MiriInterpCx<'tcx>, - mutex_op: &OpTy<'tcx>, - kind: i32, + mutex_ptr: &OpTy<'tcx>, + kind: MutexKind, ) -> InterpResult<'tcx> { - // FIXME: might be worth changing mutex_create to take the mplace - // rather than the `OpTy`. - let address = ecx.read_pointer(mutex_op)?.addr().bytes(); - let kind = translate_kind(ecx, kind)?; - let data = Some(AdditionalMutexData { address, kind }); - ecx.mutex_create(mutex_op, ecx.libc_ty_layout("pthread_mutex_t"), mutex_id_offset(ecx)?, data)?; + let mutex = ecx.deref_pointer(mutex_ptr)?; + let address = mutex.ptr().addr().bytes(); + let data = Box::new(AdditionalMutexData { address, kind }); + ecx.mutex_create(&mutex, mutex_id_offset(ecx)?, Some(data))?; Ok(()) } @@ -112,27 +134,23 @@ fn mutex_create<'tcx>( /// return an error if it has. fn mutex_get_id<'tcx>( ecx: &mut MiriInterpCx<'tcx>, - mutex_op: &OpTy<'tcx>, + mutex_ptr: &OpTy<'tcx>, ) -> InterpResult<'tcx, MutexId> { - let address = ecx.read_pointer(mutex_op)?.addr().bytes(); - - // FIXME: might be worth changing mutex_get_or_create_id to take the mplace - // rather than the `OpTy`. - let id = ecx.mutex_get_or_create_id( - mutex_op, - ecx.libc_ty_layout("pthread_mutex_t"), - mutex_id_offset(ecx)?, - |ecx| { - // This is called if a static initializer was used and the lock has not been assigned - // an ID yet. We have to determine the mutex kind from the static initializer. - let kind = kind_from_static_initializer(ecx, mutex_op)?; - - Ok(Some(AdditionalMutexData { kind, address })) - }, - )?; + let mutex = ecx.deref_pointer(mutex_ptr)?; + let address = mutex.ptr().addr().bytes(); + + let id = ecx.mutex_get_or_create_id(&mutex, mutex_id_offset(ecx)?, |ecx| { + // This is called if a static initializer was used and the lock has not been assigned + // an ID yet. We have to determine the mutex kind from the static initializer. + let kind = mutex_kind_from_static_initializer(ecx, &mutex)?; + + Ok(Some(Box::new(AdditionalMutexData { kind, address }))) + })?; // Check that the mutex has not been moved since last use. - let data = ecx.mutex_get_data(id).expect("data should be always exist for pthreads"); + let data = ecx + .mutex_get_data::(id) + .expect("data should always exist for pthreads"); if data.address != address { throw_ub_format!("pthread_mutex_t can't be moved after first use") } @@ -141,51 +159,64 @@ fn mutex_get_id<'tcx>( } /// Returns the kind of a static initializer. -fn kind_from_static_initializer<'tcx>( +fn mutex_kind_from_static_initializer<'tcx>( ecx: &MiriInterpCx<'tcx>, - mutex_op: &OpTy<'tcx>, + mutex: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx, MutexKind> { - // Only linux has static initializers other than PTHREAD_MUTEX_DEFAULT. - let kind = match &*ecx.tcx.sess.target.os { + Ok(match &*ecx.tcx.sess.target.os { + // Only linux has static initializers other than PTHREAD_MUTEX_DEFAULT. "linux" => { let offset = if ecx.pointer_size().bytes() == 8 { 16 } else { 12 }; - - ecx.deref_pointer_and_read( - mutex_op, - offset, - ecx.libc_ty_layout("pthread_mutex_t"), - ecx.machine.layouts.i32, - )? - .to_i32()? + let kind_place = + mutex.offset(Size::from_bytes(offset), ecx.machine.layouts.i32, ecx)?; + let kind = ecx.read_scalar(&kind_place)?.to_i32()?; + // Here we give PTHREAD_MUTEX_DEFAULT priority so that + // PTHREAD_MUTEX_INITIALIZER behaves like `pthread_mutex_init` with a NULL argument. + if kind == ecx.eval_libc_i32("PTHREAD_MUTEX_DEFAULT") { + MutexKind::Default + } else { + mutex_translate_kind(ecx, kind)? + } } - | "illumos" | "solaris" | "macos" => ecx.eval_libc_i32("PTHREAD_MUTEX_DEFAULT"), - os => throw_unsup_format!("`pthread_mutex` is not supported on {os}"), - }; - - translate_kind(ecx, kind) + _ => MutexKind::Default, + }) } -fn translate_kind<'tcx>(ecx: &MiriInterpCx<'tcx>, kind: i32) -> InterpResult<'tcx, MutexKind> { - Ok(if is_mutex_kind_default(ecx, kind)? { - MutexKind::Default - } else if is_mutex_kind_normal(ecx, kind)? { +fn mutex_translate_kind<'tcx>( + ecx: &MiriInterpCx<'tcx>, + kind: i32, +) -> InterpResult<'tcx, MutexKind> { + Ok(if kind == (ecx.eval_libc_i32("PTHREAD_MUTEX_NORMAL")) { MutexKind::Normal } else if kind == ecx.eval_libc_i32("PTHREAD_MUTEX_ERRORCHECK") { MutexKind::ErrorCheck } else if kind == ecx.eval_libc_i32("PTHREAD_MUTEX_RECURSIVE") { MutexKind::Recursive + } else if kind == ecx.eval_libc_i32("PTHREAD_MUTEX_DEFAULT") + || kind == PTHREAD_MUTEX_KIND_UNCHANGED + { + // We check this *last* since PTHREAD_MUTEX_DEFAULT may be numerically equal to one of the + // others, and we want an explicit `mutexattr_settype` to work as expected. + MutexKind::Default } else { throw_unsup_format!("unsupported type of mutex: {kind}"); }) } -// pthread_rwlock_t is between 32 and 56 bytes, depending on the platform. +// pthread_rwlock_t is between 4 and 56 bytes, depending on the platform. // We ignore the platform layout and store our own fields: // - id: u32 +#[derive(Debug)] +/// Additional data that we attach with each rwlock instance. +pub struct AdditionalRwLockData { + /// The address of the rwlock. + pub address: u64, +} + fn rwlock_id_offset<'tcx>(ecx: &MiriInterpCx<'tcx>) -> InterpResult<'tcx, u64> { let offset = match &*ecx.tcx.sess.target.os { - "linux" | "illumos" | "solaris" => 0, + "linux" | "illumos" | "solaris" | "freebsd" | "android" => 0, // macOS stores a signature in the first bytes, so we have to move to offset 4. "macos" => 4, os => throw_unsup_format!("`pthread_rwlock` is not supported on {os}"), @@ -211,13 +242,24 @@ fn rwlock_id_offset<'tcx>(ecx: &MiriInterpCx<'tcx>) -> InterpResult<'tcx, u64> { fn rwlock_get_id<'tcx>( ecx: &mut MiriInterpCx<'tcx>, - rwlock_op: &OpTy<'tcx>, + rwlock_ptr: &OpTy<'tcx>, ) -> InterpResult<'tcx, RwLockId> { - ecx.rwlock_get_or_create_id( - rwlock_op, - ecx.libc_ty_layout("pthread_rwlock_t"), - rwlock_id_offset(ecx)?, - ) + let rwlock = ecx.deref_pointer(rwlock_ptr)?; + let address = rwlock.ptr().addr().bytes(); + + let id = ecx.rwlock_get_or_create_id(&rwlock, rwlock_id_offset(ecx)?, |_| { + Ok(Some(Box::new(AdditionalRwLockData { address }))) + })?; + + // Check that the rwlock has not been moved since last use. + let data = ecx + .rwlock_get_data::(id) + .expect("data should always exist for pthreads"); + if data.address != address { + throw_ub_format!("pthread_rwlock_t can't be moved after first use") + } + + Ok(id) } // pthread_condattr_t. @@ -227,7 +269,7 @@ fn rwlock_get_id<'tcx>( #[inline] fn condattr_clock_offset<'tcx>(ecx: &MiriInterpCx<'tcx>) -> InterpResult<'tcx, u64> { Ok(match &*ecx.tcx.sess.target.os { - "linux" | "illumos" | "solaris" => 0, + "linux" | "illumos" | "solaris" | "freebsd" | "android" => 0, // macOS does not have a clock attribute. os => throw_unsup_format!("`pthread_condattr` clock field is not supported on {os}"), }) @@ -235,10 +277,10 @@ fn condattr_clock_offset<'tcx>(ecx: &MiriInterpCx<'tcx>) -> InterpResult<'tcx, u fn condattr_get_clock_id<'tcx>( ecx: &MiriInterpCx<'tcx>, - attr_op: &OpTy<'tcx>, + attr_ptr: &OpTy<'tcx>, ) -> InterpResult<'tcx, i32> { ecx.deref_pointer_and_read( - attr_op, + attr_ptr, condattr_clock_offset(ecx)?, ecx.libc_ty_layout("pthread_condattr_t"), ecx.machine.layouts.i32, @@ -246,13 +288,26 @@ fn condattr_get_clock_id<'tcx>( .to_i32() } +fn cond_translate_clock_id<'tcx>( + ecx: &MiriInterpCx<'tcx>, + raw_id: i32, +) -> InterpResult<'tcx, ClockId> { + Ok(if raw_id == ecx.eval_libc_i32("CLOCK_REALTIME") { + ClockId::Realtime + } else if raw_id == ecx.eval_libc_i32("CLOCK_MONOTONIC") { + ClockId::Monotonic + } else { + throw_unsup_format!("unsupported clock id: {raw_id}"); + }) +} + fn condattr_set_clock_id<'tcx>( ecx: &mut MiriInterpCx<'tcx>, - attr_op: &OpTy<'tcx>, + attr_ptr: &OpTy<'tcx>, clock_id: i32, ) -> InterpResult<'tcx, ()> { ecx.deref_pointer_and_write( - attr_op, + attr_ptr, condattr_clock_offset(ecx)?, Scalar::from_i32(clock_id), ecx.libc_ty_layout("pthread_condattr_t"), @@ -260,14 +315,13 @@ fn condattr_set_clock_id<'tcx>( ) } -// pthread_cond_t. +// pthread_cond_t can be only 4 bytes in size, depending on the platform. // We ignore the platform layout and store our own fields: // - id: u32 -// - clock: i32 fn cond_id_offset<'tcx>(ecx: &MiriInterpCx<'tcx>) -> InterpResult<'tcx, u64> { let offset = match &*ecx.tcx.sess.target.os { - "linux" | "illumos" | "solaris" => 0, + "linux" | "illumos" | "solaris" | "freebsd" | "android" => 0, // macOS stores a signature in the first bytes, so we have to move to offset 4. "macos" => 4, os => throw_unsup_format!("`pthread_cond` is not supported on {os}"), @@ -291,88 +345,42 @@ fn cond_id_offset<'tcx>(ecx: &MiriInterpCx<'tcx>) -> InterpResult<'tcx, u64> { Ok(offset) } -/// Determines whether this clock represents the real-time clock, CLOCK_REALTIME. -fn is_cond_clock_realtime<'tcx>(ecx: &MiriInterpCx<'tcx>, clock_id: i32) -> bool { - // To ensure compatibility with PTHREAD_COND_INITIALIZER on all platforms, - // we can't just compare with CLOCK_REALTIME: on Solarish, PTHREAD_COND_INITIALIZER - // makes the clock 0 but CLOCK_REALTIME is 3. - // However, we need to always be able to distinguish this from CLOCK_MONOTONIC. - clock_id == ecx.eval_libc_i32("CLOCK_REALTIME") - || (clock_id == 0 && clock_id != ecx.eval_libc_i32("CLOCK_MONOTONIC")) +#[derive(Debug, Clone, Copy)] +enum ClockId { + Realtime, + Monotonic, } -fn cond_clock_offset<'tcx>(ecx: &MiriInterpCx<'tcx>) -> u64 { - // macOS doesn't have a clock attribute, but to keep the code uniform we store - // a clock ID in the pthread_cond_t anyway. There's enough space. - let offset = 8; +#[derive(Debug)] +/// Additional data that we attach with each cond instance. +struct AdditionalCondData { + /// The address of the cond. + address: u64, - // Sanity-check this against PTHREAD_COND_INITIALIZER (but only once): - // the clock must start out as CLOCK_REALTIME. - static SANITY: AtomicBool = AtomicBool::new(false); - if !SANITY.swap(true, Ordering::Relaxed) { - let static_initializer = ecx.eval_path(&["libc", "PTHREAD_COND_INITIALIZER"]); - let id_field = static_initializer - .offset(Size::from_bytes(offset), ecx.machine.layouts.i32, ecx) - .unwrap(); - let id = ecx.read_scalar(&id_field).unwrap().to_i32().unwrap(); - assert!( - is_cond_clock_realtime(ecx, id), - "PTHREAD_COND_INITIALIZER is incompatible with our pthread_cond layout: clock is not CLOCK_REALTIME" - ); - } - - offset + /// The clock id of the cond. + clock_id: ClockId, } fn cond_get_id<'tcx>( ecx: &mut MiriInterpCx<'tcx>, - cond_op: &OpTy<'tcx>, + cond_ptr: &OpTy<'tcx>, ) -> InterpResult<'tcx, CondvarId> { - ecx.condvar_get_or_create_id( - cond_op, - ecx.libc_ty_layout("pthread_cond_t"), - cond_id_offset(ecx)?, - ) -} + let cond = ecx.deref_pointer(cond_ptr)?; + let address = cond.ptr().addr().bytes(); + let id = ecx.condvar_get_or_create_id(&cond, cond_id_offset(ecx)?, |_ecx| { + // This used the static initializer. The clock there is always CLOCK_REALTIME. + Ok(Some(Box::new(AdditionalCondData { address, clock_id: ClockId::Realtime }))) + })?; -fn cond_reset_id<'tcx>( - ecx: &mut MiriInterpCx<'tcx>, - cond_op: &OpTy<'tcx>, -) -> InterpResult<'tcx, ()> { - ecx.deref_pointer_and_write( - cond_op, - cond_id_offset(ecx)?, - Scalar::from_i32(0), - ecx.libc_ty_layout("pthread_cond_t"), - ecx.machine.layouts.u32, - ) -} - -fn cond_get_clock_id<'tcx>( - ecx: &MiriInterpCx<'tcx>, - cond_op: &OpTy<'tcx>, -) -> InterpResult<'tcx, i32> { - ecx.deref_pointer_and_read( - cond_op, - cond_clock_offset(ecx), - ecx.libc_ty_layout("pthread_cond_t"), - ecx.machine.layouts.i32, - )? - .to_i32() -} + // Check that the mutex has not been moved since last use. + let data = ecx + .condvar_get_data::(id) + .expect("data should always exist for pthreads"); + if data.address != address { + throw_ub_format!("pthread_cond_t can't be moved after first use") + } -fn cond_set_clock_id<'tcx>( - ecx: &mut MiriInterpCx<'tcx>, - cond_op: &OpTy<'tcx>, - clock_id: i32, -) -> InterpResult<'tcx, ()> { - ecx.deref_pointer_and_write( - cond_op, - cond_clock_offset(ecx), - Scalar::from_i32(clock_id), - ecx.libc_ty_layout("pthread_cond_t"), - ecx.machine.layouts.i32, - ) + Ok(id) } impl<'tcx> EvalContextExt<'tcx> for crate::MiriInterpCx<'tcx> {} @@ -380,8 +388,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { fn pthread_mutexattr_init(&mut self, attr_op: &OpTy<'tcx>) -> InterpResult<'tcx, ()> { let this = self.eval_context_mut(); - let default_kind = this.eval_libc_i32("PTHREAD_MUTEX_DEFAULT"); - mutexattr_set_kind(this, attr_op, default_kind)?; + mutexattr_set_kind(this, attr_op, PTHREAD_MUTEX_KIND_UNCHANGED)?; Ok(()) } @@ -394,30 +401,13 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { let this = self.eval_context_mut(); let kind = this.read_scalar(kind_op)?.to_i32()?; - if kind == this.eval_libc_i32("PTHREAD_MUTEX_NORMAL") { - // In `glibc` implementation, the numeric values of - // `PTHREAD_MUTEX_NORMAL` and `PTHREAD_MUTEX_DEFAULT` are equal. - // However, a mutex created by explicitly passing - // `PTHREAD_MUTEX_NORMAL` type has in some cases different behaviour - // from the default mutex for which the type was not explicitly - // specified. For a more detailed discussion, please see - // https://github.com/rust-lang/miri/issues/1419. - // - // To distinguish these two cases in already constructed mutexes, we - // use the same trick as glibc: for the case when - // `pthread_mutexattr_settype` is called explicitly, we set the - // `PTHREAD_MUTEX_NORMAL_FLAG` flag. - let normal_kind = kind | PTHREAD_MUTEX_NORMAL_FLAG; - // Check that after setting the flag, the kind is distinguishable - // from all other kinds. - assert_ne!(normal_kind, this.eval_libc_i32("PTHREAD_MUTEX_DEFAULT")); - assert_ne!(normal_kind, this.eval_libc_i32("PTHREAD_MUTEX_ERRORCHECK")); - assert_ne!(normal_kind, this.eval_libc_i32("PTHREAD_MUTEX_RECURSIVE")); - mutexattr_set_kind(this, attr_op, normal_kind)?; - } else if kind == this.eval_libc_i32("PTHREAD_MUTEX_DEFAULT") + if kind == this.eval_libc_i32("PTHREAD_MUTEX_NORMAL") + || kind == this.eval_libc_i32("PTHREAD_MUTEX_DEFAULT") || kind == this.eval_libc_i32("PTHREAD_MUTEX_ERRORCHECK") || kind == this.eval_libc_i32("PTHREAD_MUTEX_RECURSIVE") { + // Make sure we do not mix this up with the "unchanged" kind. + assert_ne!(kind, PTHREAD_MUTEX_KIND_UNCHANGED); mutexattr_set_kind(this, attr_op, kind)?; } else { let einval = this.eval_libc_i32("EINVAL"); @@ -461,9 +451,9 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { let attr = this.read_pointer(attr_op)?; let kind = if this.ptr_is_null(attr)? { - this.eval_libc_i32("PTHREAD_MUTEX_DEFAULT") + MutexKind::Default } else { - mutexattr_get_kind(this, attr_op)? + mutex_translate_kind(this, mutexattr_get_kind(this, attr_op)?)? }; mutex_create(this, mutex_op, kind)?; @@ -479,8 +469,10 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { let this = self.eval_context_mut(); let id = mutex_get_id(this, mutex_op)?; - let kind = - this.mutex_get_data(id).expect("data should always exist for pthread mutexes").kind; + let kind = this + .mutex_get_data::(id) + .expect("data should always exist for pthread mutexes") + .kind; let ret = if this.mutex_is_locked(id) { let owner_thread = this.mutex_get_owner(id); @@ -498,10 +490,6 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { this.mutex_lock(id); 0 } - _ => - throw_unsup_format!( - "called pthread_mutex_lock on an unsupported type of mutex" - ), } } } else { @@ -517,8 +505,10 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { let this = self.eval_context_mut(); let id = mutex_get_id(this, mutex_op)?; - let kind = - this.mutex_get_data(id).expect("data should always exist for pthread mutexes").kind; + let kind = this + .mutex_get_data::(id) + .expect("data should always exist for pthread mutexes") + .kind; Ok(Scalar::from_i32(if this.mutex_is_locked(id) { let owner_thread = this.mutex_get_owner(id); @@ -532,10 +522,6 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { this.mutex_lock(id); 0 } - _ => - throw_unsup_format!( - "called pthread_mutex_trylock on an unsupported type of mutex" - ), } } } else { @@ -549,8 +535,10 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { let this = self.eval_context_mut(); let id = mutex_get_id(this, mutex_op)?; - let kind = - this.mutex_get_data(id).expect("data should always exist for pthread mutexes").kind; + let kind = this + .mutex_get_data::(id) + .expect("data should always exist for pthread mutexes") + .kind; if let Some(_old_locked_count) = this.mutex_unlock(id)? { // The mutex was locked by the current thread. @@ -570,10 +558,6 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { ), MutexKind::ErrorCheck | MutexKind::Recursive => Ok(Scalar::from_i32(this.eval_libc_i32("EPERM"))), - _ => - throw_unsup_format!( - "called pthread_mutex_unlock on an unsupported type of mutex" - ), } } } @@ -581,15 +565,14 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { fn pthread_mutex_destroy(&mut self, mutex_op: &OpTy<'tcx>) -> InterpResult<'tcx, ()> { let this = self.eval_context_mut(); + // Reading the field also has the side-effect that we detect double-`destroy` + // since we make the field unint below. let id = mutex_get_id(this, mutex_op)?; if this.mutex_is_locked(id) { throw_ub_format!("destroyed a locked mutex"); } - // Destroying an uninit pthread_mutex is UB, so check to make sure it's not uninit. - mutex_get_id(this, mutex_op)?; - // This might lead to false positives, see comment in pthread_mutexattr_destroy this.write_uninit( &this.deref_pointer_as(mutex_op, this.libc_ty_layout("pthread_mutex_t"))?, @@ -691,15 +674,14 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { fn pthread_rwlock_destroy(&mut self, rwlock_op: &OpTy<'tcx>) -> InterpResult<'tcx, ()> { let this = self.eval_context_mut(); + // Reading the field also has the side-effect that we detect double-`destroy` + // since we make the field unint below. let id = rwlock_get_id(this, rwlock_op)?; if this.rwlock_is_locked(id) { throw_ub_format!("destroyed a locked rwlock"); } - // Destroying an uninit pthread_rwlock is UB, so check to make sure it's not uninit. - rwlock_get_id(this, rwlock_op)?; - // This might lead to false positives, see comment in pthread_mutexattr_destroy this.write_uninit( &this.deref_pointer_as(rwlock_op, this.libc_ty_layout("pthread_rwlock_t"))?, @@ -789,11 +771,15 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { } else { condattr_get_clock_id(this, attr_op)? }; - - // Write 0 to use the same code path as the static initializers. - cond_reset_id(this, cond_op)?; - - cond_set_clock_id(this, cond_op, clock_id)?; + let clock_id = cond_translate_clock_id(this, clock_id)?; + + let cond = this.deref_pointer(cond_op)?; + let address = cond.ptr().addr().bytes(); + this.condvar_create( + &cond, + cond_id_offset(this)?, + Some(Box::new(AdditionalCondData { address, clock_id })), + )?; Ok(()) } @@ -848,7 +834,10 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { let mutex_id = mutex_get_id(this, mutex_op)?; // Extract the timeout. - let clock_id = cond_get_clock_id(this, cond_op)?; + let clock_id = this + .condvar_get_data::(id) + .expect("additional data should always be present for pthreads") + .clock_id; let duration = match this .read_timespec(&this.deref_pointer_as(abstime_op, this.libc_ty_layout("timespec"))?)? { @@ -859,13 +848,12 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { return Ok(()); } }; - let timeout_clock = if is_cond_clock_realtime(this, clock_id) { - this.check_no_isolation("`pthread_cond_timedwait` with `CLOCK_REALTIME`")?; - TimeoutClock::RealTime - } else if clock_id == this.eval_libc_i32("CLOCK_MONOTONIC") { - TimeoutClock::Monotonic - } else { - throw_unsup_format!("unsupported clock id: {}", clock_id); + let timeout_clock = match clock_id { + ClockId::Realtime => { + this.check_no_isolation("`pthread_cond_timedwait` with `CLOCK_REALTIME`")?; + TimeoutClock::RealTime + } + ClockId::Monotonic => TimeoutClock::Monotonic, }; this.condvar_wait( @@ -883,15 +871,13 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { fn pthread_cond_destroy(&mut self, cond_op: &OpTy<'tcx>) -> InterpResult<'tcx, ()> { let this = self.eval_context_mut(); + // Reading the field also has the side-effect that we detect double-`destroy` + // since we make the field unint below. let id = cond_get_id(this, cond_op)?; if this.condvar_is_awaited(id) { throw_ub_format!("destroying an awaited conditional variable"); } - // Destroying an uninit pthread_cond is UB, so check to make sure it's not uninit. - cond_get_id(this, cond_op)?; - cond_get_clock_id(this, cond_op)?; - // This might lead to false positives, see comment in pthread_mutexattr_destroy this.write_uninit(&this.deref_pointer_as(cond_op, this.libc_ty_layout("pthread_cond_t"))?)?; // FIXME: delete interpreter state associated with this condvar. diff --git a/src/tools/miri/src/shims/windows/sync.rs b/src/tools/miri/src/shims/windows/sync.rs index e1fbb77037cfb..51b0129356baa 100644 --- a/src/tools/miri/src/shims/windows/sync.rs +++ b/src/tools/miri/src/shims/windows/sync.rs @@ -10,9 +10,10 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> { // Windows sync primitives are pointer sized. // We only use the first 4 bytes for the id. - fn init_once_get_id(&mut self, init_once_op: &OpTy<'tcx>) -> InterpResult<'tcx, InitOnceId> { + fn init_once_get_id(&mut self, init_once_ptr: &OpTy<'tcx>) -> InterpResult<'tcx, InitOnceId> { let this = self.eval_context_mut(); - this.init_once_get_or_create_id(init_once_op, this.windows_ty_layout("INIT_ONCE"), 0) + let init_once = this.deref_pointer(init_once_ptr)?; + this.init_once_get_or_create_id(&init_once, 0) } /// Returns `true` if we were succssful, `false` if we would block. diff --git a/src/tools/miri/test_dependencies/Cargo.lock b/src/tools/miri/test_dependencies/Cargo.lock index 39d412817289d..9a4431eb7048d 100644 --- a/src/tools/miri/test_dependencies/Cargo.lock +++ b/src/tools/miri/test_dependencies/Cargo.lock @@ -172,6 +172,7 @@ dependencies = [ name = "miri-test-deps" version = "0.1.0" dependencies = [ + "cfg-if", "getrandom 0.1.16", "getrandom 0.2.15", "libc", diff --git a/src/tools/miri/test_dependencies/Cargo.toml b/src/tools/miri/test_dependencies/Cargo.toml index c24422df26cf2..e7eff46afca52 100644 --- a/src/tools/miri/test_dependencies/Cargo.toml +++ b/src/tools/miri/test_dependencies/Cargo.toml @@ -11,6 +11,7 @@ edition = "2021" # all dependencies (and their transitive ones) listed here can be used in `tests/`. libc = "0.2" num_cpus = "1.10.1" +cfg-if = "1" getrandom_01 = { package = "getrandom", version = "0.1" } getrandom_02 = { package = "getrandom", version = "0.2", features = ["js"] } diff --git a/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_assert_not_owner.rs b/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_assert_not_owner.rs index d6604f3713946..546909a13ea5f 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_assert_not_owner.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_assert_not_owner.rs @@ -1,4 +1,4 @@ -//@ only-target-darwin +//@only-target: darwin use std::cell::UnsafeCell; diff --git a/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_assert_not_owner.stderr b/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_assert_not_owner.stderr index 7e890681c436a..3fd02d38aae4f 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_assert_not_owner.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_assert_not_owner.stderr @@ -1,11 +1,11 @@ error: abnormal termination: called os_unfair_lock_assert_not_owner on an os_unfair_lock owned by the current thread - --> $DIR/apple_os_unfair_lock_assert_not_owner.rs:LL:CC + --> tests/fail-dep/concurrency/apple_os_unfair_lock_assert_not_owner.rs:LL:CC | LL | libc::os_unfair_lock_assert_not_owner(lock.get()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ called os_unfair_lock_assert_not_owner on an os_unfair_lock owned by the current thread | = note: BACKTRACE: - = note: inside `main` at $DIR/apple_os_unfair_lock_assert_not_owner.rs:LL:CC + = note: inside `main` at tests/fail-dep/concurrency/apple_os_unfair_lock_assert_not_owner.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_assert_owner.rs b/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_assert_owner.rs index ddd8b572eaf0b..4cbd34329f8ff 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_assert_owner.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_assert_owner.rs @@ -1,4 +1,4 @@ -//@ only-target-darwin +//@only-target: darwin use std::cell::UnsafeCell; diff --git a/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_assert_owner.stderr b/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_assert_owner.stderr index 3724f7996fb8b..0b5dfe4ba61b8 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_assert_owner.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_assert_owner.stderr @@ -1,11 +1,11 @@ error: abnormal termination: called os_unfair_lock_assert_owner on an os_unfair_lock not owned by the current thread - --> $DIR/apple_os_unfair_lock_assert_owner.rs:LL:CC + --> tests/fail-dep/concurrency/apple_os_unfair_lock_assert_owner.rs:LL:CC | LL | libc::os_unfair_lock_assert_owner(lock.get()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ called os_unfair_lock_assert_owner on an os_unfair_lock not owned by the current thread | = note: BACKTRACE: - = note: inside `main` at $DIR/apple_os_unfair_lock_assert_owner.rs:LL:CC + = note: inside `main` at tests/fail-dep/concurrency/apple_os_unfair_lock_assert_owner.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_reentrant.rs b/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_reentrant.rs index eb98adeba0730..a13e85733958e 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_reentrant.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_reentrant.rs @@ -1,4 +1,4 @@ -//@ only-target-darwin +//@only-target: darwin use std::cell::UnsafeCell; diff --git a/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_reentrant.stderr b/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_reentrant.stderr index 644462a1b05f9..3b02936b1f214 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_reentrant.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_reentrant.stderr @@ -1,11 +1,11 @@ error: abnormal termination: attempted to lock an os_unfair_lock that is already locked by the current thread - --> $DIR/apple_os_unfair_lock_reentrant.rs:LL:CC + --> tests/fail-dep/concurrency/apple_os_unfair_lock_reentrant.rs:LL:CC | LL | libc::os_unfair_lock_lock(lock.get()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempted to lock an os_unfair_lock that is already locked by the current thread | = note: BACKTRACE: - = note: inside `main` at $DIR/apple_os_unfair_lock_reentrant.rs:LL:CC + = note: inside `main` at tests/fail-dep/concurrency/apple_os_unfair_lock_reentrant.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_unowned.rs b/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_unowned.rs index aed467552ab9f..2bef8bcca4d1a 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_unowned.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_unowned.rs @@ -1,4 +1,4 @@ -//@ only-target-darwin +//@only-target: darwin use std::cell::UnsafeCell; diff --git a/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_unowned.stderr b/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_unowned.stderr index 6a8d12fa80760..192e1cdc47527 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_unowned.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_unowned.stderr @@ -1,11 +1,11 @@ error: abnormal termination: attempted to unlock an os_unfair_lock not owned by the current thread - --> $DIR/apple_os_unfair_lock_unowned.rs:LL:CC + --> tests/fail-dep/concurrency/apple_os_unfair_lock_unowned.rs:LL:CC | LL | libc::os_unfair_lock_unlock(lock.get()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempted to unlock an os_unfair_lock not owned by the current thread | = note: BACKTRACE: - = note: inside `main` at $DIR/apple_os_unfair_lock_unowned.rs:LL:CC + = note: inside `main` at tests/fail-dep/concurrency/apple_os_unfair_lock_unowned.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_double_destroy.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_double_destroy.rs index f22f17be0df56..047fe07df14b4 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_double_destroy.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_double_destroy.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No pthreads on Windows +//@ignore-target: windows # No pthreads on Windows /// Test that destroying a pthread_cond twice fails, even without a check for number validity diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_double_destroy.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_double_destroy.stderr index 899c217efbff7..4cf1b4af12ada 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_double_destroy.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_double_destroy.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory - --> $DIR/libc_pthread_cond_double_destroy.rs:LL:CC + --> tests/fail-dep/concurrency/libc_pthread_cond_double_destroy.rs:LL:CC | LL | libc::pthread_cond_destroy(cond.as_mut_ptr()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory @@ -7,7 +7,7 @@ LL | libc::pthread_cond_destroy(cond.as_mut_ptr()); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/libc_pthread_cond_double_destroy.rs:LL:CC + = note: inside `main` at tests/fail-dep/concurrency/libc_pthread_cond_double_destroy.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_move.init.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_move.init.stderr new file mode 100644 index 0000000000000..6e90c490a231c --- /dev/null +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_move.init.stderr @@ -0,0 +1,20 @@ +error: Undefined Behavior: pthread_cond_t can't be moved after first use + --> tests/fail-dep/concurrency/libc_pthread_cond_move.rs:LL:CC + | +LL | libc::pthread_cond_destroy(cond2.as_mut_ptr()); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pthread_cond_t can't be moved after first use + | + = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior + = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: BACKTRACE: + = note: inside `check` at tests/fail-dep/concurrency/libc_pthread_cond_move.rs:LL:CC +note: inside `main` + --> tests/fail-dep/concurrency/libc_pthread_cond_move.rs:LL:CC + | +LL | check() + | ^^^^^^^ + +note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace + +error: aborting due to 1 previous error + diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_move.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_move.rs new file mode 100644 index 0000000000000..8fd0caac75189 --- /dev/null +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_move.rs @@ -0,0 +1,37 @@ +//@revisions: static_initializer init +//@ignore-target: windows # No pthreads on Windows + +/// Test that moving a pthread_cond between uses fails. + +fn main() { + check() +} + +#[cfg(init)] +fn check() { + unsafe { + use core::mem::MaybeUninit; + let mut cond = MaybeUninit::::uninit(); + + libc::pthread_cond_init(cond.as_mut_ptr(), std::ptr::null()); + + // move pthread_cond_t + let mut cond2 = cond; + + libc::pthread_cond_destroy(cond2.as_mut_ptr()); //~[init] ERROR: pthread_cond_t can't be moved after first use + } +} + +#[cfg(static_initializer)] +fn check() { + unsafe { + let mut cond = libc::PTHREAD_COND_INITIALIZER; + + libc::pthread_cond_signal(&mut cond as *mut _); + + // move pthread_cond_t + let mut cond2 = cond; + + libc::pthread_cond_destroy(&mut cond2 as *mut _); //~[static_initializer] ERROR: pthread_cond_t can't be moved after first use + } +} diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_move.static_initializer.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_move.static_initializer.stderr new file mode 100644 index 0000000000000..ba726ac7f386e --- /dev/null +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_move.static_initializer.stderr @@ -0,0 +1,20 @@ +error: Undefined Behavior: pthread_cond_t can't be moved after first use + --> tests/fail-dep/concurrency/libc_pthread_cond_move.rs:LL:CC + | +LL | libc::pthread_cond_destroy(&mut cond2 as *mut _); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pthread_cond_t can't be moved after first use + | + = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior + = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: BACKTRACE: + = note: inside `check` at tests/fail-dep/concurrency/libc_pthread_cond_move.rs:LL:CC +note: inside `main` + --> tests/fail-dep/concurrency/libc_pthread_cond_move.rs:LL:CC + | +LL | check() + | ^^^^^^^ + +note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace + +error: aborting due to 1 previous error + diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_condattr_double_destroy.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_condattr_double_destroy.rs index d0ccab4de5b58..90e33d58673a2 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_condattr_double_destroy.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_condattr_double_destroy.rs @@ -1,5 +1,5 @@ -//@ignore-target-windows: No pthreads on Windows -//@ignore-target-apple: Our macOS condattr don't have any fields so we do not notice this. +//@ignore-target: windows # No pthreads on Windows +//@ignore-target: apple # Our macOS condattr don't have any fields so we do not notice this. /// Test that destroying a pthread_condattr twice fails, even without a check for number validity diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_condattr_double_destroy.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_condattr_double_destroy.stderr index ef75b03162d79..f2ddf9ae92e8f 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_condattr_double_destroy.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_condattr_double_destroy.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory - --> $DIR/libc_pthread_condattr_double_destroy.rs:LL:CC + --> tests/fail-dep/concurrency/libc_pthread_condattr_double_destroy.rs:LL:CC | LL | libc::pthread_condattr_destroy(attr.as_mut_ptr()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory @@ -7,7 +7,7 @@ LL | libc::pthread_condattr_destroy(attr.as_mut_ptr()); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/libc_pthread_condattr_double_destroy.rs:LL:CC + = note: inside `main` at tests/fail-dep/concurrency/libc_pthread_condattr_double_destroy.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_create_main_terminate.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_create_main_terminate.rs index 9cd0a35d36e94..d4a9f076bfdae 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_create_main_terminate.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_create_main_terminate.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No pthreads on Windows +//@ignore-target: windows # No pthreads on Windows //@error-in-other-file: the main thread terminated without waiting for all remaining threads // Check that we terminate the program when the main thread terminates. diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_create_too_few_args.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_create_too_few_args.rs index 39b1c3007cb00..d4accdba5d73e 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_create_too_few_args.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_create_too_few_args.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No pthreads on Windows +//@ignore-target: windows # No pthreads on Windows //~^ERROR: calling a function with more arguments than it expected //! The thread function must have exactly one argument. diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_create_too_many_args.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_create_too_many_args.rs index fc2ab71dff735..0af3600854ddb 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_create_too_many_args.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_create_too_many_args.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No pthreads on Windows +//@ignore-target: windows # No pthreads on Windows //~^ERROR: calling a function with fewer arguments than it requires //! The thread function must have exactly one argument. diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_detached.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_detached.rs index e89d7a9f02b92..472d07f617ea6 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_detached.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_detached.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No pthreads on Windows +//@ignore-target: windows # No pthreads on Windows // Joining a detached thread is undefined behavior. diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_detached.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_detached.stderr index 7238dfb40b723..327737a0b3f07 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_detached.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_detached.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: trying to join a detached thread - --> $DIR/libc_pthread_join_detached.rs:LL:CC + --> tests/fail-dep/concurrency/libc_pthread_join_detached.rs:LL:CC | LL | assert_eq!(libc::pthread_join(native, ptr::null_mut()), 0); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to join a detached thread @@ -7,7 +7,7 @@ LL | assert_eq!(libc::pthread_join(native, ptr::null_mut()), 0); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/libc_pthread_join_detached.rs:LL:CC + = note: inside `main` at tests/fail-dep/concurrency/libc_pthread_join_detached.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_joined.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_joined.rs index cbad743ca5633..988c33868a639 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_joined.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_joined.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No pthreads on Windows +//@ignore-target: windows # No pthreads on Windows // Joining an already joined thread is undefined behavior. diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_joined.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_joined.stderr index e501a086cca4d..1dd1cb9f73185 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_joined.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_joined.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: trying to join an already joined thread - --> $DIR/libc_pthread_join_joined.rs:LL:CC + --> tests/fail-dep/concurrency/libc_pthread_join_joined.rs:LL:CC | LL | assert_eq!(libc::pthread_join(native, ptr::null_mut()), 0); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to join an already joined thread @@ -7,7 +7,7 @@ LL | assert_eq!(libc::pthread_join(native, ptr::null_mut()), 0); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/libc_pthread_join_joined.rs:LL:CC + = note: inside `main` at tests/fail-dep/concurrency/libc_pthread_join_joined.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_main.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_main.rs index 002498e6c8263..b47c0121a3eee 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_main.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_main.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No pthreads on Windows +//@ignore-target: windows # No pthreads on Windows // Joining the main thread is undefined behavior. diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_main.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_main.stderr index e27e88dda2d71..b04a18561fdfc 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_main.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_main.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: trying to join a detached thread - --> $DIR/libc_pthread_join_main.rs:LL:CC + --> tests/fail-dep/concurrency/libc_pthread_join_main.rs:LL:CC | LL | assert_eq!(libc::pthread_join(thread_id, ptr::null_mut()), 0); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to join a detached thread @@ -7,7 +7,7 @@ LL | assert_eq!(libc::pthread_join(thread_id, ptr::null_mut()), 0); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE on thread `unnamed-ID`: - = note: inside closure at $DIR/libc_pthread_join_main.rs:LL:CC + = note: inside closure at tests/fail-dep/concurrency/libc_pthread_join_main.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_multiple.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_multiple.rs index f5b687a623f73..6a49625d75d60 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_multiple.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_multiple.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No pthreads on Windows +//@ignore-target: windows # No pthreads on Windows // Joining the same thread from multiple threads is undefined behavior. diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_multiple.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_multiple.stderr index 6a7b237e5b306..1ada476811ea0 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_multiple.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_multiple.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: trying to join an already joined thread - --> $DIR/libc_pthread_join_multiple.rs:LL:CC + --> tests/fail-dep/concurrency/libc_pthread_join_multiple.rs:LL:CC | LL | ... assert_eq!(libc::pthread_join(native_copy, ptr::null_mut()), 0); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to join an already joined thread @@ -7,7 +7,7 @@ LL | ... assert_eq!(libc::pthread_join(native_copy, ptr::null_mut()), 0); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE on thread `unnamed-ID`: - = note: inside closure at $DIR/libc_pthread_join_multiple.rs:LL:CC + = note: inside closure at tests/fail-dep/concurrency/libc_pthread_join_multiple.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_self.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_self.rs index 4bc1c82a254c5..53760b05a3127 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_self.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_self.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No pthreads on Windows +//@ignore-target: windows # No pthreads on Windows // We are making scheduler assumptions here. //@compile-flags: -Zmiri-preemption-rate=0 diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_self.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_self.stderr index 258c5f26c7a39..6aa85086a83bd 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_self.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_self.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: trying to join itself - --> $DIR/libc_pthread_join_self.rs:LL:CC + --> tests/fail-dep/concurrency/libc_pthread_join_self.rs:LL:CC | LL | assert_eq!(libc::pthread_join(native, ptr::null_mut()), 0); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to join itself @@ -7,7 +7,7 @@ LL | assert_eq!(libc::pthread_join(native, ptr::null_mut()), 0); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE on thread `unnamed-ID`: - = note: inside closure at $DIR/libc_pthread_join_self.rs:LL:CC + = note: inside closure at tests/fail-dep/concurrency/libc_pthread_join_self.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_NULL_deadlock.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_NULL_deadlock.rs index 0a494c53b4b5c..a79abe65328e0 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_NULL_deadlock.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_NULL_deadlock.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No pthreads on Windows +//@ignore-target: windows # No pthreads on Windows // // Check that if we pass NULL attribute, then we get the default mutex type. diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_NULL_deadlock.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_NULL_deadlock.stderr index 3675ce49f30e4..e9961ed413d0c 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_NULL_deadlock.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_NULL_deadlock.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: trying to acquire already locked default mutex - --> $DIR/libc_pthread_mutex_NULL_deadlock.rs:LL:CC + --> tests/fail-dep/concurrency/libc_pthread_mutex_NULL_deadlock.rs:LL:CC | LL | libc::pthread_mutex_lock(&mut mutex as *mut _); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to acquire already locked default mutex @@ -7,7 +7,7 @@ LL | libc::pthread_mutex_lock(&mut mutex as *mut _); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/libc_pthread_mutex_NULL_deadlock.rs:LL:CC + = note: inside `main` at tests/fail-dep/concurrency/libc_pthread_mutex_NULL_deadlock.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_deadlock.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_deadlock.rs index 0328115c63759..e3d5da26aeae4 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_deadlock.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_deadlock.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No pthreads on Windows +//@ignore-target: windows # No pthreads on Windows //@error-in-other-file: deadlock use std::cell::UnsafeCell; diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_deadlock.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_deadlock.stderr index 079c1729b600f..534cacaed593c 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_deadlock.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_deadlock.stderr @@ -1,11 +1,11 @@ error: deadlock: the evaluated program deadlocked - --> $DIR/libc_pthread_mutex_deadlock.rs:LL:CC + --> tests/fail-dep/concurrency/libc_pthread_mutex_deadlock.rs:LL:CC | LL | assert_eq!(libc::pthread_mutex_lock(lock_copy.0.get() as *mut _), 0); | ^ the evaluated program deadlocked | = note: BACKTRACE on thread `unnamed-ID`: - = note: inside closure at $DIR/libc_pthread_mutex_deadlock.rs:LL:CC + = note: inside closure at tests/fail-dep/concurrency/libc_pthread_mutex_deadlock.rs:LL:CC error: deadlock: the evaluated program deadlocked --> RUSTLIB/std/src/sys/pal/PLATFORM/thread.rs:LL:CC @@ -18,7 +18,7 @@ LL | let ret = unsafe { libc::pthread_join(id, ptr::null_mut()) }; = note: inside `std::thread::JoinInner::<'_, ()>::join` at RUSTLIB/std/src/thread/mod.rs:LL:CC = note: inside `std::thread::JoinHandle::<()>::join` at RUSTLIB/std/src/thread/mod.rs:LL:CC note: inside `main` - --> $DIR/libc_pthread_mutex_deadlock.rs:LL:CC + --> tests/fail-dep/concurrency/libc_pthread_mutex_deadlock.rs:LL:CC | LL | / thread::spawn(move || { LL | | assert_eq!(libc::pthread_mutex_lock(lock_copy.0.get() as *mut _), 0); diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_default_deadlock.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_default_deadlock.rs index 1038b8988f99f..d9293f938b6aa 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_default_deadlock.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_default_deadlock.rs @@ -1,10 +1,11 @@ -//@ignore-target-windows: No pthreads on Windows +//@ignore-target: windows # No pthreads on Windows // // Check that if we do not set the mutex type, it is the default. fn main() { unsafe { - let mutexattr: libc::pthread_mutexattr_t = std::mem::zeroed(); + let mut mutexattr: libc::pthread_mutexattr_t = std::mem::zeroed(); + assert_eq!(libc::pthread_mutexattr_init(&mut mutexattr as *mut _), 0); let mut mutex: libc::pthread_mutex_t = std::mem::zeroed(); assert_eq!(libc::pthread_mutex_init(&mut mutex as *mut _, &mutexattr as *const _), 0); assert_eq!(libc::pthread_mutex_lock(&mut mutex as *mut _), 0); diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_default_deadlock.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_default_deadlock.stderr index 4d41141b545f8..a57d10753d90d 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_default_deadlock.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_default_deadlock.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: trying to acquire already locked default mutex - --> $DIR/libc_pthread_mutex_default_deadlock.rs:LL:CC + --> tests/fail-dep/concurrency/libc_pthread_mutex_default_deadlock.rs:LL:CC | LL | libc::pthread_mutex_lock(&mut mutex as *mut _); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to acquire already locked default mutex @@ -7,7 +7,7 @@ LL | libc::pthread_mutex_lock(&mut mutex as *mut _); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/libc_pthread_mutex_default_deadlock.rs:LL:CC + = note: inside `main` at tests/fail-dep/concurrency/libc_pthread_mutex_default_deadlock.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_destroy_locked.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_destroy_locked.rs index e474712cfd994..35998c95f6f5c 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_destroy_locked.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_destroy_locked.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No pthreads on Windows +//@ignore-target: windows # No pthreads on Windows fn main() { unsafe { diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_destroy_locked.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_destroy_locked.stderr index ed5e27b607a5d..38f38b4283a27 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_destroy_locked.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_destroy_locked.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: destroyed a locked mutex - --> $DIR/libc_pthread_mutex_destroy_locked.rs:LL:CC + --> tests/fail-dep/concurrency/libc_pthread_mutex_destroy_locked.rs:LL:CC | LL | libc::pthread_mutex_destroy(&mut mutex as *mut _); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ destroyed a locked mutex @@ -7,7 +7,7 @@ LL | libc::pthread_mutex_destroy(&mut mutex as *mut _); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/libc_pthread_mutex_destroy_locked.rs:LL:CC + = note: inside `main` at tests/fail-dep/concurrency/libc_pthread_mutex_destroy_locked.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_double_destroy.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_double_destroy.rs index 46f0c5f8d72ee..1792c227e132d 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_double_destroy.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_double_destroy.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No pthreads on Windows +//@ignore-target: windows # No pthreads on Windows /// Test that destroying a pthread_mutex twice fails, even without a check for number validity diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_double_destroy.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_double_destroy.stderr index 05b35ee3b30a1..72ad2db75aa20 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_double_destroy.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_double_destroy.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory - --> $DIR/libc_pthread_mutex_double_destroy.rs:LL:CC + --> tests/fail-dep/concurrency/libc_pthread_mutex_double_destroy.rs:LL:CC | LL | libc::pthread_mutex_destroy(mutex.as_mut_ptr()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory @@ -7,7 +7,7 @@ LL | libc::pthread_mutex_destroy(mutex.as_mut_ptr()); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/libc_pthread_mutex_double_destroy.rs:LL:CC + = note: inside `main` at tests/fail-dep/concurrency/libc_pthread_mutex_double_destroy.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_move.init.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_move.init.stderr index 5ca6acc3fbe6e..15f397d4ac298 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_move.init.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_move.init.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: pthread_mutex_t can't be moved after first use - --> $DIR/libc_pthread_mutex_move.rs:LL:CC + --> tests/fail-dep/concurrency/libc_pthread_mutex_move.rs:LL:CC | LL | libc::pthread_mutex_lock(&mut m2 as *mut _); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pthread_mutex_t can't be moved after first use @@ -7,9 +7,9 @@ LL | libc::pthread_mutex_lock(&mut m2 as *mut _); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `check` at $DIR/libc_pthread_mutex_move.rs:LL:CC + = note: inside `check` at tests/fail-dep/concurrency/libc_pthread_mutex_move.rs:LL:CC note: inside `main` - --> $DIR/libc_pthread_mutex_move.rs:LL:CC + --> tests/fail-dep/concurrency/libc_pthread_mutex_move.rs:LL:CC | LL | check(); | ^^^^^^^ diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_move.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_move.rs index 229335c97ce18..c12a97a9ca18f 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_move.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_move.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No pthreads on Windows +//@ignore-target: windows # No pthreads on Windows //@revisions: static_initializer init fn main() { diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_move.static_initializer.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_move.static_initializer.stderr index c3632eca43ffa..ebc253bf7a67c 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_move.static_initializer.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_move.static_initializer.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: pthread_mutex_t can't be moved after first use - --> $DIR/libc_pthread_mutex_move.rs:LL:CC + --> tests/fail-dep/concurrency/libc_pthread_mutex_move.rs:LL:CC | LL | libc::pthread_mutex_unlock(&mut m2 as *mut _); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pthread_mutex_t can't be moved after first use @@ -7,9 +7,9 @@ LL | libc::pthread_mutex_unlock(&mut m2 as *mut _); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `check` at $DIR/libc_pthread_mutex_move.rs:LL:CC + = note: inside `check` at tests/fail-dep/concurrency/libc_pthread_mutex_move.rs:LL:CC note: inside `main` - --> $DIR/libc_pthread_mutex_move.rs:LL:CC + --> tests/fail-dep/concurrency/libc_pthread_mutex_move.rs:LL:CC | LL | check(); | ^^^^^^^ diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_deadlock.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_deadlock.rs index f311934e28bb3..b38582482b88b 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_deadlock.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_deadlock.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No pthreads on Windows +//@ignore-target: windows # No pthreads on Windows fn main() { unsafe { diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_deadlock.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_deadlock.stderr index 334c14ebf04f2..4337475963e4a 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_deadlock.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_deadlock.stderr @@ -1,11 +1,11 @@ error: deadlock: the evaluated program deadlocked - --> $DIR/libc_pthread_mutex_normal_deadlock.rs:LL:CC + --> tests/fail-dep/concurrency/libc_pthread_mutex_normal_deadlock.rs:LL:CC | LL | libc::pthread_mutex_lock(&mut mutex as *mut _); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program deadlocked | = note: BACKTRACE: - = note: inside `main` at $DIR/libc_pthread_mutex_normal_deadlock.rs:LL:CC + = note: inside `main` at tests/fail-dep/concurrency/libc_pthread_mutex_normal_deadlock.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_unlock_unlocked.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_unlock_unlocked.rs index 2b5886dc16375..50b5504905000 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_unlock_unlocked.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_unlock_unlocked.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No pthreads on Windows +//@ignore-target: windows # No pthreads on Windows fn main() { unsafe { diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_unlock_unlocked.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_unlock_unlocked.stderr index d717b4ec56b67..db08496889ed2 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_unlock_unlocked.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_unlock_unlocked.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: unlocked a PTHREAD_MUTEX_NORMAL mutex that was not locked by the current thread - --> $DIR/libc_pthread_mutex_normal_unlock_unlocked.rs:LL:CC + --> tests/fail-dep/concurrency/libc_pthread_mutex_normal_unlock_unlocked.rs:LL:CC | LL | libc::pthread_mutex_unlock(&mut mutex as *mut _); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unlocked a PTHREAD_MUTEX_NORMAL mutex that was not locked by the current thread @@ -7,7 +7,7 @@ LL | libc::pthread_mutex_unlock(&mut mutex as *mut _); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/libc_pthread_mutex_normal_unlock_unlocked.rs:LL:CC + = note: inside `main` at tests/fail-dep/concurrency/libc_pthread_mutex_normal_unlock_unlocked.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_wrong_owner.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_wrong_owner.rs index 686a394f7cb9b..84c72fd9ba154 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_wrong_owner.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_wrong_owner.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No pthreads on Windows +//@ignore-target: windows # No pthreads on Windows use std::cell::UnsafeCell; use std::sync::Arc; diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_wrong_owner.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_wrong_owner.stderr index b8ec2d6d01822..97c92e828e6ed 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_wrong_owner.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_wrong_owner.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: unlocked a default mutex that was not locked by the current thread - --> $DIR/libc_pthread_mutex_wrong_owner.rs:LL:CC + --> tests/fail-dep/concurrency/libc_pthread_mutex_wrong_owner.rs:LL:CC | LL | ...t_eq!(libc::pthread_mutex_unlock(lock_copy.0.get() as *mut _), 0); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unlocked a default mutex that was not locked by the current thread @@ -7,7 +7,7 @@ LL | ...t_eq!(libc::pthread_mutex_unlock(lock_copy.0.get() as *mut _), 0); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE on thread `unnamed-ID`: - = note: inside closure at $DIR/libc_pthread_mutex_wrong_owner.rs:LL:CC + = note: inside closure at tests/fail-dep/concurrency/libc_pthread_mutex_wrong_owner.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutexattr_double_destroy.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutexattr_double_destroy.rs index 51f00d62b75b5..3711c1f8dc10c 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutexattr_double_destroy.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutexattr_double_destroy.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No pthreads on Windows +//@ignore-target: windows # No pthreads on Windows /// Test that destroying a pthread_mutexattr twice fails, even without a check for number validity diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutexattr_double_destroy.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutexattr_double_destroy.stderr index a8425e6f81d0f..4c39ca003ece9 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutexattr_double_destroy.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutexattr_double_destroy.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory - --> $DIR/libc_pthread_mutexattr_double_destroy.rs:LL:CC + --> tests/fail-dep/concurrency/libc_pthread_mutexattr_double_destroy.rs:LL:CC | LL | libc::pthread_mutexattr_destroy(attr.as_mut_ptr()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory @@ -7,7 +7,7 @@ LL | libc::pthread_mutexattr_destroy(attr.as_mut_ptr()); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/libc_pthread_mutexattr_double_destroy.rs:LL:CC + = note: inside `main` at tests/fail-dep/concurrency/libc_pthread_mutexattr_double_destroy.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_read_locked.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_read_locked.rs index fa4575bc1d4d1..f2c19f981034f 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_read_locked.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_read_locked.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No pthreads on Windows +//@ignore-target: windows # No pthreads on Windows fn main() { let rw = std::cell::UnsafeCell::new(libc::PTHREAD_RWLOCK_INITIALIZER); diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_read_locked.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_read_locked.stderr index bb90545c5034a..0a964da82a690 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_read_locked.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_read_locked.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: destroyed a locked rwlock - --> $DIR/libc_pthread_rwlock_destroy_read_locked.rs:LL:CC + --> tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_read_locked.rs:LL:CC | LL | libc::pthread_rwlock_destroy(rw.get()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ destroyed a locked rwlock @@ -7,7 +7,7 @@ LL | libc::pthread_rwlock_destroy(rw.get()); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/libc_pthread_rwlock_destroy_read_locked.rs:LL:CC + = note: inside `main` at tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_read_locked.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_write_locked.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_write_locked.rs index e734a62bca8db..200477467af57 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_write_locked.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_write_locked.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No pthreads on Windows +//@ignore-target: windows # No pthreads on Windows fn main() { let rw = std::cell::UnsafeCell::new(libc::PTHREAD_RWLOCK_INITIALIZER); diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_write_locked.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_write_locked.stderr index 7210c6a742ae5..cfdadbefe4ef1 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_write_locked.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_write_locked.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: destroyed a locked rwlock - --> $DIR/libc_pthread_rwlock_destroy_write_locked.rs:LL:CC + --> tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_write_locked.rs:LL:CC | LL | libc::pthread_rwlock_destroy(rw.get()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ destroyed a locked rwlock @@ -7,7 +7,7 @@ LL | libc::pthread_rwlock_destroy(rw.get()); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/libc_pthread_rwlock_destroy_write_locked.rs:LL:CC + = note: inside `main` at tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_write_locked.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_double_destroy.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_double_destroy.rs index e96f7fc680382..6a31e972e68b8 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_double_destroy.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_double_destroy.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No pthreads on Windows +//@ignore-target: windows # No pthreads on Windows /// Test that destroying a pthread_rwlock twice fails, even without a check for number validity diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_double_destroy.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_double_destroy.stderr index 5032e98f11619..41c189f3efd56 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_double_destroy.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_double_destroy.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory - --> $DIR/libc_pthread_rwlock_double_destroy.rs:LL:CC + --> tests/fail-dep/concurrency/libc_pthread_rwlock_double_destroy.rs:LL:CC | LL | libc::pthread_rwlock_destroy(&mut lock); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory @@ -7,7 +7,7 @@ LL | libc::pthread_rwlock_destroy(&mut lock); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/libc_pthread_rwlock_double_destroy.rs:LL:CC + = note: inside `main` at tests/fail-dep/concurrency/libc_pthread_rwlock_double_destroy.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_write_deadlock_single_thread.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_write_deadlock_single_thread.rs index dffeee2b794ec..5de70cb38a193 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_write_deadlock_single_thread.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_write_deadlock_single_thread.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No pthreads on Windows +//@ignore-target: windows # No pthreads on Windows fn main() { let rw = std::cell::UnsafeCell::new(libc::PTHREAD_RWLOCK_INITIALIZER); diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_write_deadlock_single_thread.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_write_deadlock_single_thread.stderr index 957458a7ba004..5b5d35bf195bd 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_write_deadlock_single_thread.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_write_deadlock_single_thread.stderr @@ -1,11 +1,11 @@ error: deadlock: the evaluated program deadlocked - --> $DIR/libc_pthread_rwlock_read_write_deadlock_single_thread.rs:LL:CC + --> tests/fail-dep/concurrency/libc_pthread_rwlock_read_write_deadlock_single_thread.rs:LL:CC | LL | libc::pthread_rwlock_wrlock(rw.get()); | ^ the evaluated program deadlocked | = note: BACKTRACE: - = note: inside `main` at $DIR/libc_pthread_rwlock_read_write_deadlock_single_thread.rs:LL:CC + = note: inside `main` at tests/fail-dep/concurrency/libc_pthread_rwlock_read_write_deadlock_single_thread.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_wrong_owner.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_wrong_owner.rs index 328372b22ef93..d59c94238189b 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_wrong_owner.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_wrong_owner.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No pthreads on Windows +//@ignore-target: windows # No pthreads on Windows use std::cell::UnsafeCell; use std::sync::Arc; diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_wrong_owner.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_wrong_owner.stderr index a964a64284adb..d2fccfcc3f0b4 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_wrong_owner.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_wrong_owner.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: unlocked an rwlock that was not locked by the active thread - --> $DIR/libc_pthread_rwlock_read_wrong_owner.rs:LL:CC + --> tests/fail-dep/concurrency/libc_pthread_rwlock_read_wrong_owner.rs:LL:CC | LL | ... assert_eq!(libc::pthread_rwlock_unlock(lock_copy.0.get() as *mut _), 0); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unlocked an rwlock that was not locked by the active thread @@ -7,7 +7,7 @@ LL | ... assert_eq!(libc::pthread_rwlock_unlock(lock_copy.0.get() as *mut _), = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE on thread `unnamed-ID`: - = note: inside closure at $DIR/libc_pthread_rwlock_read_wrong_owner.rs:LL:CC + = note: inside closure at tests/fail-dep/concurrency/libc_pthread_rwlock_read_wrong_owner.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_unlock_unlocked.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_unlock_unlocked.rs index ced6b7a4f613c..ca0444a7b4341 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_unlock_unlocked.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_unlock_unlocked.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No pthreads on Windows +//@ignore-target: windows # No pthreads on Windows fn main() { let rw = std::cell::UnsafeCell::new(libc::PTHREAD_RWLOCK_INITIALIZER); diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_unlock_unlocked.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_unlock_unlocked.stderr index 98b09472904b1..da2a650151dcc 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_unlock_unlocked.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_unlock_unlocked.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: unlocked an rwlock that was not locked by the active thread - --> $DIR/libc_pthread_rwlock_unlock_unlocked.rs:LL:CC + --> tests/fail-dep/concurrency/libc_pthread_rwlock_unlock_unlocked.rs:LL:CC | LL | libc::pthread_rwlock_unlock(rw.get()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unlocked an rwlock that was not locked by the active thread @@ -7,7 +7,7 @@ LL | libc::pthread_rwlock_unlock(rw.get()); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/libc_pthread_rwlock_unlock_unlocked.rs:LL:CC + = note: inside `main` at tests/fail-dep/concurrency/libc_pthread_rwlock_unlock_unlocked.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock.rs index 4174751926d85..3a985122e22e0 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No pthreads on Windows +//@ignore-target: windows # No pthreads on Windows //@error-in-other-file: deadlock use std::cell::UnsafeCell; diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock.stderr index d03c6402d64ff..ae77d79fcd464 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock.stderr @@ -1,11 +1,11 @@ error: deadlock: the evaluated program deadlocked - --> $DIR/libc_pthread_rwlock_write_read_deadlock.rs:LL:CC + --> tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock.rs:LL:CC | LL | assert_eq!(libc::pthread_rwlock_wrlock(lock_copy.0.get() as *mut _), 0); | ^ the evaluated program deadlocked | = note: BACKTRACE on thread `unnamed-ID`: - = note: inside closure at $DIR/libc_pthread_rwlock_write_read_deadlock.rs:LL:CC + = note: inside closure at tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock.rs:LL:CC error: deadlock: the evaluated program deadlocked --> RUSTLIB/std/src/sys/pal/PLATFORM/thread.rs:LL:CC @@ -18,7 +18,7 @@ LL | let ret = unsafe { libc::pthread_join(id, ptr::null_mut()) }; = note: inside `std::thread::JoinInner::<'_, ()>::join` at RUSTLIB/std/src/thread/mod.rs:LL:CC = note: inside `std::thread::JoinHandle::<()>::join` at RUSTLIB/std/src/thread/mod.rs:LL:CC note: inside `main` - --> $DIR/libc_pthread_rwlock_write_read_deadlock.rs:LL:CC + --> tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock.rs:LL:CC | LL | / thread::spawn(move || { LL | | assert_eq!(libc::pthread_rwlock_wrlock(lock_copy.0.get() as *mut _), 0); diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock_single_thread.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock_single_thread.rs index 099b8dcd106ac..708192ddccc5f 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock_single_thread.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock_single_thread.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No pthreads on Windows +//@ignore-target: windows # No pthreads on Windows fn main() { let rw = std::cell::UnsafeCell::new(libc::PTHREAD_RWLOCK_INITIALIZER); diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock_single_thread.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock_single_thread.stderr index d6cceaff1660a..24c1a993652a1 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock_single_thread.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock_single_thread.stderr @@ -1,11 +1,11 @@ error: deadlock: the evaluated program deadlocked - --> $DIR/libc_pthread_rwlock_write_read_deadlock_single_thread.rs:LL:CC + --> tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock_single_thread.rs:LL:CC | LL | libc::pthread_rwlock_rdlock(rw.get()); | ^ the evaluated program deadlocked | = note: BACKTRACE: - = note: inside `main` at $DIR/libc_pthread_rwlock_write_read_deadlock_single_thread.rs:LL:CC + = note: inside `main` at tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock_single_thread.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock.rs index 43b3ab09bb237..6d7bb80d8e6c6 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No pthreads on Windows +//@ignore-target: windows # No pthreads on Windows //@error-in-other-file: deadlock use std::cell::UnsafeCell; diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock.stderr index 73c5e77a1bce4..4f463464130dc 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock.stderr @@ -1,11 +1,11 @@ error: deadlock: the evaluated program deadlocked - --> $DIR/libc_pthread_rwlock_write_write_deadlock.rs:LL:CC + --> tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock.rs:LL:CC | LL | assert_eq!(libc::pthread_rwlock_wrlock(lock_copy.0.get() as *mut _), 0); | ^ the evaluated program deadlocked | = note: BACKTRACE on thread `unnamed-ID`: - = note: inside closure at $DIR/libc_pthread_rwlock_write_write_deadlock.rs:LL:CC + = note: inside closure at tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock.rs:LL:CC error: deadlock: the evaluated program deadlocked --> RUSTLIB/std/src/sys/pal/PLATFORM/thread.rs:LL:CC @@ -18,7 +18,7 @@ LL | let ret = unsafe { libc::pthread_join(id, ptr::null_mut()) }; = note: inside `std::thread::JoinInner::<'_, ()>::join` at RUSTLIB/std/src/thread/mod.rs:LL:CC = note: inside `std::thread::JoinHandle::<()>::join` at RUSTLIB/std/src/thread/mod.rs:LL:CC note: inside `main` - --> $DIR/libc_pthread_rwlock_write_write_deadlock.rs:LL:CC + --> tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock.rs:LL:CC | LL | / thread::spawn(move || { LL | | assert_eq!(libc::pthread_rwlock_wrlock(lock_copy.0.get() as *mut _), 0); diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock_single_thread.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock_single_thread.rs index 2704ff154413c..c7bacbacd8770 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock_single_thread.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock_single_thread.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No pthreads on Windows +//@ignore-target: windows # No pthreads on Windows fn main() { let rw = std::cell::UnsafeCell::new(libc::PTHREAD_RWLOCK_INITIALIZER); diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock_single_thread.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock_single_thread.stderr index 3ba99e3db4afb..e76ce84e757d1 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock_single_thread.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock_single_thread.stderr @@ -1,11 +1,11 @@ error: deadlock: the evaluated program deadlocked - --> $DIR/libc_pthread_rwlock_write_write_deadlock_single_thread.rs:LL:CC + --> tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock_single_thread.rs:LL:CC | LL | libc::pthread_rwlock_wrlock(rw.get()); | ^ the evaluated program deadlocked | = note: BACKTRACE: - = note: inside `main` at $DIR/libc_pthread_rwlock_write_write_deadlock_single_thread.rs:LL:CC + = note: inside `main` at tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock_single_thread.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_wrong_owner.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_wrong_owner.rs index 9a2cd09f083e7..21559e2e58f87 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_wrong_owner.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_wrong_owner.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No pthreads on Windows +//@ignore-target: windows # No pthreads on Windows use std::cell::UnsafeCell; use std::sync::Arc; diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_wrong_owner.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_wrong_owner.stderr index c9c22dea6556c..906311144e8e4 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_wrong_owner.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_wrong_owner.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: unlocked an rwlock that was not locked by the active thread - --> $DIR/libc_pthread_rwlock_write_wrong_owner.rs:LL:CC + --> tests/fail-dep/concurrency/libc_pthread_rwlock_write_wrong_owner.rs:LL:CC | LL | ... assert_eq!(libc::pthread_rwlock_unlock(lock_copy.0.get() as *mut _), 0); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unlocked an rwlock that was not locked by the active thread @@ -7,7 +7,7 @@ LL | ... assert_eq!(libc::pthread_rwlock_unlock(lock_copy.0.get() as *mut _), = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE on thread `unnamed-ID`: - = note: inside closure at $DIR/libc_pthread_rwlock_write_wrong_owner.rs:LL:CC + = note: inside closure at tests/fail-dep/concurrency/libc_pthread_rwlock_write_wrong_owner.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libx_pthread_rwlock_moved.rs b/src/tools/miri/tests/fail-dep/concurrency/libx_pthread_rwlock_moved.rs new file mode 100644 index 0000000000000..540729962a97e --- /dev/null +++ b/src/tools/miri/tests/fail-dep/concurrency/libx_pthread_rwlock_moved.rs @@ -0,0 +1,14 @@ +//@ignore-target: windows # No pthreads on Windows + +fn main() { + unsafe { + let mut rw = libc::PTHREAD_RWLOCK_INITIALIZER; + + libc::pthread_rwlock_rdlock(&mut rw as *mut _); + + // Move rwlock + let mut rw2 = rw; + + libc::pthread_rwlock_unlock(&mut rw2 as *mut _); //~ ERROR: pthread_rwlock_t can't be moved after first use + } +} diff --git a/src/tools/miri/tests/fail-dep/concurrency/libx_pthread_rwlock_moved.stderr b/src/tools/miri/tests/fail-dep/concurrency/libx_pthread_rwlock_moved.stderr new file mode 100644 index 0000000000000..ce08fa8159c27 --- /dev/null +++ b/src/tools/miri/tests/fail-dep/concurrency/libx_pthread_rwlock_moved.stderr @@ -0,0 +1,15 @@ +error: Undefined Behavior: pthread_rwlock_t can't be moved after first use + --> tests/fail-dep/concurrency/libx_pthread_rwlock_moved.rs:LL:CC + | +LL | libc::pthread_rwlock_unlock(&mut rw2 as *mut _); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pthread_rwlock_t can't be moved after first use + | + = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior + = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: BACKTRACE: + = note: inside `main` at tests/fail-dep/concurrency/libx_pthread_rwlock_moved.rs:LL:CC + +note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace + +error: aborting due to 1 previous error + diff --git a/src/tools/miri/tests/fail-dep/concurrency/windows_join_detached.rs b/src/tools/miri/tests/fail-dep/concurrency/windows_join_detached.rs index 0e9eb24459c3e..63e7eb113dd4f 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/windows_join_detached.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/windows_join_detached.rs @@ -1,4 +1,4 @@ -//@only-target-windows: Uses win32 api functions +//@only-target: windows # Uses win32 api functions //@error-in-other-file: Undefined Behavior: trying to join a detached thread // Joining a detached thread is undefined behavior. diff --git a/src/tools/miri/tests/fail-dep/concurrency/windows_join_detached.stderr b/src/tools/miri/tests/fail-dep/concurrency/windows_join_detached.stderr index 19bfe56395e00..947d665b95a19 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/windows_join_detached.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/windows_join_detached.stderr @@ -11,7 +11,7 @@ LL | let rc = unsafe { c::WaitForSingleObject(self.handle.as_raw_handle( = note: inside `std::thread::JoinInner::<'_, ()>::join` at RUSTLIB/std/src/thread/mod.rs:LL:CC = note: inside `std::thread::JoinHandle::<()>::join` at RUSTLIB/std/src/thread/mod.rs:LL:CC note: inside `main` - --> $DIR/windows_join_detached.rs:LL:CC + --> tests/fail-dep/concurrency/windows_join_detached.rs:LL:CC | LL | thread.join().unwrap(); | ^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail-dep/concurrency/windows_join_main.rs b/src/tools/miri/tests/fail-dep/concurrency/windows_join_main.rs index 532bda201364f..e28b0343135b5 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/windows_join_main.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/windows_join_main.rs @@ -1,4 +1,4 @@ -//@only-target-windows: Uses win32 api functions +//@only-target: windows # Uses win32 api functions // We are making scheduler assumptions here. //@compile-flags: -Zmiri-preemption-rate=0 //@error-in-other-file: deadlock diff --git a/src/tools/miri/tests/fail-dep/concurrency/windows_join_main.stderr b/src/tools/miri/tests/fail-dep/concurrency/windows_join_main.stderr index 12f35fdeb02a7..23a9f8f9c288f 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/windows_join_main.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/windows_join_main.stderr @@ -1,5 +1,5 @@ error: deadlock: the evaluated program deadlocked - --> $DIR/windows_join_main.rs:LL:CC + --> tests/fail-dep/concurrency/windows_join_main.rs:LL:CC | LL | assert_eq!(WaitForSingleObject(MAIN_THREAD, INFINITE), WAIT_OBJECT_0); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program deadlocked @@ -19,7 +19,7 @@ LL | let rc = unsafe { c::WaitForSingleObject(self.handle.as_raw_handle( = note: inside `std::thread::JoinInner::<'_, ()>::join` at RUSTLIB/std/src/thread/mod.rs:LL:CC = note: inside `std::thread::JoinHandle::<()>::join` at RUSTLIB/std/src/thread/mod.rs:LL:CC note: inside `main` - --> $DIR/windows_join_main.rs:LL:CC + --> tests/fail-dep/concurrency/windows_join_main.rs:LL:CC | LL | / thread::spawn(|| { LL | | unsafe { diff --git a/src/tools/miri/tests/fail-dep/concurrency/windows_join_self.rs b/src/tools/miri/tests/fail-dep/concurrency/windows_join_self.rs index a64265ca0ca5e..4d48e839bb414 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/windows_join_self.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/windows_join_self.rs @@ -1,4 +1,4 @@ -//@only-target-windows: Uses win32 api functions +//@only-target: windows # Uses win32 api functions // We are making scheduler assumptions here. //@compile-flags: -Zmiri-preemption-rate=0 //@error-in-other-file: deadlock diff --git a/src/tools/miri/tests/fail-dep/concurrency/windows_join_self.stderr b/src/tools/miri/tests/fail-dep/concurrency/windows_join_self.stderr index 8d26c35de8ab2..4e640296dbe4a 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/windows_join_self.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/windows_join_self.stderr @@ -1,11 +1,11 @@ error: deadlock: the evaluated program deadlocked - --> $DIR/windows_join_self.rs:LL:CC + --> tests/fail-dep/concurrency/windows_join_self.rs:LL:CC | LL | assert_eq!(WaitForSingleObject(native, INFINITE), WAIT_OBJECT_0); | ^ the evaluated program deadlocked | = note: BACKTRACE on thread `unnamed-ID`: - = note: inside closure at $DIR/windows_join_self.rs:LL:CC + = note: inside closure at tests/fail-dep/concurrency/windows_join_self.rs:LL:CC error: deadlock: the evaluated program deadlocked --> RUSTLIB/std/src/sys/pal/PLATFORM/thread.rs:LL:CC @@ -18,7 +18,7 @@ LL | let rc = unsafe { c::WaitForSingleObject(self.handle.as_raw_handle( = note: inside `std::thread::JoinInner::<'_, ()>::join` at RUSTLIB/std/src/thread/mod.rs:LL:CC = note: inside `std::thread::JoinHandle::<()>::join` at RUSTLIB/std/src/thread/mod.rs:LL:CC note: inside `main` - --> $DIR/windows_join_self.rs:LL:CC + --> tests/fail-dep/concurrency/windows_join_self.rs:LL:CC | LL | / thread::spawn(|| { LL | | unsafe { diff --git a/src/tools/miri/tests/fail-dep/libc/affinity.rs b/src/tools/miri/tests/fail-dep/libc/affinity.rs index c41d1d18018c7..d7d5c59e1bc17 100644 --- a/src/tools/miri/tests/fail-dep/libc/affinity.rs +++ b/src/tools/miri/tests/fail-dep/libc/affinity.rs @@ -1,5 +1,5 @@ -//@ignore-target-windows: only very limited libc on Windows -//@ignore-target-apple: `sched_setaffinity` is not supported on macOS +//@ignore-target: windows # only very limited libc on Windows +//@ignore-target: apple # `sched_setaffinity` is not supported on macOS //@compile-flags: -Zmiri-disable-isolation -Zmiri-num-cpus=4 fn main() { diff --git a/src/tools/miri/tests/fail-dep/libc/affinity.stderr b/src/tools/miri/tests/fail-dep/libc/affinity.stderr index 38414623ccb94..5a226c6a44b8f 100644 --- a/src/tools/miri/tests/fail-dep/libc/affinity.stderr +++ b/src/tools/miri/tests/fail-dep/libc/affinity.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: memory access failed: expected a pointer to 129 bytes of memory, but got ALLOC which is only 128 bytes from the end of the allocation - --> $DIR/affinity.rs:LL:CC + --> tests/fail-dep/libc/affinity.rs:LL:CC | LL | let err = unsafe { sched_setaffinity(PID, size_of::() + 1, &cpuset) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: expected a pointer to 129 bytes of memory, but got ALLOC which is only 128 bytes from the end of the allocation @@ -7,12 +7,12 @@ LL | let err = unsafe { sched_setaffinity(PID, size_of::() + 1, & = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information help: ALLOC was allocated here: - --> $DIR/affinity.rs:LL:CC + --> tests/fail-dep/libc/affinity.rs:LL:CC | LL | let cpuset: cpu_set_t = unsafe { core::mem::MaybeUninit::zeroed().assume_init() }; | ^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/affinity.rs:LL:CC + = note: inside `main` at tests/fail-dep/libc/affinity.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/aligned_alloc_size_zero_leak.rs b/src/tools/miri/tests/fail-dep/libc/aligned_alloc_size_zero_leak.rs index 9a33cdccd270e..0caba9059ef52 100644 --- a/src/tools/miri/tests/fail-dep/libc/aligned_alloc_size_zero_leak.rs +++ b/src/tools/miri/tests/fail-dep/libc/aligned_alloc_size_zero_leak.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: Windows does not support the standard C11 aligned_alloc. +//@ignore-target: windows # Windows does not support the standard C11 aligned_alloc. fn main() { // libc doesn't have this function (https://github.com/rust-lang/libc/issues/3689), diff --git a/src/tools/miri/tests/fail-dep/libc/aligned_alloc_size_zero_leak.stderr b/src/tools/miri/tests/fail-dep/libc/aligned_alloc_size_zero_leak.stderr index 91c67823320a1..bde7f5b515e35 100644 --- a/src/tools/miri/tests/fail-dep/libc/aligned_alloc_size_zero_leak.stderr +++ b/src/tools/miri/tests/fail-dep/libc/aligned_alloc_size_zero_leak.stderr @@ -1,11 +1,11 @@ error: memory leaked: ALLOC (C heap, size: 0, align: 2), allocated here: - --> $DIR/aligned_alloc_size_zero_leak.rs:LL:CC + --> tests/fail-dep/libc/aligned_alloc_size_zero_leak.rs:LL:CC | LL | aligned_alloc(2, 0); | ^^^^^^^^^^^^^^^^^^^ | = note: BACKTRACE: - = note: inside `main` at $DIR/aligned_alloc_size_zero_leak.rs:LL:CC + = note: inside `main` at tests/fail-dep/libc/aligned_alloc_size_zero_leak.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/env-set_var-data-race.rs b/src/tools/miri/tests/fail-dep/libc/env-set_var-data-race.rs index a1895feb957bc..c7d8bacd37950 100644 --- a/src/tools/miri/tests/fail-dep/libc/env-set_var-data-race.rs +++ b/src/tools/miri/tests/fail-dep/libc/env-set_var-data-race.rs @@ -1,5 +1,5 @@ //@compile-flags: -Zmiri-disable-isolation -Zmiri-preemption-rate=0 -//@ignore-target-windows: No libc env support on Windows +//@ignore-target: windows # No libc env support on Windows use std::env; use std::thread; diff --git a/src/tools/miri/tests/fail-dep/libc/env-set_var-data-race.stderr b/src/tools/miri/tests/fail-dep/libc/env-set_var-data-race.stderr index f85234f562711..904a1677b80eb 100644 --- a/src/tools/miri/tests/fail-dep/libc/env-set_var-data-race.stderr +++ b/src/tools/miri/tests/fail-dep/libc/env-set_var-data-race.stderr @@ -1,18 +1,18 @@ error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `main` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here - --> $DIR/env-set_var-data-race.rs:LL:CC + --> tests/fail-dep/libc/env-set_var-data-race.rs:LL:CC | LL | libc::getenv(b"TZ/0".as_ptr().cast()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) non-atomic write on thread `main` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/env-set_var-data-race.rs:LL:CC + --> tests/fail-dep/libc/env-set_var-data-race.rs:LL:CC | LL | env::set_var("MY_RUST_VAR", "Ferris"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at $DIR/env-set_var-data-race.rs:LL:CC + = note: inside closure at tests/fail-dep/libc/env-set_var-data-race.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/fs/close_stdout.rs b/src/tools/miri/tests/fail-dep/libc/fs/close_stdout.rs index 42b7e2b7838cb..7911133f548ff 100644 --- a/src/tools/miri/tests/fail-dep/libc/fs/close_stdout.rs +++ b/src/tools/miri/tests/fail-dep/libc/fs/close_stdout.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No libc IO on Windows +//@ignore-target: windows # No libc IO on Windows //@compile-flags: -Zmiri-disable-isolation // FIXME: standard handles cannot be closed (https://github.com/rust-lang/rust/issues/40032) diff --git a/src/tools/miri/tests/fail-dep/libc/fs/close_stdout.stderr b/src/tools/miri/tests/fail-dep/libc/fs/close_stdout.stderr index e1b1b053bbc65..029eeab404432 100644 --- a/src/tools/miri/tests/fail-dep/libc/fs/close_stdout.stderr +++ b/src/tools/miri/tests/fail-dep/libc/fs/close_stdout.stderr @@ -1,12 +1,12 @@ error: unsupported operation: cannot close stdout - --> $DIR/close_stdout.rs:LL:CC + --> tests/fail-dep/libc/fs/close_stdout.rs:LL:CC | LL | libc::close(1); | ^^^^^^^^^^^^^^ cannot close stdout | = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support = note: BACKTRACE: - = note: inside `main` at $DIR/close_stdout.rs:LL:CC + = note: inside `main` at tests/fail-dep/libc/fs/close_stdout.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/fs/isolated_stdin.rs b/src/tools/miri/tests/fail-dep/libc/fs/isolated_stdin.rs index 3c62015a051ad..3ef194c5c7172 100644 --- a/src/tools/miri/tests/fail-dep/libc/fs/isolated_stdin.rs +++ b/src/tools/miri/tests/fail-dep/libc/fs/isolated_stdin.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No libc IO on Windows +//@ignore-target: windows # No libc IO on Windows fn main() -> std::io::Result<()> { let mut bytes = [0u8; 512]; diff --git a/src/tools/miri/tests/fail-dep/libc/fs/isolated_stdin.stderr b/src/tools/miri/tests/fail-dep/libc/fs/isolated_stdin.stderr index 9abe145ea9ef7..bb7e8cef5dcd2 100644 --- a/src/tools/miri/tests/fail-dep/libc/fs/isolated_stdin.stderr +++ b/src/tools/miri/tests/fail-dep/libc/fs/isolated_stdin.stderr @@ -1,5 +1,5 @@ error: unsupported operation: `read` from stdin not available when isolation is enabled - --> $DIR/isolated_stdin.rs:LL:CC + --> tests/fail-dep/libc/fs/isolated_stdin.rs:LL:CC | LL | libc::read(0, bytes.as_mut_ptr() as *mut libc::c_void, 512); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `read` from stdin not available when isolation is enabled @@ -7,7 +7,7 @@ LL | libc::read(0, bytes.as_mut_ptr() as *mut libc::c_void, 512); = help: set `MIRIFLAGS=-Zmiri-disable-isolation` to disable isolation; = help: or set `MIRIFLAGS=-Zmiri-isolation-error=warn` to make Miri return an error code from isolated operations (if supported for that operation) and continue with a warning = note: BACKTRACE: - = note: inside `main` at $DIR/isolated_stdin.rs:LL:CC + = note: inside `main` at tests/fail-dep/libc/fs/isolated_stdin.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/fs/mkstemp_immutable_arg.rs b/src/tools/miri/tests/fail-dep/libc/fs/mkstemp_immutable_arg.rs index 6d951a3a7b387..2c676f12b4f0e 100644 --- a/src/tools/miri/tests/fail-dep/libc/fs/mkstemp_immutable_arg.rs +++ b/src/tools/miri/tests/fail-dep/libc/fs/mkstemp_immutable_arg.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No mkstemp on Windows +//@ignore-target: windows # No mkstemp on Windows //@compile-flags: -Zmiri-disable-isolation fn main() { diff --git a/src/tools/miri/tests/fail-dep/libc/fs/mkstemp_immutable_arg.stderr b/src/tools/miri/tests/fail-dep/libc/fs/mkstemp_immutable_arg.stderr index 7a2757557ef1a..9227bddf5a8d3 100644 --- a/src/tools/miri/tests/fail-dep/libc/fs/mkstemp_immutable_arg.stderr +++ b/src/tools/miri/tests/fail-dep/libc/fs/mkstemp_immutable_arg.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: writing to ALLOC which is read-only - --> $DIR/mkstemp_immutable_arg.rs:LL:CC + --> tests/fail-dep/libc/fs/mkstemp_immutable_arg.rs:LL:CC | LL | let _fd = unsafe { libc::mkstemp(s) }; | ^^^^^^^^^^^^^^^^ writing to ALLOC which is read-only @@ -7,9 +7,9 @@ LL | let _fd = unsafe { libc::mkstemp(s) }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `test_mkstemp_immutable_arg` at $DIR/mkstemp_immutable_arg.rs:LL:CC + = note: inside `test_mkstemp_immutable_arg` at tests/fail-dep/libc/fs/mkstemp_immutable_arg.rs:LL:CC note: inside `main` - --> $DIR/mkstemp_immutable_arg.rs:LL:CC + --> tests/fail-dep/libc/fs/mkstemp_immutable_arg.rs:LL:CC | LL | test_mkstemp_immutable_arg(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail-dep/libc/fs/read_from_stdout.rs b/src/tools/miri/tests/fail-dep/libc/fs/read_from_stdout.rs index 624f584a0c85e..ff95beb3a9fe3 100644 --- a/src/tools/miri/tests/fail-dep/libc/fs/read_from_stdout.rs +++ b/src/tools/miri/tests/fail-dep/libc/fs/read_from_stdout.rs @@ -1,5 +1,5 @@ //@compile-flags: -Zmiri-disable-isolation -//@ignore-target-windows: No libc IO on Windows +//@ignore-target: windows # No libc IO on Windows fn main() -> std::io::Result<()> { let mut bytes = [0u8; 512]; diff --git a/src/tools/miri/tests/fail-dep/libc/fs/read_from_stdout.stderr b/src/tools/miri/tests/fail-dep/libc/fs/read_from_stdout.stderr index baa6eb5ad6a09..1be2f08dd8c16 100644 --- a/src/tools/miri/tests/fail-dep/libc/fs/read_from_stdout.stderr +++ b/src/tools/miri/tests/fail-dep/libc/fs/read_from_stdout.stderr @@ -1,12 +1,12 @@ error: unsupported operation: cannot read from stdout - --> $DIR/read_from_stdout.rs:LL:CC + --> tests/fail-dep/libc/fs/read_from_stdout.rs:LL:CC | LL | libc::read(1, bytes.as_mut_ptr() as *mut libc::c_void, 512); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot read from stdout | = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support = note: BACKTRACE: - = note: inside `main` at $DIR/read_from_stdout.rs:LL:CC + = note: inside `main` at tests/fail-dep/libc/fs/read_from_stdout.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/fs/unix_open_missing_required_mode.rs b/src/tools/miri/tests/fail-dep/libc/fs/unix_open_missing_required_mode.rs index d783967f95968..b763121080ed4 100644 --- a/src/tools/miri/tests/fail-dep/libc/fs/unix_open_missing_required_mode.rs +++ b/src/tools/miri/tests/fail-dep/libc/fs/unix_open_missing_required_mode.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No libc IO on Windows +//@ignore-target: windows # No libc IO on Windows //@compile-flags: -Zmiri-disable-isolation fn main() { diff --git a/src/tools/miri/tests/fail-dep/libc/fs/unix_open_missing_required_mode.stderr b/src/tools/miri/tests/fail-dep/libc/fs/unix_open_missing_required_mode.stderr index 0988eefe22237..971a2d7605332 100644 --- a/src/tools/miri/tests/fail-dep/libc/fs/unix_open_missing_required_mode.stderr +++ b/src/tools/miri/tests/fail-dep/libc/fs/unix_open_missing_required_mode.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: incorrect number of arguments for `open` with `O_CREAT`: got 2, expected at least 3 - --> $DIR/unix_open_missing_required_mode.rs:LL:CC + --> tests/fail-dep/libc/fs/unix_open_missing_required_mode.rs:LL:CC | LL | ...safe { libc::open(name_ptr, libc::O_CREAT) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect number of arguments for `open` with `O_CREAT`: got 2, expected at least 3 @@ -7,9 +7,9 @@ LL | ...safe { libc::open(name_ptr, libc::O_CREAT) }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `test_file_open_missing_needed_mode` at $DIR/unix_open_missing_required_mode.rs:LL:CC + = note: inside `test_file_open_missing_needed_mode` at tests/fail-dep/libc/fs/unix_open_missing_required_mode.rs:LL:CC note: inside `main` - --> $DIR/unix_open_missing_required_mode.rs:LL:CC + --> tests/fail-dep/libc/fs/unix_open_missing_required_mode.rs:LL:CC | LL | test_file_open_missing_needed_mode(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail-dep/libc/fs/write_to_stdin.rs b/src/tools/miri/tests/fail-dep/libc/fs/write_to_stdin.rs index 683c55e90e182..81e5034f11740 100644 --- a/src/tools/miri/tests/fail-dep/libc/fs/write_to_stdin.rs +++ b/src/tools/miri/tests/fail-dep/libc/fs/write_to_stdin.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No libc IO on Windows +//@ignore-target: windows # No libc IO on Windows fn main() -> std::io::Result<()> { let bytes = b"hello"; diff --git a/src/tools/miri/tests/fail-dep/libc/fs/write_to_stdin.stderr b/src/tools/miri/tests/fail-dep/libc/fs/write_to_stdin.stderr index 37323faf560df..9726a1d2a97da 100644 --- a/src/tools/miri/tests/fail-dep/libc/fs/write_to_stdin.stderr +++ b/src/tools/miri/tests/fail-dep/libc/fs/write_to_stdin.stderr @@ -1,12 +1,12 @@ error: unsupported operation: cannot write to stdin - --> $DIR/write_to_stdin.rs:LL:CC + --> tests/fail-dep/libc/fs/write_to_stdin.rs:LL:CC | LL | libc::write(0, bytes.as_ptr() as *const libc::c_void, 5); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot write to stdin | = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support = note: BACKTRACE: - = note: inside `main` at $DIR/write_to_stdin.rs:LL:CC + = note: inside `main` at tests/fail-dep/libc/fs/write_to_stdin.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/libc-read-and-uninit-premature-eof.rs b/src/tools/miri/tests/fail-dep/libc/libc-read-and-uninit-premature-eof.rs index 98ef454c88b3f..dd2dd34623166 100644 --- a/src/tools/miri/tests/fail-dep/libc/libc-read-and-uninit-premature-eof.rs +++ b/src/tools/miri/tests/fail-dep/libc/libc-read-and-uninit-premature-eof.rs @@ -1,6 +1,6 @@ //! We test that if we requested to read 4 bytes, but actually read 3 bytes, //! then 3 bytes (not 4) will be initialized. -//@ignore-target-windows: no file system support on Windows +//@ignore-target: windows # no file system support on Windows //@compile-flags: -Zmiri-disable-isolation use std::ffi::CString; diff --git a/src/tools/miri/tests/fail-dep/libc/libc-read-and-uninit-premature-eof.stderr b/src/tools/miri/tests/fail-dep/libc/libc-read-and-uninit-premature-eof.stderr index e4c7aba07e345..980d9810abc9a 100644 --- a/src/tools/miri/tests/fail-dep/libc/libc-read-and-uninit-premature-eof.stderr +++ b/src/tools/miri/tests/fail-dep/libc/libc-read-and-uninit-premature-eof.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value at .value[3]: encountered uninitialized memory, but expected an integer - --> $DIR/libc-read-and-uninit-premature-eof.rs:LL:CC + --> tests/fail-dep/libc/libc-read-and-uninit-premature-eof.rs:LL:CC | LL | ... buf.assume_init(); | ^^^^^^^^^^^^^^^^^ constructing invalid value at .value[3]: encountered uninitialized memory, but expected an integer @@ -7,7 +7,7 @@ LL | ... buf.assume_init(); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/libc-read-and-uninit-premature-eof.rs:LL:CC + = note: inside `main` at tests/fail-dep/libc/libc-read-and-uninit-premature-eof.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/libc_epoll_unsupported_fd.rs b/src/tools/miri/tests/fail-dep/libc/libc_epoll_unsupported_fd.rs index fb2426f7b66d8..03d4b2d66330e 100644 --- a/src/tools/miri/tests/fail-dep/libc/libc_epoll_unsupported_fd.rs +++ b/src/tools/miri/tests/fail-dep/libc/libc_epoll_unsupported_fd.rs @@ -1,4 +1,4 @@ -//@only-target-linux +//@only-target: linux // This is a test for registering unsupported fd with epoll. // Register epoll fd with epoll is allowed in real system, but we do not support this. diff --git a/src/tools/miri/tests/fail-dep/libc/libc_epoll_unsupported_fd.stderr b/src/tools/miri/tests/fail-dep/libc/libc_epoll_unsupported_fd.stderr index 6f9b988d4ee2d..59797145c2064 100644 --- a/src/tools/miri/tests/fail-dep/libc/libc_epoll_unsupported_fd.stderr +++ b/src/tools/miri/tests/fail-dep/libc/libc_epoll_unsupported_fd.stderr @@ -1,12 +1,12 @@ error: unsupported operation: epoll: epoll does not support this file description - --> $DIR/libc_epoll_unsupported_fd.rs:LL:CC + --> tests/fail-dep/libc/libc_epoll_unsupported_fd.rs:LL:CC | LL | let res = unsafe { libc::epoll_ctl(epfd0, libc::EPOLL_CTL_ADD, epfd1, &mut ev) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ epoll: epoll does not support this file description | = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support = note: BACKTRACE: - = note: inside `main` at $DIR/libc_epoll_unsupported_fd.rs:LL:CC + = note: inside `main` at tests/fail-dep/libc/libc_epoll_unsupported_fd.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/libc_eventfd_read_block.rs b/src/tools/miri/tests/fail-dep/libc/libc_eventfd_read_block.rs index fb9a23206c604..0212a63bd0fa2 100644 --- a/src/tools/miri/tests/fail-dep/libc/libc_eventfd_read_block.rs +++ b/src/tools/miri/tests/fail-dep/libc/libc_eventfd_read_block.rs @@ -1,4 +1,4 @@ -//@only-target-linux +//@only-target: linux fn main() { // eventfd read will block when EFD_NONBLOCK flag is clear and counter = 0. // This will pass when blocking is implemented. diff --git a/src/tools/miri/tests/fail-dep/libc/libc_eventfd_read_block.stderr b/src/tools/miri/tests/fail-dep/libc/libc_eventfd_read_block.stderr index fdd0b4272cafb..aff30c81ebdb9 100644 --- a/src/tools/miri/tests/fail-dep/libc/libc_eventfd_read_block.stderr +++ b/src/tools/miri/tests/fail-dep/libc/libc_eventfd_read_block.stderr @@ -1,12 +1,12 @@ error: unsupported operation: eventfd: blocking is unsupported - --> $DIR/libc_eventfd_read_block.rs:LL:CC + --> tests/fail-dep/libc/libc_eventfd_read_block.rs:LL:CC | LL | libc::read(fd, buf.as_mut_ptr().cast(), buf.len() as libc::size_t).try_into().unwrap() | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ eventfd: blocking is unsupported | = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support = note: BACKTRACE: - = note: inside `main` at $DIR/libc_eventfd_read_block.rs:LL:CC + = note: inside `main` at tests/fail-dep/libc/libc_eventfd_read_block.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/libc_eventfd_write_block.rs b/src/tools/miri/tests/fail-dep/libc/libc_eventfd_write_block.rs index 2037a516dea1c..ed6ad466901bc 100644 --- a/src/tools/miri/tests/fail-dep/libc/libc_eventfd_write_block.rs +++ b/src/tools/miri/tests/fail-dep/libc/libc_eventfd_write_block.rs @@ -1,4 +1,4 @@ -//@only-target-linux +//@only-target: linux fn main() { // eventfd write will block when EFD_NONBLOCK flag is clear // and the addition caused counter to exceed u64::MAX - 1. diff --git a/src/tools/miri/tests/fail-dep/libc/libc_eventfd_write_block.stderr b/src/tools/miri/tests/fail-dep/libc/libc_eventfd_write_block.stderr index f12c0ddfb1717..2b6066057941f 100644 --- a/src/tools/miri/tests/fail-dep/libc/libc_eventfd_write_block.stderr +++ b/src/tools/miri/tests/fail-dep/libc/libc_eventfd_write_block.stderr @@ -1,12 +1,12 @@ error: unsupported operation: eventfd: blocking is unsupported - --> $DIR/libc_eventfd_write_block.rs:LL:CC + --> tests/fail-dep/libc/libc_eventfd_write_block.rs:LL:CC | LL | libc::write(fd, sized_8_data.as_ptr() as *const libc::c_void, 8).try_into().unwrap() | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ eventfd: blocking is unsupported | = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support = note: BACKTRACE: - = note: inside `main` at $DIR/libc_eventfd_write_block.rs:LL:CC + = note: inside `main` at tests/fail-dep/libc/libc_eventfd_write_block.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/malloc_zero_double_free.stderr b/src/tools/miri/tests/fail-dep/libc/malloc_zero_double_free.stderr index 6437c9dbeb44a..d6337c059bae3 100644 --- a/src/tools/miri/tests/fail-dep/libc/malloc_zero_double_free.stderr +++ b/src/tools/miri/tests/fail-dep/libc/malloc_zero_double_free.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: memory access failed: ALLOC has been freed, so this pointer is dangling - --> $DIR/malloc_zero_double_free.rs:LL:CC + --> tests/fail-dep/libc/malloc_zero_double_free.rs:LL:CC | LL | libc::free(ptr); | ^^^^^^^^^^^^^^^ memory access failed: ALLOC has been freed, so this pointer is dangling @@ -7,17 +7,17 @@ LL | libc::free(ptr); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information help: ALLOC was allocated here: - --> $DIR/malloc_zero_double_free.rs:LL:CC + --> tests/fail-dep/libc/malloc_zero_double_free.rs:LL:CC | LL | let ptr = libc::malloc(0); | ^^^^^^^^^^^^^^^ help: ALLOC was deallocated here: - --> $DIR/malloc_zero_double_free.rs:LL:CC + --> tests/fail-dep/libc/malloc_zero_double_free.rs:LL:CC | LL | libc::free(ptr); | ^^^^^^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/malloc_zero_double_free.rs:LL:CC + = note: inside `main` at tests/fail-dep/libc/malloc_zero_double_free.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/malloc_zero_memory_leak.stderr b/src/tools/miri/tests/fail-dep/libc/malloc_zero_memory_leak.stderr index 657262b8d4136..6f3d7fa7a4f22 100644 --- a/src/tools/miri/tests/fail-dep/libc/malloc_zero_memory_leak.stderr +++ b/src/tools/miri/tests/fail-dep/libc/malloc_zero_memory_leak.stderr @@ -1,11 +1,11 @@ error: memory leaked: ALLOC (C heap, size: 0, align: 1), allocated here: - --> $DIR/malloc_zero_memory_leak.rs:LL:CC + --> tests/fail-dep/libc/malloc_zero_memory_leak.rs:LL:CC | LL | let _ptr = libc::malloc(0); | ^^^^^^^^^^^^^^^ | = note: BACKTRACE: - = note: inside `main` at $DIR/malloc_zero_memory_leak.rs:LL:CC + = note: inside `main` at tests/fail-dep/libc/malloc_zero_memory_leak.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/memchr_null.stderr b/src/tools/miri/tests/fail-dep/libc/memchr_null.stderr index f03ae33ed9f39..6d3ff176c3559 100644 --- a/src/tools/miri/tests/fail-dep/libc/memchr_null.stderr +++ b/src/tools/miri/tests/fail-dep/libc/memchr_null.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: out-of-bounds pointer use: expected a pointer to some allocation, but got a null pointer - --> $DIR/memchr_null.rs:LL:CC + --> tests/fail-dep/libc/memchr_null.rs:LL:CC | LL | libc::memchr(ptr::null(), 0, 0); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer use: expected a pointer to some allocation, but got a null pointer @@ -7,7 +7,7 @@ LL | libc::memchr(ptr::null(), 0, 0); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/memchr_null.rs:LL:CC + = note: inside `main` at tests/fail-dep/libc/memchr_null.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/memcmp_null.stderr b/src/tools/miri/tests/fail-dep/libc/memcmp_null.stderr index 4bca5a3db0722..a4ca205c37704 100644 --- a/src/tools/miri/tests/fail-dep/libc/memcmp_null.stderr +++ b/src/tools/miri/tests/fail-dep/libc/memcmp_null.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: out-of-bounds pointer use: expected a pointer to some allocation, but got a null pointer - --> $DIR/memcmp_null.rs:LL:CC + --> tests/fail-dep/libc/memcmp_null.rs:LL:CC | LL | libc::memcmp(ptr::null(), ptr::null(), 0); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer use: expected a pointer to some allocation, but got a null pointer @@ -7,7 +7,7 @@ LL | libc::memcmp(ptr::null(), ptr::null(), 0); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/memcmp_null.rs:LL:CC + = note: inside `main` at tests/fail-dep/libc/memcmp_null.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/memcmp_zero.stderr b/src/tools/miri/tests/fail-dep/libc/memcmp_zero.stderr index 6adaaeb3dbf1e..d7b046c18235f 100644 --- a/src/tools/miri/tests/fail-dep/libc/memcmp_zero.stderr +++ b/src/tools/miri/tests/fail-dep/libc/memcmp_zero.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: out-of-bounds pointer use: expected a pointer to some allocation, but got 0x2a[noalloc] which is a dangling pointer (it has no provenance) - --> $DIR/memcmp_zero.rs:LL:CC + --> tests/fail-dep/libc/memcmp_zero.rs:LL:CC | LL | libc::memcmp(ptr.cast(), ptr.cast(), 0); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer use: expected a pointer to some allocation, but got 0x2a[noalloc] which is a dangling pointer (it has no provenance) @@ -7,7 +7,7 @@ LL | libc::memcmp(ptr.cast(), ptr.cast(), 0); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/memcmp_zero.rs:LL:CC + = note: inside `main` at tests/fail-dep/libc/memcmp_zero.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/memcpy_zero.stderr b/src/tools/miri/tests/fail-dep/libc/memcpy_zero.stderr index b2da332df2149..336113e344088 100644 --- a/src/tools/miri/tests/fail-dep/libc/memcpy_zero.stderr +++ b/src/tools/miri/tests/fail-dep/libc/memcpy_zero.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: out-of-bounds pointer use: expected a pointer to some allocation, but got 0x17[noalloc] which is a dangling pointer (it has no provenance) - --> $DIR/memcpy_zero.rs:LL:CC + --> tests/fail-dep/libc/memcpy_zero.rs:LL:CC | LL | libc::memcpy(to.cast(), from.cast(), 0); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer use: expected a pointer to some allocation, but got 0x17[noalloc] which is a dangling pointer (it has no provenance) @@ -7,7 +7,7 @@ LL | libc::memcpy(to.cast(), from.cast(), 0); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/memcpy_zero.rs:LL:CC + = note: inside `main` at tests/fail-dep/libc/memcpy_zero.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/memrchr_null.rs b/src/tools/miri/tests/fail-dep/libc/memrchr_null.rs index 1fe637d6ce7e9..8b34ff4ac2e37 100644 --- a/src/tools/miri/tests/fail-dep/libc/memrchr_null.rs +++ b/src/tools/miri/tests/fail-dep/libc/memrchr_null.rs @@ -1,5 +1,5 @@ -//@ignore-target-windows: No `memrchr` on Windows -//@ignore-target-apple: No `memrchr` on some apple targets +//@ignore-target: windows # No `memrchr` on Windows +//@ignore-target: apple # No `memrchr` on some apple targets use std::ptr; diff --git a/src/tools/miri/tests/fail-dep/libc/memrchr_null.stderr b/src/tools/miri/tests/fail-dep/libc/memrchr_null.stderr index a9ed58d61bb35..ce759f3e17a56 100644 --- a/src/tools/miri/tests/fail-dep/libc/memrchr_null.stderr +++ b/src/tools/miri/tests/fail-dep/libc/memrchr_null.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: out-of-bounds pointer use: expected a pointer to some allocation, but got a null pointer - --> $DIR/memrchr_null.rs:LL:CC + --> tests/fail-dep/libc/memrchr_null.rs:LL:CC | LL | libc::memrchr(ptr::null(), 0, 0); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer use: expected a pointer to some allocation, but got a null pointer @@ -7,7 +7,7 @@ LL | libc::memrchr(ptr::null(), 0, 0); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/memrchr_null.rs:LL:CC + = note: inside `main` at tests/fail-dep/libc/memrchr_null.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/mmap_invalid_dealloc.rs b/src/tools/miri/tests/fail-dep/libc/mmap_invalid_dealloc.rs index 9d55a4935547f..53ca14e6e896c 100644 --- a/src/tools/miri/tests/fail-dep/libc/mmap_invalid_dealloc.rs +++ b/src/tools/miri/tests/fail-dep/libc/mmap_invalid_dealloc.rs @@ -1,5 +1,5 @@ //@compile-flags: -Zmiri-disable-isolation -//@ignore-target-windows: No mmap on Windows +//@ignore-target: windows # No mmap on Windows #![feature(rustc_private)] diff --git a/src/tools/miri/tests/fail-dep/libc/mmap_invalid_dealloc.stderr b/src/tools/miri/tests/fail-dep/libc/mmap_invalid_dealloc.stderr index cec67b6ef8408..193c9f1eccc4c 100644 --- a/src/tools/miri/tests/fail-dep/libc/mmap_invalid_dealloc.stderr +++ b/src/tools/miri/tests/fail-dep/libc/mmap_invalid_dealloc.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: deallocating ALLOC, which is mmap memory, using C heap deallocation operation - --> $DIR/mmap_invalid_dealloc.rs:LL:CC + --> tests/fail-dep/libc/mmap_invalid_dealloc.rs:LL:CC | LL | libc::free(ptr); | ^^^^^^^^^^^^^^^ deallocating ALLOC, which is mmap memory, using C heap deallocation operation @@ -7,7 +7,7 @@ LL | libc::free(ptr); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/mmap_invalid_dealloc.rs:LL:CC + = note: inside `main` at tests/fail-dep/libc/mmap_invalid_dealloc.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/mmap_use_after_munmap.rs b/src/tools/miri/tests/fail-dep/libc/mmap_use_after_munmap.rs index 05ac232f5d7b4..6831734a31b61 100644 --- a/src/tools/miri/tests/fail-dep/libc/mmap_use_after_munmap.rs +++ b/src/tools/miri/tests/fail-dep/libc/mmap_use_after_munmap.rs @@ -1,5 +1,5 @@ //@compile-flags: -Zmiri-disable-isolation -//@ignore-target-windows: No mmap on Windows +//@ignore-target: windows # No mmap on Windows #![feature(rustc_private)] diff --git a/src/tools/miri/tests/fail-dep/libc/mmap_use_after_munmap.stderr b/src/tools/miri/tests/fail-dep/libc/mmap_use_after_munmap.stderr index 49f2b84baa85e..8404aeb5a7ae8 100644 --- a/src/tools/miri/tests/fail-dep/libc/mmap_use_after_munmap.stderr +++ b/src/tools/miri/tests/fail-dep/libc/mmap_use_after_munmap.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: memory access failed: ALLOC has been freed, so this pointer is dangling - --> $DIR/mmap_use_after_munmap.rs:LL:CC + --> tests/fail-dep/libc/mmap_use_after_munmap.rs:LL:CC | LL | let _x = *(ptr as *mut u8); | ^^^^^^^^^^^^^^^^^ memory access failed: ALLOC has been freed, so this pointer is dangling @@ -7,7 +7,7 @@ LL | let _x = *(ptr as *mut u8); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information help: ALLOC was allocated here: - --> $DIR/mmap_use_after_munmap.rs:LL:CC + --> tests/fail-dep/libc/mmap_use_after_munmap.rs:LL:CC | LL | let ptr = libc::mmap( | ___________________^ @@ -19,12 +19,12 @@ LL | | 0, LL | | ); | |_________^ help: ALLOC was deallocated here: - --> $DIR/mmap_use_after_munmap.rs:LL:CC + --> tests/fail-dep/libc/mmap_use_after_munmap.rs:LL:CC | LL | libc::munmap(ptr, 4096); | ^^^^^^^^^^^^^^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/mmap_use_after_munmap.rs:LL:CC + = note: inside `main` at tests/fail-dep/libc/mmap_use_after_munmap.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/munmap_partial.rs b/src/tools/miri/tests/fail-dep/libc/munmap_partial.rs index 4386dc71af69c..58aab14ef1d40 100644 --- a/src/tools/miri/tests/fail-dep/libc/munmap_partial.rs +++ b/src/tools/miri/tests/fail-dep/libc/munmap_partial.rs @@ -1,7 +1,7 @@ //! The man pages for mmap/munmap suggest that it is possible to partly unmap a previously-mapped //! region of address space, but to LLVM that would be partial deallocation, which LLVM does not //! support. So even though the man pages say this sort of use is possible, we must report UB. -//@ignore-target-windows: No mmap on Windows +//@ignore-target: windows # No mmap on Windows //@normalize-stderr-test: "size [0-9]+ and alignment" -> "size SIZE and alignment" fn main() { diff --git a/src/tools/miri/tests/fail-dep/libc/munmap_partial.stderr b/src/tools/miri/tests/fail-dep/libc/munmap_partial.stderr index 39825eb27c083..7b1703a968a08 100644 --- a/src/tools/miri/tests/fail-dep/libc/munmap_partial.stderr +++ b/src/tools/miri/tests/fail-dep/libc/munmap_partial.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: incorrect layout on deallocation: ALLOC has size SIZE and alignment ALIGN, but gave size SIZE and alignment ALIGN - --> $DIR/munmap_partial.rs:LL:CC + --> tests/fail-dep/libc/munmap_partial.rs:LL:CC | LL | libc::munmap(ptr, 1); | ^^^^^^^^^^^^^^^^^^^^ incorrect layout on deallocation: ALLOC has size SIZE and alignment ALIGN, but gave size SIZE and alignment ALIGN @@ -7,7 +7,7 @@ LL | libc::munmap(ptr, 1); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/munmap_partial.rs:LL:CC + = note: inside `main` at tests/fail-dep/libc/munmap_partial.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/posix_memalign_size_zero_double_free.rs b/src/tools/miri/tests/fail-dep/libc/posix_memalign_size_zero_double_free.rs index b6b7b007f2b62..be5d372a048f1 100644 --- a/src/tools/miri/tests/fail-dep/libc/posix_memalign_size_zero_double_free.rs +++ b/src/tools/miri/tests/fail-dep/libc/posix_memalign_size_zero_double_free.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No posix_memalign on Windows +//@ignore-target: windows # No posix_memalign on Windows use std::ptr; diff --git a/src/tools/miri/tests/fail-dep/libc/posix_memalign_size_zero_double_free.stderr b/src/tools/miri/tests/fail-dep/libc/posix_memalign_size_zero_double_free.stderr index 3ed117c5a0adb..1d73ec9575415 100644 --- a/src/tools/miri/tests/fail-dep/libc/posix_memalign_size_zero_double_free.stderr +++ b/src/tools/miri/tests/fail-dep/libc/posix_memalign_size_zero_double_free.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: memory access failed: ALLOC has been freed, so this pointer is dangling - --> $DIR/posix_memalign_size_zero_double_free.rs:LL:CC + --> tests/fail-dep/libc/posix_memalign_size_zero_double_free.rs:LL:CC | LL | libc::free(ptr); | ^^^^^^^^^^^^^^^ memory access failed: ALLOC has been freed, so this pointer is dangling @@ -7,17 +7,17 @@ LL | libc::free(ptr); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information help: ALLOC was allocated here: - --> $DIR/posix_memalign_size_zero_double_free.rs:LL:CC + --> tests/fail-dep/libc/posix_memalign_size_zero_double_free.rs:LL:CC | LL | let _ = libc::posix_memalign(&mut ptr, align, size); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: ALLOC was deallocated here: - --> $DIR/posix_memalign_size_zero_double_free.rs:LL:CC + --> tests/fail-dep/libc/posix_memalign_size_zero_double_free.rs:LL:CC | LL | libc::free(ptr); | ^^^^^^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/posix_memalign_size_zero_double_free.rs:LL:CC + = note: inside `main` at tests/fail-dep/libc/posix_memalign_size_zero_double_free.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/posix_memalign_size_zero_leak.rs b/src/tools/miri/tests/fail-dep/libc/posix_memalign_size_zero_leak.rs index 1a4c9605fe01c..2f990b34ab534 100644 --- a/src/tools/miri/tests/fail-dep/libc/posix_memalign_size_zero_leak.rs +++ b/src/tools/miri/tests/fail-dep/libc/posix_memalign_size_zero_leak.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No posix_memalign on Windows +//@ignore-target: windows # No posix_memalign on Windows use std::ptr; diff --git a/src/tools/miri/tests/fail-dep/libc/posix_memalign_size_zero_leak.stderr b/src/tools/miri/tests/fail-dep/libc/posix_memalign_size_zero_leak.stderr index 2639031f1cc50..4546185b13e4d 100644 --- a/src/tools/miri/tests/fail-dep/libc/posix_memalign_size_zero_leak.stderr +++ b/src/tools/miri/tests/fail-dep/libc/posix_memalign_size_zero_leak.stderr @@ -1,11 +1,11 @@ error: memory leaked: ALLOC (C heap, size: 0, align: 64), allocated here: - --> $DIR/posix_memalign_size_zero_leak.rs:LL:CC + --> tests/fail-dep/libc/posix_memalign_size_zero_leak.rs:LL:CC | LL | let _ = unsafe { libc::posix_memalign(&mut ptr, align, size) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: BACKTRACE: - = note: inside `main` at $DIR/posix_memalign_size_zero_leak.rs:LL:CC + = note: inside `main` at tests/fail-dep/libc/posix_memalign_size_zero_leak.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/realloc-zero.stderr b/src/tools/miri/tests/fail-dep/libc/realloc-zero.stderr index 749a61f7396e7..6f8095dbba117 100644 --- a/src/tools/miri/tests/fail-dep/libc/realloc-zero.stderr +++ b/src/tools/miri/tests/fail-dep/libc/realloc-zero.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: `realloc` with a size of zero - --> $DIR/realloc-zero.rs:LL:CC + --> tests/fail-dep/libc/realloc-zero.rs:LL:CC | LL | let p2 = libc::realloc(p1, 0); | ^^^^^^^^^^^^^^^^^^^^ `realloc` with a size of zero @@ -7,7 +7,7 @@ LL | let p2 = libc::realloc(p1, 0); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/realloc-zero.rs:LL:CC + = note: inside `main` at tests/fail-dep/libc/realloc-zero.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/socketpair_read_blocking.rs b/src/tools/miri/tests/fail-dep/libc/socketpair_read_blocking.rs index c28a6d966fe55..ffa4e36f0f4b0 100644 --- a/src/tools/miri/tests/fail-dep/libc/socketpair_read_blocking.rs +++ b/src/tools/miri/tests/fail-dep/libc/socketpair_read_blocking.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: no libc socketpair on Windows +//@ignore-target: windows # no libc socketpair on Windows // This is temporarily here because blocking on fd is not supported yet. // When blocking is eventually supported, this will be moved to pass-dep/libc/libc-socketpair diff --git a/src/tools/miri/tests/fail-dep/libc/socketpair_read_blocking.stderr b/src/tools/miri/tests/fail-dep/libc/socketpair_read_blocking.stderr index b5ed72d9f1b18..dff332f999280 100644 --- a/src/tools/miri/tests/fail-dep/libc/socketpair_read_blocking.stderr +++ b/src/tools/miri/tests/fail-dep/libc/socketpair_read_blocking.stderr @@ -1,12 +1,12 @@ error: unsupported operation: socketpair read: blocking isn't supported yet - --> $DIR/socketpair_read_blocking.rs:LL:CC + --> tests/fail-dep/libc/socketpair_read_blocking.rs:LL:CC | LL | let _res = unsafe { libc::read(fds[1], buf.as_mut_ptr().cast(), buf.len() as libc::size_t) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ socketpair read: blocking isn't supported yet | = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support = note: BACKTRACE: - = note: inside `main` at $DIR/socketpair_read_blocking.rs:LL:CC + = note: inside `main` at tests/fail-dep/libc/socketpair_read_blocking.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/socketpair_write_blocking.rs b/src/tools/miri/tests/fail-dep/libc/socketpair_write_blocking.rs index e2fbc0ae4b426..e83197dfc0f90 100644 --- a/src/tools/miri/tests/fail-dep/libc/socketpair_write_blocking.rs +++ b/src/tools/miri/tests/fail-dep/libc/socketpair_write_blocking.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: no libc socketpair on Windows +//@ignore-target: windows # no libc socketpair on Windows // This is temporarily here because blocking on fd is not supported yet. // When blocking is eventually supported, this will be moved to pass-dep/libc/libc-socketpair fn main() { diff --git a/src/tools/miri/tests/fail-dep/libc/socketpair_write_blocking.stderr b/src/tools/miri/tests/fail-dep/libc/socketpair_write_blocking.stderr index 7b3a0d27636de..0dd89a15c7cfc 100644 --- a/src/tools/miri/tests/fail-dep/libc/socketpair_write_blocking.stderr +++ b/src/tools/miri/tests/fail-dep/libc/socketpair_write_blocking.stderr @@ -1,12 +1,12 @@ error: unsupported operation: socketpair write: blocking isn't supported yet - --> $DIR/socketpair_write_blocking.rs:LL:CC + --> tests/fail-dep/libc/socketpair_write_blocking.rs:LL:CC | LL | let _ = unsafe { libc::write(fds[0], data as *const libc::c_void, 3) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ socketpair write: blocking isn't supported yet | = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support = note: BACKTRACE: - = note: inside `main` at $DIR/socketpair_write_blocking.rs:LL:CC + = note: inside `main` at tests/fail-dep/libc/socketpair_write_blocking.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/unsupported_incomplete_function.rs b/src/tools/miri/tests/fail-dep/libc/unsupported_incomplete_function.rs index cd8422f4afd40..b23b90d6fcd4a 100644 --- a/src/tools/miri/tests/fail-dep/libc/unsupported_incomplete_function.rs +++ b/src/tools/miri/tests/fail-dep/libc/unsupported_incomplete_function.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-target-windows: No `libc::signal` on Windows +//@ignore-target: windows # No `libc: #signal` on Windows //@normalize-stderr-test: "OS `.*`" -> "$$OS" fn main() { diff --git a/src/tools/miri/tests/fail-dep/libc/unsupported_incomplete_function.stderr b/src/tools/miri/tests/fail-dep/libc/unsupported_incomplete_function.stderr index f62622e29bf13..a92a97cef3b34 100644 --- a/src/tools/miri/tests/fail-dep/libc/unsupported_incomplete_function.stderr +++ b/src/tools/miri/tests/fail-dep/libc/unsupported_incomplete_function.stderr @@ -1,5 +1,5 @@ error: unsupported operation: can't call foreign function `signal` on $OS - --> $DIR/unsupported_incomplete_function.rs:LL:CC + --> tests/fail-dep/libc/unsupported_incomplete_function.rs:LL:CC | LL | libc::signal(libc::SIGPIPE, libc::SIG_IGN); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't call foreign function `signal` on $OS @@ -7,7 +7,7 @@ LL | libc::signal(libc::SIGPIPE, libc::SIG_IGN); = help: if this is a basic API commonly used on this target, please report an issue with Miri = help: however, note that Miri does not aim to support every FFI function out there; for instance, we will not support APIs for things such as GUIs, scripting languages, or databases = note: BACKTRACE: - = note: inside `main` at $DIR/unsupported_incomplete_function.rs:LL:CC + = note: inside `main` at tests/fail-dep/libc/unsupported_incomplete_function.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/alloc/alloc_error_handler.stderr b/src/tools/miri/tests/fail/alloc/alloc_error_handler.stderr index d1731a0f4206f..3642f3f28ca2a 100644 --- a/src/tools/miri/tests/fail/alloc/alloc_error_handler.stderr +++ b/src/tools/miri/tests/fail/alloc/alloc_error_handler.stderr @@ -13,7 +13,7 @@ LL | ABORT(); = note: inside `std::alloc::handle_alloc_error::rt_error` at RUSTLIB/alloc/src/alloc.rs:LL:CC = note: inside `std::alloc::handle_alloc_error` at RUSTLIB/alloc/src/alloc.rs:LL:CC note: inside `main` - --> $DIR/alloc_error_handler.rs:LL:CC + --> tests/fail/alloc/alloc_error_handler.rs:LL:CC | LL | handle_alloc_error(Layout::for_value(&0)); | ^ diff --git a/src/tools/miri/tests/fail/alloc/alloc_error_handler_custom.stderr b/src/tools/miri/tests/fail/alloc/alloc_error_handler_custom.stderr index 5d9c2e2fb4c38..d12e119bce3dd 100644 --- a/src/tools/miri/tests/fail/alloc/alloc_error_handler_custom.stderr +++ b/src/tools/miri/tests/fail/alloc/alloc_error_handler_custom.stderr @@ -1,14 +1,14 @@ custom alloc error handler: Layout { size: 4, align: 4 (1 << 2) } error: abnormal termination: the program aborted execution - --> $DIR/alloc_error_handler_custom.rs:LL:CC + --> tests/fail/alloc/alloc_error_handler_custom.rs:LL:CC | LL | core::intrinsics::abort(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ the program aborted execution | = note: BACKTRACE: - = note: inside `alloc_error_handler` at $DIR/alloc_error_handler_custom.rs:LL:CC + = note: inside `alloc_error_handler` at tests/fail/alloc/alloc_error_handler_custom.rs:LL:CC note: inside `_::__rg_oom` - --> $DIR/alloc_error_handler_custom.rs:LL:CC + --> tests/fail/alloc/alloc_error_handler_custom.rs:LL:CC | LL | #[alloc_error_handler] | ---------------------- in this procedural macro expansion @@ -17,7 +17,7 @@ LL | fn alloc_error_handler(layout: Layout) -> ! { = note: inside `alloc::alloc::handle_alloc_error::rt_error` at RUSTLIB/alloc/src/alloc.rs:LL:CC = note: inside `alloc::alloc::handle_alloc_error` at RUSTLIB/alloc/src/alloc.rs:LL:CC note: inside `start` - --> $DIR/alloc_error_handler_custom.rs:LL:CC + --> tests/fail/alloc/alloc_error_handler_custom.rs:LL:CC | LL | handle_alloc_error(Layout::for_value(&0)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/alloc/alloc_error_handler_no_std.stderr b/src/tools/miri/tests/fail/alloc/alloc_error_handler_no_std.stderr index 6b98f6f75d853..f495d65a8b017 100644 --- a/src/tools/miri/tests/fail/alloc/alloc_error_handler_no_std.stderr +++ b/src/tools/miri/tests/fail/alloc/alloc_error_handler_no_std.stderr @@ -2,18 +2,18 @@ custom panic handler called! panicked at RUSTLIB/alloc/src/alloc.rs:LL:CC: memory allocation of 4 bytes failed error: abnormal termination: the program aborted execution - --> $DIR/alloc_error_handler_no_std.rs:LL:CC + --> tests/fail/alloc/alloc_error_handler_no_std.rs:LL:CC | LL | core::intrinsics::abort(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ the program aborted execution | = note: BACKTRACE: - = note: inside `panic_handler` at $DIR/alloc_error_handler_no_std.rs:LL:CC + = note: inside `panic_handler` at tests/fail/alloc/alloc_error_handler_no_std.rs:LL:CC = note: inside `alloc::alloc::__alloc_error_handler::__rdl_oom` at RUSTLIB/alloc/src/alloc.rs:LL:CC = note: inside `alloc::alloc::handle_alloc_error::rt_error` at RUSTLIB/alloc/src/alloc.rs:LL:CC = note: inside `alloc::alloc::handle_alloc_error` at RUSTLIB/alloc/src/alloc.rs:LL:CC note: inside `start` - --> $DIR/alloc_error_handler_no_std.rs:LL:CC + --> tests/fail/alloc/alloc_error_handler_no_std.rs:LL:CC | LL | handle_alloc_error(Layout::for_value(&0)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/alloc/deallocate-bad-alignment.stderr b/src/tools/miri/tests/fail/alloc/deallocate-bad-alignment.stderr index d340413d231b6..f07db3c62c91d 100644 --- a/src/tools/miri/tests/fail/alloc/deallocate-bad-alignment.stderr +++ b/src/tools/miri/tests/fail/alloc/deallocate-bad-alignment.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: incorrect layout on deallocation: ALLOC has size 1 and alignment ALIGN, but gave size 1 and alignment ALIGN - --> $DIR/deallocate-bad-alignment.rs:LL:CC + --> tests/fail/alloc/deallocate-bad-alignment.rs:LL:CC | LL | dealloc(x, Layout::from_size_align_unchecked(1, 2)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect layout on deallocation: ALLOC has size 1 and alignment ALIGN, but gave size 1 and alignment ALIGN @@ -7,7 +7,7 @@ LL | dealloc(x, Layout::from_size_align_unchecked(1, 2)); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/deallocate-bad-alignment.rs:LL:CC + = note: inside `main` at tests/fail/alloc/deallocate-bad-alignment.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/alloc/deallocate-bad-size.stderr b/src/tools/miri/tests/fail/alloc/deallocate-bad-size.stderr index b661b49c9f343..c913bde04cc91 100644 --- a/src/tools/miri/tests/fail/alloc/deallocate-bad-size.stderr +++ b/src/tools/miri/tests/fail/alloc/deallocate-bad-size.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: incorrect layout on deallocation: ALLOC has size 1 and alignment ALIGN, but gave size 2 and alignment ALIGN - --> $DIR/deallocate-bad-size.rs:LL:CC + --> tests/fail/alloc/deallocate-bad-size.rs:LL:CC | LL | dealloc(x, Layout::from_size_align_unchecked(2, 1)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect layout on deallocation: ALLOC has size 1 and alignment ALIGN, but gave size 2 and alignment ALIGN @@ -7,7 +7,7 @@ LL | dealloc(x, Layout::from_size_align_unchecked(2, 1)); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/deallocate-bad-size.rs:LL:CC + = note: inside `main` at tests/fail/alloc/deallocate-bad-size.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/alloc/deallocate-twice.stderr b/src/tools/miri/tests/fail/alloc/deallocate-twice.stderr index 32cdfa0d228f3..9e6ce3d45a726 100644 --- a/src/tools/miri/tests/fail/alloc/deallocate-twice.stderr +++ b/src/tools/miri/tests/fail/alloc/deallocate-twice.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: memory access failed: ALLOC has been freed, so this pointer is dangling - --> $DIR/deallocate-twice.rs:LL:CC + --> tests/fail/alloc/deallocate-twice.rs:LL:CC | LL | dealloc(x, Layout::from_size_align_unchecked(1, 1)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: ALLOC has been freed, so this pointer is dangling @@ -7,17 +7,17 @@ LL | dealloc(x, Layout::from_size_align_unchecked(1, 1)); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information help: ALLOC was allocated here: - --> $DIR/deallocate-twice.rs:LL:CC + --> tests/fail/alloc/deallocate-twice.rs:LL:CC | LL | let x = alloc(Layout::from_size_align_unchecked(1, 1)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: ALLOC was deallocated here: - --> $DIR/deallocate-twice.rs:LL:CC + --> tests/fail/alloc/deallocate-twice.rs:LL:CC | LL | dealloc(x, Layout::from_size_align_unchecked(1, 1)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/deallocate-twice.rs:LL:CC + = note: inside `main` at tests/fail/alloc/deallocate-twice.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/alloc/global_system_mixup.stderr b/src/tools/miri/tests/fail/alloc/global_system_mixup.stderr index 287a1f1a3e396..4c355c511ef45 100644 --- a/src/tools/miri/tests/fail/alloc/global_system_mixup.stderr +++ b/src/tools/miri/tests/fail/alloc/global_system_mixup.stderr @@ -10,7 +10,7 @@ LL | FREE(); = note: inside `std::sys::alloc::PLATFORM::::dealloc` at RUSTLIB/std/src/sys/alloc/PLATFORM.rs:LL:CC = note: inside `::deallocate` at RUSTLIB/std/src/alloc.rs:LL:CC note: inside `main` - --> $DIR/global_system_mixup.rs:LL:CC + --> tests/fail/alloc/global_system_mixup.rs:LL:CC | LL | unsafe { System.deallocate(ptr, l) }; | ^ diff --git a/src/tools/miri/tests/fail/alloc/no_global_allocator.stderr b/src/tools/miri/tests/fail/alloc/no_global_allocator.stderr index 82bcb48cbe6ac..e08a747f7fafc 100644 --- a/src/tools/miri/tests/fail/alloc/no_global_allocator.stderr +++ b/src/tools/miri/tests/fail/alloc/no_global_allocator.stderr @@ -1,5 +1,5 @@ error: unsupported operation: can't call foreign function `__rust_alloc` on $OS - --> $DIR/no_global_allocator.rs:LL:CC + --> tests/fail/alloc/no_global_allocator.rs:LL:CC | LL | __rust_alloc(1, 1); | ^^^^^^^^^^^^^^^^^^ can't call foreign function `__rust_alloc` on $OS @@ -7,7 +7,7 @@ LL | __rust_alloc(1, 1); = help: if this is a basic API commonly used on this target, please report an issue with Miri = help: however, note that Miri does not aim to support every FFI function out there; for instance, we will not support APIs for things such as GUIs, scripting languages, or databases = note: BACKTRACE: - = note: inside `start` at $DIR/no_global_allocator.rs:LL:CC + = note: inside `start` at tests/fail/alloc/no_global_allocator.rs:LL:CC error: aborting due to 1 previous error diff --git a/src/tools/miri/tests/fail/alloc/reallocate-bad-size.stderr b/src/tools/miri/tests/fail/alloc/reallocate-bad-size.stderr index 965cbc4dd0358..6f6c8850603d4 100644 --- a/src/tools/miri/tests/fail/alloc/reallocate-bad-size.stderr +++ b/src/tools/miri/tests/fail/alloc/reallocate-bad-size.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: incorrect layout on deallocation: ALLOC has size 1 and alignment ALIGN, but gave size 2 and alignment ALIGN - --> $DIR/reallocate-bad-size.rs:LL:CC + --> tests/fail/alloc/reallocate-bad-size.rs:LL:CC | LL | let _y = realloc(x, Layout::from_size_align_unchecked(2, 1), 1); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect layout on deallocation: ALLOC has size 1 and alignment ALIGN, but gave size 2 and alignment ALIGN @@ -7,7 +7,7 @@ LL | let _y = realloc(x, Layout::from_size_align_unchecked(2, 1), 1); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/reallocate-bad-size.rs:LL:CC + = note: inside `main` at tests/fail/alloc/reallocate-bad-size.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/alloc/reallocate-change-alloc.stderr b/src/tools/miri/tests/fail/alloc/reallocate-change-alloc.stderr index fb3b035b11611..17b40fbdcdcdc 100644 --- a/src/tools/miri/tests/fail/alloc/reallocate-change-alloc.stderr +++ b/src/tools/miri/tests/fail/alloc/reallocate-change-alloc.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: memory access failed: ALLOC has been freed, so this pointer is dangling - --> $DIR/reallocate-change-alloc.rs:LL:CC + --> tests/fail/alloc/reallocate-change-alloc.rs:LL:CC | LL | let _z = *x; | ^^ memory access failed: ALLOC has been freed, so this pointer is dangling @@ -7,17 +7,17 @@ LL | let _z = *x; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information help: ALLOC was allocated here: - --> $DIR/reallocate-change-alloc.rs:LL:CC + --> tests/fail/alloc/reallocate-change-alloc.rs:LL:CC | LL | let x = alloc(Layout::from_size_align_unchecked(1, 1)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: ALLOC was deallocated here: - --> $DIR/reallocate-change-alloc.rs:LL:CC + --> tests/fail/alloc/reallocate-change-alloc.rs:LL:CC | LL | let _y = realloc(x, Layout::from_size_align_unchecked(1, 1), 1); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/reallocate-change-alloc.rs:LL:CC + = note: inside `main` at tests/fail/alloc/reallocate-change-alloc.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/alloc/reallocate-dangling.stderr b/src/tools/miri/tests/fail/alloc/reallocate-dangling.stderr index 9a582b9b4cf1a..06960380f6c94 100644 --- a/src/tools/miri/tests/fail/alloc/reallocate-dangling.stderr +++ b/src/tools/miri/tests/fail/alloc/reallocate-dangling.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: memory access failed: ALLOC has been freed, so this pointer is dangling - --> $DIR/reallocate-dangling.rs:LL:CC + --> tests/fail/alloc/reallocate-dangling.rs:LL:CC | LL | let _z = realloc(x, Layout::from_size_align_unchecked(1, 1), 1); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: ALLOC has been freed, so this pointer is dangling @@ -7,17 +7,17 @@ LL | let _z = realloc(x, Layout::from_size_align_unchecked(1, 1), 1); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information help: ALLOC was allocated here: - --> $DIR/reallocate-dangling.rs:LL:CC + --> tests/fail/alloc/reallocate-dangling.rs:LL:CC | LL | let x = alloc(Layout::from_size_align_unchecked(1, 1)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: ALLOC was deallocated here: - --> $DIR/reallocate-dangling.rs:LL:CC + --> tests/fail/alloc/reallocate-dangling.rs:LL:CC | LL | dealloc(x, Layout::from_size_align_unchecked(1, 1)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/reallocate-dangling.rs:LL:CC + = note: inside `main` at tests/fail/alloc/reallocate-dangling.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/alloc/stack_free.stderr b/src/tools/miri/tests/fail/alloc/stack_free.stderr index 36e78c1b7fb5a..7d7cee133c653 100644 --- a/src/tools/miri/tests/fail/alloc/stack_free.stderr +++ b/src/tools/miri/tests/fail/alloc/stack_free.stderr @@ -11,7 +11,7 @@ LL | self.1.deallocate(From::from(ptr.cast()), layout); = note: inside `std::ptr::drop_in_place::> - shim(Some(std::boxed::Box))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC = note: inside `std::mem::drop::>` at RUSTLIB/core/src/mem/mod.rs:LL:CC note: inside `main` - --> $DIR/stack_free.rs:LL:CC + --> tests/fail/alloc/stack_free.rs:LL:CC | LL | drop(bad_box); | ^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/alloc/too_large.stderr b/src/tools/miri/tests/fail/alloc/too_large.stderr index 77dcf91d843f9..03e54088e3b50 100644 --- a/src/tools/miri/tests/fail/alloc/too_large.stderr +++ b/src/tools/miri/tests/fail/alloc/too_large.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: creating an allocation larger than half the address space - --> $DIR/too_large.rs:LL:CC + --> tests/fail/alloc/too_large.rs:LL:CC | LL | __rust_alloc(bytes, 1); | ^^^^^^^^^^^^^^^^^^^^^^ creating an allocation larger than half the address space @@ -7,7 +7,7 @@ LL | __rust_alloc(bytes, 1); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/too_large.rs:LL:CC + = note: inside `main` at tests/fail/alloc/too_large.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/alloc/unsupported_big_alignment.stderr b/src/tools/miri/tests/fail/alloc/unsupported_big_alignment.stderr index 4c783b866c877..8eb71f5ce8459 100644 --- a/src/tools/miri/tests/fail/alloc/unsupported_big_alignment.stderr +++ b/src/tools/miri/tests/fail/alloc/unsupported_big_alignment.stderr @@ -1,12 +1,12 @@ error: unsupported operation: creating allocation with alignment ALIGN exceeding rustc's maximum supported value - --> $DIR/unsupported_big_alignment.rs:LL:CC + --> tests/fail/alloc/unsupported_big_alignment.rs:LL:CC | LL | __rust_alloc(1, 1 << 30); | ^^^^^^^^^^^^^^^^^^^^^^^^ creating allocation with alignment ALIGN exceeding rustc's maximum supported value | = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support = note: BACKTRACE: - = note: inside `main` at $DIR/unsupported_big_alignment.rs:LL:CC + = note: inside `main` at tests/fail/alloc/unsupported_big_alignment.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/alloc/unsupported_non_power_two_alignment.stderr b/src/tools/miri/tests/fail/alloc/unsupported_non_power_two_alignment.stderr index 69a6c375f47f0..0a36d3d58b616 100644 --- a/src/tools/miri/tests/fail/alloc/unsupported_non_power_two_alignment.stderr +++ b/src/tools/miri/tests/fail/alloc/unsupported_non_power_two_alignment.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: creating allocation with non-power-of-two alignment ALIGN - --> $DIR/unsupported_non_power_two_alignment.rs:LL:CC + --> tests/fail/alloc/unsupported_non_power_two_alignment.rs:LL:CC | LL | __rust_alloc(1, 3); | ^^^^^^^^^^^^^^^^^^ creating allocation with non-power-of-two alignment ALIGN @@ -7,7 +7,7 @@ LL | __rust_alloc(1, 3); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/unsupported_non_power_two_alignment.rs:LL:CC + = note: inside `main` at tests/fail/alloc/unsupported_non_power_two_alignment.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/alias_through_mutation.stack.stderr b/src/tools/miri/tests/fail/both_borrows/alias_through_mutation.stack.stderr index 6903a52f304c7..d7e7c2bc03933 100644 --- a/src/tools/miri/tests/fail/both_borrows/alias_through_mutation.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/alias_through_mutation.stack.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: attempting a read access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/alias_through_mutation.rs:LL:CC + --> tests/fail/both_borrows/alias_through_mutation.rs:LL:CC | LL | let _val = *target_alias; | ^^^^^^^^^^^^^ @@ -10,17 +10,17 @@ LL | let _val = *target_alias; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadOnly retag at offsets [0x0..0x4] - --> $DIR/alias_through_mutation.rs:LL:CC + --> tests/fail/both_borrows/alias_through_mutation.rs:LL:CC | LL | *x = &mut *(target as *mut _); | ^^^^^^^^^^^^^^^^^^^^^^^^ help: was later invalidated at offsets [0x0..0x4] by a write access - --> $DIR/alias_through_mutation.rs:LL:CC + --> tests/fail/both_borrows/alias_through_mutation.rs:LL:CC | LL | *target = 13; | ^^^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/alias_through_mutation.rs:LL:CC + = note: inside `main` at tests/fail/both_borrows/alias_through_mutation.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/alias_through_mutation.tree.stderr b/src/tools/miri/tests/fail/both_borrows/alias_through_mutation.tree.stderr index 0bd196eab1b83..c146658d31035 100644 --- a/src/tools/miri/tests/fail/both_borrows/alias_through_mutation.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/alias_through_mutation.tree.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: read access through at ALLOC[0x0] is forbidden - --> $DIR/alias_through_mutation.rs:LL:CC + --> tests/fail/both_borrows/alias_through_mutation.rs:LL:CC | LL | let _val = *target_alias; | ^^^^^^^^^^^^^ read access through at ALLOC[0x0] is forbidden @@ -7,18 +7,18 @@ LL | let _val = *target_alias; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental = help: the accessed tag has state Disabled which forbids this child read access help: the accessed tag was created here, in the initial state Frozen - --> $DIR/alias_through_mutation.rs:LL:CC + --> tests/fail/both_borrows/alias_through_mutation.rs:LL:CC | LL | *x = &mut *(target as *mut _); | ^^^^^^^^^^^^^^^^^^^^^^^^ help: the accessed tag later transitioned to Disabled due to a foreign write access at offsets [0x0..0x4] - --> $DIR/alias_through_mutation.rs:LL:CC + --> tests/fail/both_borrows/alias_through_mutation.rs:LL:CC | LL | *target = 13; | ^^^^^^^^^^^^ = help: this transition corresponds to a loss of read permissions = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/alias_through_mutation.rs:LL:CC + = note: inside `main` at tests/fail/both_borrows/alias_through_mutation.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/aliasing_mut1.stack.stderr b/src/tools/miri/tests/fail/both_borrows/aliasing_mut1.stack.stderr index 4f9e6222db266..170027d9f904f 100644 --- a/src/tools/miri/tests/fail/both_borrows/aliasing_mut1.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/aliasing_mut1.stack.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: not granting access to tag because that would remove [Unique for ] which is strongly protected - --> $DIR/aliasing_mut1.rs:LL:CC + --> tests/fail/both_borrows/aliasing_mut1.rs:LL:CC | LL | pub fn safe(x: &mut i32, y: &mut i32) { | ^ not granting access to tag because that would remove [Unique for ] which is strongly protected @@ -7,19 +7,19 @@ LL | pub fn safe(x: &mut i32, y: &mut i32) { = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a Unique retag at offsets [0x0..0x4] - --> $DIR/aliasing_mut1.rs:LL:CC + --> tests/fail/both_borrows/aliasing_mut1.rs:LL:CC | LL | let xraw: *mut i32 = unsafe { mem::transmute(&mut x) }; | ^^^^^^ help: is this argument - --> $DIR/aliasing_mut1.rs:LL:CC + --> tests/fail/both_borrows/aliasing_mut1.rs:LL:CC | LL | pub fn safe(x: &mut i32, y: &mut i32) { | ^ = note: BACKTRACE (of the first span): - = note: inside `safe` at $DIR/aliasing_mut1.rs:LL:CC + = note: inside `safe` at tests/fail/both_borrows/aliasing_mut1.rs:LL:CC note: inside `main` - --> $DIR/aliasing_mut1.rs:LL:CC + --> tests/fail/both_borrows/aliasing_mut1.rs:LL:CC | LL | safe_raw(xraw, xraw); | ^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/both_borrows/aliasing_mut1.tree.stderr b/src/tools/miri/tests/fail/both_borrows/aliasing_mut1.tree.stderr index 3aff0a41de231..62ab1c4f87285 100644 --- a/src/tools/miri/tests/fail/both_borrows/aliasing_mut1.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/aliasing_mut1.tree.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: write access through at ALLOC[0x0] is forbidden - --> $DIR/aliasing_mut1.rs:LL:CC + --> tests/fail/both_borrows/aliasing_mut1.rs:LL:CC | LL | *x = 1; | ^^^^^^ write access through at ALLOC[0x0] is forbidden @@ -7,20 +7,20 @@ LL | *x = 1; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental = help: the accessed tag has state Reserved (conflicted) which forbids this child write access help: the accessed tag was created here, in the initial state Reserved - --> $DIR/aliasing_mut1.rs:LL:CC + --> tests/fail/both_borrows/aliasing_mut1.rs:LL:CC | LL | pub fn safe(x: &mut i32, y: &mut i32) { | ^ help: the accessed tag later transitioned to Reserved (conflicted) due to a reborrow (acting as a foreign read access) at offsets [0x0..0x4] - --> $DIR/aliasing_mut1.rs:LL:CC + --> tests/fail/both_borrows/aliasing_mut1.rs:LL:CC | LL | pub fn safe(x: &mut i32, y: &mut i32) { | ^ = help: this transition corresponds to a temporary loss of write permissions until function exit = note: BACKTRACE (of the first span): - = note: inside `safe` at $DIR/aliasing_mut1.rs:LL:CC + = note: inside `safe` at tests/fail/both_borrows/aliasing_mut1.rs:LL:CC note: inside `main` - --> $DIR/aliasing_mut1.rs:LL:CC + --> tests/fail/both_borrows/aliasing_mut1.rs:LL:CC | LL | safe_raw(xraw, xraw); | ^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/both_borrows/aliasing_mut2.stack.stderr b/src/tools/miri/tests/fail/both_borrows/aliasing_mut2.stack.stderr index 54679d177da0f..274dc22a7e175 100644 --- a/src/tools/miri/tests/fail/both_borrows/aliasing_mut2.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/aliasing_mut2.stack.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: not granting access to tag because that would remove [SharedReadOnly for ] which is strongly protected - --> $DIR/aliasing_mut2.rs:LL:CC + --> tests/fail/both_borrows/aliasing_mut2.rs:LL:CC | LL | pub fn safe(x: &i32, y: &mut i32) { | ^ not granting access to tag because that would remove [SharedReadOnly for ] which is strongly protected @@ -7,19 +7,19 @@ LL | pub fn safe(x: &i32, y: &mut i32) { = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a Unique retag at offsets [0x0..0x4] - --> $DIR/aliasing_mut2.rs:LL:CC + --> tests/fail/both_borrows/aliasing_mut2.rs:LL:CC | LL | let xref = &mut x; | ^^^^^^ help: is this argument - --> $DIR/aliasing_mut2.rs:LL:CC + --> tests/fail/both_borrows/aliasing_mut2.rs:LL:CC | LL | pub fn safe(x: &i32, y: &mut i32) { | ^ = note: BACKTRACE (of the first span): - = note: inside `safe` at $DIR/aliasing_mut2.rs:LL:CC + = note: inside `safe` at tests/fail/both_borrows/aliasing_mut2.rs:LL:CC note: inside `main` - --> $DIR/aliasing_mut2.rs:LL:CC + --> tests/fail/both_borrows/aliasing_mut2.rs:LL:CC | LL | safe_raw(xshr, xraw); | ^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/both_borrows/aliasing_mut2.tree.stderr b/src/tools/miri/tests/fail/both_borrows/aliasing_mut2.tree.stderr index d8602a54c6408..f3d7a0168255e 100644 --- a/src/tools/miri/tests/fail/both_borrows/aliasing_mut2.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/aliasing_mut2.tree.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: write access through at ALLOC[0x0] is forbidden - --> $DIR/aliasing_mut2.rs:LL:CC + --> tests/fail/both_borrows/aliasing_mut2.rs:LL:CC | LL | *y = 2; | ^^^^^^ write access through at ALLOC[0x0] is forbidden @@ -7,20 +7,20 @@ LL | *y = 2; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental = help: the accessed tag has state Reserved (conflicted) which forbids this child write access help: the accessed tag was created here, in the initial state Reserved - --> $DIR/aliasing_mut2.rs:LL:CC + --> tests/fail/both_borrows/aliasing_mut2.rs:LL:CC | LL | pub fn safe(x: &i32, y: &mut i32) { | ^ help: the accessed tag later transitioned to Reserved (conflicted) due to a foreign read access at offsets [0x0..0x4] - --> $DIR/aliasing_mut2.rs:LL:CC + --> tests/fail/both_borrows/aliasing_mut2.rs:LL:CC | LL | let _v = *x; | ^^ = help: this transition corresponds to a temporary loss of write permissions until function exit = note: BACKTRACE (of the first span): - = note: inside `safe` at $DIR/aliasing_mut2.rs:LL:CC + = note: inside `safe` at tests/fail/both_borrows/aliasing_mut2.rs:LL:CC note: inside `main` - --> $DIR/aliasing_mut2.rs:LL:CC + --> tests/fail/both_borrows/aliasing_mut2.rs:LL:CC | LL | safe_raw(xshr, xraw); | ^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/both_borrows/aliasing_mut3.stack.stderr b/src/tools/miri/tests/fail/both_borrows/aliasing_mut3.stack.stderr index b04139f3bd9cb..a89baa50ff397 100644 --- a/src/tools/miri/tests/fail/both_borrows/aliasing_mut3.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/aliasing_mut3.stack.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: trying to retag from for SharedReadOnly permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/aliasing_mut3.rs:LL:CC + --> tests/fail/both_borrows/aliasing_mut3.rs:LL:CC | LL | pub fn safe(x: &mut i32, y: &i32) { | ^ @@ -10,19 +10,19 @@ LL | pub fn safe(x: &mut i32, y: &i32) { = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadOnly retag at offsets [0x0..0x4] - --> $DIR/aliasing_mut3.rs:LL:CC + --> tests/fail/both_borrows/aliasing_mut3.rs:LL:CC | LL | safe_raw(xraw, xshr); | ^^^^ help: was later invalidated at offsets [0x0..0x4] by a Unique function-entry retag inside this call - --> $DIR/aliasing_mut3.rs:LL:CC + --> tests/fail/both_borrows/aliasing_mut3.rs:LL:CC | LL | safe_raw(xraw, xshr); | ^^^^^^^^^^^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `safe` at $DIR/aliasing_mut3.rs:LL:CC + = note: inside `safe` at tests/fail/both_borrows/aliasing_mut3.rs:LL:CC note: inside `main` - --> $DIR/aliasing_mut3.rs:LL:CC + --> tests/fail/both_borrows/aliasing_mut3.rs:LL:CC | LL | safe_raw(xraw, xshr); | ^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/both_borrows/aliasing_mut3.tree.stderr b/src/tools/miri/tests/fail/both_borrows/aliasing_mut3.tree.stderr index 83191962a3f87..ba9197a50d6d1 100644 --- a/src/tools/miri/tests/fail/both_borrows/aliasing_mut3.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/aliasing_mut3.tree.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: write access through at ALLOC[0x0] is forbidden - --> $DIR/aliasing_mut3.rs:LL:CC + --> tests/fail/both_borrows/aliasing_mut3.rs:LL:CC | LL | *x = 1; | ^^^^^^ write access through at ALLOC[0x0] is forbidden @@ -7,20 +7,20 @@ LL | *x = 1; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental = help: the accessed tag has state Reserved (conflicted) which forbids this child write access help: the accessed tag was created here, in the initial state Reserved - --> $DIR/aliasing_mut3.rs:LL:CC + --> tests/fail/both_borrows/aliasing_mut3.rs:LL:CC | LL | pub fn safe(x: &mut i32, y: &i32) { | ^ help: the accessed tag later transitioned to Reserved (conflicted) due to a reborrow (acting as a foreign read access) at offsets [0x0..0x4] - --> $DIR/aliasing_mut3.rs:LL:CC + --> tests/fail/both_borrows/aliasing_mut3.rs:LL:CC | LL | pub fn safe(x: &mut i32, y: &i32) { | ^ = help: this transition corresponds to a temporary loss of write permissions until function exit = note: BACKTRACE (of the first span): - = note: inside `safe` at $DIR/aliasing_mut3.rs:LL:CC + = note: inside `safe` at tests/fail/both_borrows/aliasing_mut3.rs:LL:CC note: inside `main` - --> $DIR/aliasing_mut3.rs:LL:CC + --> tests/fail/both_borrows/aliasing_mut3.rs:LL:CC | LL | safe_raw(xraw, xshr); | ^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/both_borrows/aliasing_mut4.stack.stderr b/src/tools/miri/tests/fail/both_borrows/aliasing_mut4.stack.stderr index b3e97c92f1a29..bdda7139490ae 100644 --- a/src/tools/miri/tests/fail/both_borrows/aliasing_mut4.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/aliasing_mut4.stack.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: not granting access to tag because that would remove [SharedReadOnly for ] which is strongly protected - --> $DIR/aliasing_mut4.rs:LL:CC + --> tests/fail/both_borrows/aliasing_mut4.rs:LL:CC | LL | pub fn safe(x: &i32, y: &mut Cell) { | ^ not granting access to tag because that would remove [SharedReadOnly for ] which is strongly protected @@ -7,19 +7,19 @@ LL | pub fn safe(x: &i32, y: &mut Cell) { = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a Unique retag at offsets [0x0..0x4] - --> $DIR/aliasing_mut4.rs:LL:CC + --> tests/fail/both_borrows/aliasing_mut4.rs:LL:CC | LL | let xref = &mut x; | ^^^^^^ help: is this argument - --> $DIR/aliasing_mut4.rs:LL:CC + --> tests/fail/both_borrows/aliasing_mut4.rs:LL:CC | LL | pub fn safe(x: &i32, y: &mut Cell) { | ^ = note: BACKTRACE (of the first span): - = note: inside `safe` at $DIR/aliasing_mut4.rs:LL:CC + = note: inside `safe` at tests/fail/both_borrows/aliasing_mut4.rs:LL:CC note: inside `main` - --> $DIR/aliasing_mut4.rs:LL:CC + --> tests/fail/both_borrows/aliasing_mut4.rs:LL:CC | LL | safe_raw(xshr, xraw as *mut _); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/both_borrows/aliasing_mut4.tree.stderr b/src/tools/miri/tests/fail/both_borrows/aliasing_mut4.tree.stderr index b1f1e231e5ab8..5162368b51fc1 100644 --- a/src/tools/miri/tests/fail/both_borrows/aliasing_mut4.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/aliasing_mut4.tree.stderr @@ -9,12 +9,12 @@ LL | ptr::write(dest, src); = help: this foreign write access would cause the protected tag (currently Frozen) to become Disabled = help: protected tags must never be Disabled help: the accessed tag was created here - --> $DIR/aliasing_mut4.rs:LL:CC + --> tests/fail/both_borrows/aliasing_mut4.rs:LL:CC | LL | y.set(1); | ^^^^^^^^ help: the protected tag was created here, in the initial state Frozen - --> $DIR/aliasing_mut4.rs:LL:CC + --> tests/fail/both_borrows/aliasing_mut4.rs:LL:CC | LL | pub fn safe(x: &i32, y: &mut Cell) { | ^ @@ -23,12 +23,12 @@ LL | pub fn safe(x: &i32, y: &mut Cell) { = note: inside `std::cell::Cell::::replace` at RUSTLIB/core/src/cell.rs:LL:CC = note: inside `std::cell::Cell::::set` at RUSTLIB/core/src/cell.rs:LL:CC note: inside `safe` - --> $DIR/aliasing_mut4.rs:LL:CC + --> tests/fail/both_borrows/aliasing_mut4.rs:LL:CC | LL | y.set(1); | ^^^^^^^^ note: inside `main` - --> $DIR/aliasing_mut4.rs:LL:CC + --> tests/fail/both_borrows/aliasing_mut4.rs:LL:CC | LL | safe_raw(xshr, xraw as *mut _); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/both_borrows/box_exclusive_violation1.stack.stderr b/src/tools/miri/tests/fail/both_borrows/box_exclusive_violation1.stack.stderr index bed0b880c3a39..0cffdcd21c43f 100644 --- a/src/tools/miri/tests/fail/both_borrows/box_exclusive_violation1.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/box_exclusive_violation1.stack.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: attempting a write access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/box_exclusive_violation1.rs:LL:CC + --> tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC | LL | *LEAK = 7; | ^^^^^^^^^ @@ -10,24 +10,24 @@ LL | *LEAK = 7; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadOnly retag at offsets [0x0..0x4] - --> $DIR/box_exclusive_violation1.rs:LL:CC + --> tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC | LL | LEAK = x as *const _ as *mut _; | ^ help: was later invalidated at offsets [0x0..0x4] by a write access - --> $DIR/box_exclusive_violation1.rs:LL:CC + --> tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC | LL | *our = 5; | ^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `unknown_code_2` at $DIR/box_exclusive_violation1.rs:LL:CC + = note: inside `unknown_code_2` at tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC note: inside `demo_box_advanced_unique` - --> $DIR/box_exclusive_violation1.rs:LL:CC + --> tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC | LL | unknown_code_2(); | ^^^^^^^^^^^^^^^^ note: inside `main` - --> $DIR/box_exclusive_violation1.rs:LL:CC + --> tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC | LL | demo_box_advanced_unique(Box::new(0)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/both_borrows/box_exclusive_violation1.tree.stderr b/src/tools/miri/tests/fail/both_borrows/box_exclusive_violation1.tree.stderr index 27d987feb574d..075df9982c627 100644 --- a/src/tools/miri/tests/fail/both_borrows/box_exclusive_violation1.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/box_exclusive_violation1.tree.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: write access through at ALLOC[0x0] is forbidden - --> $DIR/box_exclusive_violation1.rs:LL:CC + --> tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC | LL | *LEAK = 7; | ^^^^^^^^^ write access through at ALLOC[0x0] is forbidden @@ -7,25 +7,25 @@ LL | *LEAK = 7; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental = help: the accessed tag has state Disabled which forbids this child write access help: the accessed tag was created here, in the initial state Frozen - --> $DIR/box_exclusive_violation1.rs:LL:CC + --> tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC | LL | fn unknown_code_1(x: &i32) { | ^ help: the accessed tag later transitioned to Disabled due to a foreign write access at offsets [0x0..0x4] - --> $DIR/box_exclusive_violation1.rs:LL:CC + --> tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC | LL | *our = 5; | ^^^^^^^^ = help: this transition corresponds to a loss of read permissions = note: BACKTRACE (of the first span): - = note: inside `unknown_code_2` at $DIR/box_exclusive_violation1.rs:LL:CC + = note: inside `unknown_code_2` at tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC note: inside `demo_box_advanced_unique` - --> $DIR/box_exclusive_violation1.rs:LL:CC + --> tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC | LL | unknown_code_2(); | ^^^^^^^^^^^^^^^^ note: inside `main` - --> $DIR/box_exclusive_violation1.rs:LL:CC + --> tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC | LL | demo_box_advanced_unique(Box::new(0)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/both_borrows/box_noalias_violation.stack.stderr b/src/tools/miri/tests/fail/both_borrows/box_noalias_violation.stack.stderr index a9ea7a9e9c401..3dc3f8c6619d5 100644 --- a/src/tools/miri/tests/fail/both_borrows/box_noalias_violation.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/box_noalias_violation.stack.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: not granting access to tag because that would remove [Unique for ] which is weakly protected - --> $DIR/box_noalias_violation.rs:LL:CC + --> tests/fail/both_borrows/box_noalias_violation.rs:LL:CC | LL | *y | ^^ not granting access to tag because that would remove [Unique for ] which is weakly protected @@ -7,19 +7,19 @@ LL | *y = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadWrite retag at offsets [0x0..0x4] - --> $DIR/box_noalias_violation.rs:LL:CC + --> tests/fail/both_borrows/box_noalias_violation.rs:LL:CC | LL | let ptr = &mut v as *mut i32; | ^^^^^^ help: is this argument - --> $DIR/box_noalias_violation.rs:LL:CC + --> tests/fail/both_borrows/box_noalias_violation.rs:LL:CC | LL | unsafe fn test(mut x: Box, y: *const i32) -> i32 { | ^^^^^ = note: BACKTRACE (of the first span): - = note: inside `test` at $DIR/box_noalias_violation.rs:LL:CC + = note: inside `test` at tests/fail/both_borrows/box_noalias_violation.rs:LL:CC note: inside `main` - --> $DIR/box_noalias_violation.rs:LL:CC + --> tests/fail/both_borrows/box_noalias_violation.rs:LL:CC | LL | test(Box::from_raw(ptr), ptr); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/both_borrows/box_noalias_violation.tree.stderr b/src/tools/miri/tests/fail/both_borrows/box_noalias_violation.tree.stderr index 95cf37c812394..c788e455c8d23 100644 --- a/src/tools/miri/tests/fail/both_borrows/box_noalias_violation.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/box_noalias_violation.tree.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: read access through at ALLOC[0x0] is forbidden - --> $DIR/box_noalias_violation.rs:LL:CC + --> tests/fail/both_borrows/box_noalias_violation.rs:LL:CC | LL | *y | ^^ read access through at ALLOC[0x0] is forbidden @@ -9,25 +9,25 @@ LL | *y = help: this foreign read access would cause the protected tag (currently Active) to become Disabled = help: protected tags must never be Disabled help: the accessed tag was created here - --> $DIR/box_noalias_violation.rs:LL:CC + --> tests/fail/both_borrows/box_noalias_violation.rs:LL:CC | LL | let ptr = &mut v as *mut i32; | ^^^^^^ help: the protected tag was created here, in the initial state Reserved - --> $DIR/box_noalias_violation.rs:LL:CC + --> tests/fail/both_borrows/box_noalias_violation.rs:LL:CC | LL | unsafe fn test(mut x: Box, y: *const i32) -> i32 { | ^^^^^ help: the protected tag later transitioned to Active due to a child write access at offsets [0x0..0x4] - --> $DIR/box_noalias_violation.rs:LL:CC + --> tests/fail/both_borrows/box_noalias_violation.rs:LL:CC | LL | *x = 5; | ^^^^^^ = help: this transition corresponds to the first write to a 2-phase borrowed mutable reference = note: BACKTRACE (of the first span): - = note: inside `test` at $DIR/box_noalias_violation.rs:LL:CC + = note: inside `test` at tests/fail/both_borrows/box_noalias_violation.rs:LL:CC note: inside `main` - --> $DIR/box_noalias_violation.rs:LL:CC + --> tests/fail/both_borrows/box_noalias_violation.rs:LL:CC | LL | test(Box::from_raw(ptr), ptr); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/both_borrows/buggy_as_mut_slice.stack.stderr b/src/tools/miri/tests/fail/both_borrows/buggy_as_mut_slice.stack.stderr index d2bf4c6a59c42..4e5355f5653f2 100644 --- a/src/tools/miri/tests/fail/both_borrows/buggy_as_mut_slice.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/buggy_as_mut_slice.stack.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: attempting a write access using at ALLOC[0x4], but that tag does not exist in the borrow stack for this location - --> $DIR/buggy_as_mut_slice.rs:LL:CC + --> tests/fail/both_borrows/buggy_as_mut_slice.rs:LL:CC | LL | v1[1] = 5; | ^^^^^^^^^ @@ -10,17 +10,17 @@ LL | v1[1] = 5; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a Unique retag at offsets [0x0..0xc] - --> $DIR/buggy_as_mut_slice.rs:LL:CC + --> tests/fail/both_borrows/buggy_as_mut_slice.rs:LL:CC | LL | let v1 = safe::as_mut_slice(&v); | ^^^^^^^^^^^^^^^^^^^^^^ help: was later invalidated at offsets [0x0..0xc] by a Unique retag - --> $DIR/buggy_as_mut_slice.rs:LL:CC + --> tests/fail/both_borrows/buggy_as_mut_slice.rs:LL:CC | LL | unsafe { from_raw_parts_mut(self_.as_ptr() as *mut T, self_.len()) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/buggy_as_mut_slice.rs:LL:CC + = note: inside `main` at tests/fail/both_borrows/buggy_as_mut_slice.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/buggy_as_mut_slice.tree.stderr b/src/tools/miri/tests/fail/both_borrows/buggy_as_mut_slice.tree.stderr index 16e87c4d4ebc2..bad42343c00ef 100644 --- a/src/tools/miri/tests/fail/both_borrows/buggy_as_mut_slice.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/buggy_as_mut_slice.tree.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: write access through at ALLOC[0x4] is forbidden - --> $DIR/buggy_as_mut_slice.rs:LL:CC + --> tests/fail/both_borrows/buggy_as_mut_slice.rs:LL:CC | LL | v2[1] = 7; | ^^^^^^^^^ write access through at ALLOC[0x4] is forbidden @@ -7,18 +7,18 @@ LL | v2[1] = 7; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental = help: the accessed tag has state Disabled which forbids this child write access help: the accessed tag was created here, in the initial state Reserved - --> $DIR/buggy_as_mut_slice.rs:LL:CC + --> tests/fail/both_borrows/buggy_as_mut_slice.rs:LL:CC | LL | let v2 = safe::as_mut_slice(&v); | ^^^^^^^^^^^^^^^^^^^^^^ help: the accessed tag later transitioned to Disabled due to a foreign write access at offsets [0x4..0x8] - --> $DIR/buggy_as_mut_slice.rs:LL:CC + --> tests/fail/both_borrows/buggy_as_mut_slice.rs:LL:CC | LL | v1[1] = 5; | ^^^^^^^^^ = help: this transition corresponds to a loss of read and write permissions = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/buggy_as_mut_slice.rs:LL:CC + = note: inside `main` at tests/fail/both_borrows/buggy_as_mut_slice.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/buggy_split_at_mut.stack.stderr b/src/tools/miri/tests/fail/both_borrows/buggy_split_at_mut.stack.stderr index 71d962a5523f1..28be7607aa3ca 100644 --- a/src/tools/miri/tests/fail/both_borrows/buggy_split_at_mut.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/buggy_split_at_mut.stack.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: trying to retag from for Unique permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/buggy_split_at_mut.rs:LL:CC + --> tests/fail/both_borrows/buggy_split_at_mut.rs:LL:CC | LL | / ( LL | | from_raw_parts_mut(ptr, len - mid), // BUG: should be "mid" instead of "len - mid" @@ -14,19 +14,19 @@ LL | | ) = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a Unique retag at offsets [0x0..0x10] - --> $DIR/buggy_split_at_mut.rs:LL:CC + --> tests/fail/both_borrows/buggy_split_at_mut.rs:LL:CC | LL | from_raw_parts_mut(ptr, len - mid), // BUG: should be "mid" instead of "len - mid" | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: was later invalidated at offsets [0x0..0x10] by a Unique retag - --> $DIR/buggy_split_at_mut.rs:LL:CC + --> tests/fail/both_borrows/buggy_split_at_mut.rs:LL:CC | LL | from_raw_parts_mut(ptr.offset(mid as isize), len - mid), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `safe::split_at_mut::` at $DIR/buggy_split_at_mut.rs:LL:CC + = note: inside `safe::split_at_mut::` at tests/fail/both_borrows/buggy_split_at_mut.rs:LL:CC note: inside `main` - --> $DIR/buggy_split_at_mut.rs:LL:CC + --> tests/fail/both_borrows/buggy_split_at_mut.rs:LL:CC | LL | let (a, b) = safe::split_at_mut(&mut array, 0); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/both_borrows/buggy_split_at_mut.tree.stderr b/src/tools/miri/tests/fail/both_borrows/buggy_split_at_mut.tree.stderr index aaf7c2256a78a..c734f257a4047 100644 --- a/src/tools/miri/tests/fail/both_borrows/buggy_split_at_mut.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/buggy_split_at_mut.tree.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: write access through at ALLOC[0x4] is forbidden - --> $DIR/buggy_split_at_mut.rs:LL:CC + --> tests/fail/both_borrows/buggy_split_at_mut.rs:LL:CC | LL | b[1] = 6; | ^^^^^^^^ write access through at ALLOC[0x4] is forbidden @@ -7,18 +7,18 @@ LL | b[1] = 6; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental = help: the accessed tag has state Disabled which forbids this child write access help: the accessed tag was created here, in the initial state Reserved - --> $DIR/buggy_split_at_mut.rs:LL:CC + --> tests/fail/both_borrows/buggy_split_at_mut.rs:LL:CC | LL | let (a, b) = safe::split_at_mut(&mut array, 0); | ^ help: the accessed tag later transitioned to Disabled due to a foreign write access at offsets [0x4..0x8] - --> $DIR/buggy_split_at_mut.rs:LL:CC + --> tests/fail/both_borrows/buggy_split_at_mut.rs:LL:CC | LL | a[1] = 5; | ^^^^^^^^ = help: this transition corresponds to a loss of read and write permissions = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/buggy_split_at_mut.rs:LL:CC + = note: inside `main` at tests/fail/both_borrows/buggy_split_at_mut.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/illegal_write1.stack.stderr b/src/tools/miri/tests/fail/both_borrows/illegal_write1.stack.stderr index 3a9faeb80eed5..9df441cb9564f 100644 --- a/src/tools/miri/tests/fail/both_borrows/illegal_write1.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/illegal_write1.stack.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: attempting a write access using at ALLOC[0x0], but that tag only grants SharedReadOnly permission for this location - --> $DIR/illegal_write1.rs:LL:CC + --> tests/fail/both_borrows/illegal_write1.rs:LL:CC | LL | unsafe { *x = 42 }; | ^^^^^^^ @@ -10,12 +10,12 @@ LL | unsafe { *x = 42 }; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadOnly retag at offsets [0x0..0x4] - --> $DIR/illegal_write1.rs:LL:CC + --> tests/fail/both_borrows/illegal_write1.rs:LL:CC | LL | let x: *mut u32 = xref as *const _ as *mut _; | ^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/illegal_write1.rs:LL:CC + = note: inside `main` at tests/fail/both_borrows/illegal_write1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/illegal_write1.tree.stderr b/src/tools/miri/tests/fail/both_borrows/illegal_write1.tree.stderr index 6241c9db0d206..cd415ad6de9f0 100644 --- a/src/tools/miri/tests/fail/both_borrows/illegal_write1.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/illegal_write1.tree.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: write access through at ALLOC[0x0] is forbidden - --> $DIR/illegal_write1.rs:LL:CC + --> tests/fail/both_borrows/illegal_write1.rs:LL:CC | LL | unsafe { *x = 42 }; | ^^^^^^^ write access through at ALLOC[0x0] is forbidden @@ -7,12 +7,12 @@ LL | unsafe { *x = 42 }; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental = help: the accessed tag has state Frozen which forbids this child write access help: the accessed tag was created here, in the initial state Frozen - --> $DIR/illegal_write1.rs:LL:CC + --> tests/fail/both_borrows/illegal_write1.rs:LL:CC | LL | let xref = &*target; | ^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/illegal_write1.rs:LL:CC + = note: inside `main` at tests/fail/both_borrows/illegal_write1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/illegal_write5.stack.stderr b/src/tools/miri/tests/fail/both_borrows/illegal_write5.stack.stderr index 16f8a3cbd02af..2a517941de5b5 100644 --- a/src/tools/miri/tests/fail/both_borrows/illegal_write5.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/illegal_write5.stack.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: attempting a read access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/illegal_write5.rs:LL:CC + --> tests/fail/both_borrows/illegal_write5.rs:LL:CC | LL | let _val = *xref; | ^^^^^ @@ -10,17 +10,17 @@ LL | let _val = *xref; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a Unique retag at offsets [0x0..0x4] - --> $DIR/illegal_write5.rs:LL:CC + --> tests/fail/both_borrows/illegal_write5.rs:LL:CC | LL | let xref = unsafe { &mut *xraw }; | ^^^^^^^^^^ help: was later invalidated at offsets [0x0..0x4] by a write access - --> $DIR/illegal_write5.rs:LL:CC + --> tests/fail/both_borrows/illegal_write5.rs:LL:CC | LL | unsafe { *xraw = 15 }; | ^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/illegal_write5.rs:LL:CC + = note: inside `main` at tests/fail/both_borrows/illegal_write5.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/illegal_write5.tree.stderr b/src/tools/miri/tests/fail/both_borrows/illegal_write5.tree.stderr index dec2bb6880f87..38bc957cc33ee 100644 --- a/src/tools/miri/tests/fail/both_borrows/illegal_write5.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/illegal_write5.tree.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: read access through at ALLOC[0x0] is forbidden - --> $DIR/illegal_write5.rs:LL:CC + --> tests/fail/both_borrows/illegal_write5.rs:LL:CC | LL | let _val = *xref; | ^^^^^ read access through at ALLOC[0x0] is forbidden @@ -7,18 +7,18 @@ LL | let _val = *xref; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental = help: the accessed tag has state Disabled which forbids this child read access help: the accessed tag was created here, in the initial state Reserved - --> $DIR/illegal_write5.rs:LL:CC + --> tests/fail/both_borrows/illegal_write5.rs:LL:CC | LL | let xref = unsafe { &mut *xraw }; | ^^^^^^^^^^ help: the accessed tag later transitioned to Disabled due to a foreign write access at offsets [0x0..0x4] - --> $DIR/illegal_write5.rs:LL:CC + --> tests/fail/both_borrows/illegal_write5.rs:LL:CC | LL | unsafe { *xraw = 15 }; | ^^^^^^^^^^ = help: this transition corresponds to a loss of read and write permissions = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/illegal_write5.rs:LL:CC + = note: inside `main` at tests/fail/both_borrows/illegal_write5.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/illegal_write6.stack.stderr b/src/tools/miri/tests/fail/both_borrows/illegal_write6.stack.stderr index b5484745c41db..e75334508ffd8 100644 --- a/src/tools/miri/tests/fail/both_borrows/illegal_write6.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/illegal_write6.stack.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: not granting access to tag because that would remove [Unique for ] which is strongly protected - --> $DIR/illegal_write6.rs:LL:CC + --> tests/fail/both_borrows/illegal_write6.rs:LL:CC | LL | unsafe { *y = 2 }; | ^^^^^^ not granting access to tag because that would remove [Unique for ] which is strongly protected @@ -7,19 +7,19 @@ LL | unsafe { *y = 2 }; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadWrite retag at offsets [0x0..0x4] - --> $DIR/illegal_write6.rs:LL:CC + --> tests/fail/both_borrows/illegal_write6.rs:LL:CC | LL | let p = x as *mut u32; | ^ help: is this argument - --> $DIR/illegal_write6.rs:LL:CC + --> tests/fail/both_borrows/illegal_write6.rs:LL:CC | LL | fn foo(a: &mut u32, y: *mut u32) -> u32 { | ^ = note: BACKTRACE (of the first span): - = note: inside `foo` at $DIR/illegal_write6.rs:LL:CC + = note: inside `foo` at tests/fail/both_borrows/illegal_write6.rs:LL:CC note: inside `main` - --> $DIR/illegal_write6.rs:LL:CC + --> tests/fail/both_borrows/illegal_write6.rs:LL:CC | LL | foo(x, p); | ^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/both_borrows/illegal_write6.tree.stderr b/src/tools/miri/tests/fail/both_borrows/illegal_write6.tree.stderr index 2e161ceea88db..31599a767cfac 100644 --- a/src/tools/miri/tests/fail/both_borrows/illegal_write6.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/illegal_write6.tree.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: write access through at ALLOC[0x0] is forbidden - --> $DIR/illegal_write6.rs:LL:CC + --> tests/fail/both_borrows/illegal_write6.rs:LL:CC | LL | unsafe { *y = 2 }; | ^^^^^^ write access through at ALLOC[0x0] is forbidden @@ -9,25 +9,25 @@ LL | unsafe { *y = 2 }; = help: this foreign write access would cause the protected tag (currently Active) to become Disabled = help: protected tags must never be Disabled help: the accessed tag was created here - --> $DIR/illegal_write6.rs:LL:CC + --> tests/fail/both_borrows/illegal_write6.rs:LL:CC | LL | let x = &mut 0u32; | ^^^^^^^^^ help: the protected tag was created here, in the initial state Reserved - --> $DIR/illegal_write6.rs:LL:CC + --> tests/fail/both_borrows/illegal_write6.rs:LL:CC | LL | fn foo(a: &mut u32, y: *mut u32) -> u32 { | ^ help: the protected tag later transitioned to Active due to a child write access at offsets [0x0..0x4] - --> $DIR/illegal_write6.rs:LL:CC + --> tests/fail/both_borrows/illegal_write6.rs:LL:CC | LL | *a = 1; | ^^^^^^ = help: this transition corresponds to the first write to a 2-phase borrowed mutable reference = note: BACKTRACE (of the first span): - = note: inside `foo` at $DIR/illegal_write6.rs:LL:CC + = note: inside `foo` at tests/fail/both_borrows/illegal_write6.rs:LL:CC note: inside `main` - --> $DIR/illegal_write6.rs:LL:CC + --> tests/fail/both_borrows/illegal_write6.rs:LL:CC | LL | foo(x, p); | ^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector2.stack.stderr b/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector2.stack.stderr index 11edbc3270c96..b5df165328909 100644 --- a/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector2.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector2.stack.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: not granting access to tag because that would remove [SharedReadOnly for ] which is strongly protected - --> $DIR/invalidate_against_protector2.rs:LL:CC + --> tests/fail/both_borrows/invalidate_against_protector2.rs:LL:CC | LL | unsafe { *x = 0 }; | ^^^^^^ not granting access to tag because that would remove [SharedReadOnly for ] which is strongly protected @@ -7,19 +7,19 @@ LL | unsafe { *x = 0 }; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadWrite retag at offsets [0x0..0x4] - --> $DIR/invalidate_against_protector2.rs:LL:CC + --> tests/fail/both_borrows/invalidate_against_protector2.rs:LL:CC | LL | let xraw = &mut x as *mut _; | ^^^^^^ help: is this argument - --> $DIR/invalidate_against_protector2.rs:LL:CC + --> tests/fail/both_borrows/invalidate_against_protector2.rs:LL:CC | LL | fn inner(x: *mut i32, _y: &i32) { | ^^ = note: BACKTRACE (of the first span): - = note: inside `inner` at $DIR/invalidate_against_protector2.rs:LL:CC + = note: inside `inner` at tests/fail/both_borrows/invalidate_against_protector2.rs:LL:CC note: inside `main` - --> $DIR/invalidate_against_protector2.rs:LL:CC + --> tests/fail/both_borrows/invalidate_against_protector2.rs:LL:CC | LL | inner(xraw, xref); | ^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector2.tree.stderr b/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector2.tree.stderr index 9fa52262f7ea8..c3b836a8aa73b 100644 --- a/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector2.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector2.tree.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: write access through at ALLOC[0x0] is forbidden - --> $DIR/invalidate_against_protector2.rs:LL:CC + --> tests/fail/both_borrows/invalidate_against_protector2.rs:LL:CC | LL | unsafe { *x = 0 }; | ^^^^^^ write access through at ALLOC[0x0] is forbidden @@ -9,19 +9,19 @@ LL | unsafe { *x = 0 }; = help: this foreign write access would cause the protected tag (currently Frozen) to become Disabled = help: protected tags must never be Disabled help: the accessed tag was created here - --> $DIR/invalidate_against_protector2.rs:LL:CC + --> tests/fail/both_borrows/invalidate_against_protector2.rs:LL:CC | LL | let xraw = &mut x as *mut _; | ^^^^^^ help: the protected tag was created here, in the initial state Frozen - --> $DIR/invalidate_against_protector2.rs:LL:CC + --> tests/fail/both_borrows/invalidate_against_protector2.rs:LL:CC | LL | fn inner(x: *mut i32, _y: &i32) { | ^^ = note: BACKTRACE (of the first span): - = note: inside `inner` at $DIR/invalidate_against_protector2.rs:LL:CC + = note: inside `inner` at tests/fail/both_borrows/invalidate_against_protector2.rs:LL:CC note: inside `main` - --> $DIR/invalidate_against_protector2.rs:LL:CC + --> tests/fail/both_borrows/invalidate_against_protector2.rs:LL:CC | LL | inner(xraw, xref); | ^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector3.stack.stderr b/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector3.stack.stderr index c6666ceac2b33..0010ce0e4ed63 100644 --- a/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector3.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector3.stack.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: not granting access to tag because that would remove [SharedReadOnly for ] which is strongly protected - --> $DIR/invalidate_against_protector3.rs:LL:CC + --> tests/fail/both_borrows/invalidate_against_protector3.rs:LL:CC | LL | unsafe { *x = 0 }; | ^^^^^^ not granting access to tag because that would remove [SharedReadOnly for ] which is strongly protected @@ -7,19 +7,19 @@ LL | unsafe { *x = 0 }; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created here, as the root tag for ALLOC - --> $DIR/invalidate_against_protector3.rs:LL:CC + --> tests/fail/both_borrows/invalidate_against_protector3.rs:LL:CC | LL | let ptr = alloc(Layout::for_value(&0i32)) as *mut i32; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: is this argument - --> $DIR/invalidate_against_protector3.rs:LL:CC + --> tests/fail/both_borrows/invalidate_against_protector3.rs:LL:CC | LL | fn inner(x: *mut i32, _y: &i32) { | ^^ = note: BACKTRACE (of the first span): - = note: inside `inner` at $DIR/invalidate_against_protector3.rs:LL:CC + = note: inside `inner` at tests/fail/both_borrows/invalidate_against_protector3.rs:LL:CC note: inside `main` - --> $DIR/invalidate_against_protector3.rs:LL:CC + --> tests/fail/both_borrows/invalidate_against_protector3.rs:LL:CC | LL | inner(ptr, &*ptr); | ^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector3.tree.stderr b/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector3.tree.stderr index 2cf476c837c57..b47fb81f5f4e6 100644 --- a/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector3.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector3.tree.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: write access through (root of the allocation) at ALLOC[0x0] is forbidden - --> $DIR/invalidate_against_protector3.rs:LL:CC + --> tests/fail/both_borrows/invalidate_against_protector3.rs:LL:CC | LL | unsafe { *x = 0 }; | ^^^^^^ write access through (root of the allocation) at ALLOC[0x0] is forbidden @@ -9,19 +9,19 @@ LL | unsafe { *x = 0 }; = help: this foreign write access would cause the protected tag (currently Frozen) to become Disabled = help: protected tags must never be Disabled help: the accessed tag was created here - --> $DIR/invalidate_against_protector3.rs:LL:CC + --> tests/fail/both_borrows/invalidate_against_protector3.rs:LL:CC | LL | let ptr = alloc(Layout::for_value(&0i32)) as *mut i32; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: the protected tag was created here, in the initial state Frozen - --> $DIR/invalidate_against_protector3.rs:LL:CC + --> tests/fail/both_borrows/invalidate_against_protector3.rs:LL:CC | LL | fn inner(x: *mut i32, _y: &i32) { | ^^ = note: BACKTRACE (of the first span): - = note: inside `inner` at $DIR/invalidate_against_protector3.rs:LL:CC + = note: inside `inner` at tests/fail/both_borrows/invalidate_against_protector3.rs:LL:CC note: inside `main` - --> $DIR/invalidate_against_protector3.rs:LL:CC + --> tests/fail/both_borrows/invalidate_against_protector3.rs:LL:CC | LL | inner(ptr, &*ptr); | ^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-1.stack.stderr b/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-1.stack.stderr index 64bbbfcd848b6..cd27bb818e766 100644 --- a/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-1.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-1.stack.stderr @@ -7,7 +7,7 @@ LL | Box(unsafe { Unique::new_unchecked(raw) }, alloc) = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information help: ALLOC was allocated here: - --> $DIR/issue-miri-1050-1.rs:LL:CC + --> tests/fail/both_borrows/issue-miri-1050-1.rs:LL:CC | LL | let ptr = Box::into_raw(Box::new(0u16)); | ^^^^^^^^^^^^^^ @@ -15,7 +15,7 @@ LL | let ptr = Box::into_raw(Box::new(0u16)); = note: inside `std::boxed::Box::::from_raw_in` at RUSTLIB/alloc/src/boxed.rs:LL:CC = note: inside `std::boxed::Box::::from_raw` at RUSTLIB/alloc/src/boxed.rs:LL:CC note: inside `main` - --> $DIR/issue-miri-1050-1.rs:LL:CC + --> tests/fail/both_borrows/issue-miri-1050-1.rs:LL:CC | LL | drop(Box::from_raw(ptr as *mut u32)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-1.tree.stderr b/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-1.tree.stderr index 64bbbfcd848b6..cd27bb818e766 100644 --- a/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-1.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-1.tree.stderr @@ -7,7 +7,7 @@ LL | Box(unsafe { Unique::new_unchecked(raw) }, alloc) = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information help: ALLOC was allocated here: - --> $DIR/issue-miri-1050-1.rs:LL:CC + --> tests/fail/both_borrows/issue-miri-1050-1.rs:LL:CC | LL | let ptr = Box::into_raw(Box::new(0u16)); | ^^^^^^^^^^^^^^ @@ -15,7 +15,7 @@ LL | let ptr = Box::into_raw(Box::new(0u16)); = note: inside `std::boxed::Box::::from_raw_in` at RUSTLIB/alloc/src/boxed.rs:LL:CC = note: inside `std::boxed::Box::::from_raw` at RUSTLIB/alloc/src/boxed.rs:LL:CC note: inside `main` - --> $DIR/issue-miri-1050-1.rs:LL:CC + --> tests/fail/both_borrows/issue-miri-1050-1.rs:LL:CC | LL | drop(Box::from_raw(ptr as *mut u32)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-2.stack.stderr b/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-2.stack.stderr index 04494b5256172..04e5765371e7f 100644 --- a/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-2.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-2.stack.stderr @@ -10,7 +10,7 @@ LL | Box(unsafe { Unique::new_unchecked(raw) }, alloc) = note: inside `std::boxed::Box::::from_raw_in` at RUSTLIB/alloc/src/boxed.rs:LL:CC = note: inside `std::boxed::Box::::from_raw` at RUSTLIB/alloc/src/boxed.rs:LL:CC note: inside `main` - --> $DIR/issue-miri-1050-2.rs:LL:CC + --> tests/fail/both_borrows/issue-miri-1050-2.rs:LL:CC | LL | drop(Box::from_raw(ptr.as_ptr())); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-2.tree.stderr b/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-2.tree.stderr index 04494b5256172..04e5765371e7f 100644 --- a/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-2.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-2.tree.stderr @@ -10,7 +10,7 @@ LL | Box(unsafe { Unique::new_unchecked(raw) }, alloc) = note: inside `std::boxed::Box::::from_raw_in` at RUSTLIB/alloc/src/boxed.rs:LL:CC = note: inside `std::boxed::Box::::from_raw` at RUSTLIB/alloc/src/boxed.rs:LL:CC note: inside `main` - --> $DIR/issue-miri-1050-2.rs:LL:CC + --> tests/fail/both_borrows/issue-miri-1050-2.rs:LL:CC | LL | drop(Box::from_raw(ptr.as_ptr())); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/both_borrows/load_invalid_shr.stack.stderr b/src/tools/miri/tests/fail/both_borrows/load_invalid_shr.stack.stderr index e78807ec1c8de..ffc73ee43de95 100644 --- a/src/tools/miri/tests/fail/both_borrows/load_invalid_shr.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/load_invalid_shr.stack.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: trying to retag from for SharedReadOnly permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/load_invalid_shr.rs:LL:CC + --> tests/fail/both_borrows/load_invalid_shr.rs:LL:CC | LL | let _val = *xref_in_mem; | ^^^^^^^^^^^^ @@ -10,17 +10,17 @@ LL | let _val = *xref_in_mem; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadOnly retag at offsets [0x0..0x4] - --> $DIR/load_invalid_shr.rs:LL:CC + --> tests/fail/both_borrows/load_invalid_shr.rs:LL:CC | LL | let xref_in_mem = Box::new(xref); | ^^^^^^^^^^^^^^ help: was later invalidated at offsets [0x0..0x4] by a write access - --> $DIR/load_invalid_shr.rs:LL:CC + --> tests/fail/both_borrows/load_invalid_shr.rs:LL:CC | LL | unsafe { *xraw = 42 }; // unfreeze | ^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/load_invalid_shr.rs:LL:CC + = note: inside `main` at tests/fail/both_borrows/load_invalid_shr.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/load_invalid_shr.tree.stderr b/src/tools/miri/tests/fail/both_borrows/load_invalid_shr.tree.stderr index 0fcfc20e43696..4610739739c5d 100644 --- a/src/tools/miri/tests/fail/both_borrows/load_invalid_shr.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/load_invalid_shr.tree.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: reborrow through at ALLOC[0x0] is forbidden - --> $DIR/load_invalid_shr.rs:LL:CC + --> tests/fail/both_borrows/load_invalid_shr.rs:LL:CC | LL | let _val = *xref_in_mem; | ^^^^^^^^^^^^ reborrow through at ALLOC[0x0] is forbidden @@ -7,18 +7,18 @@ LL | let _val = *xref_in_mem; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental = help: the accessed tag has state Disabled which forbids this reborrow (acting as a child read access) help: the accessed tag was created here, in the initial state Frozen - --> $DIR/load_invalid_shr.rs:LL:CC + --> tests/fail/both_borrows/load_invalid_shr.rs:LL:CC | LL | let xref_in_mem = Box::new(xref); | ^^^^^^^^^^^^^^ help: the accessed tag later transitioned to Disabled due to a foreign write access at offsets [0x0..0x4] - --> $DIR/load_invalid_shr.rs:LL:CC + --> tests/fail/both_borrows/load_invalid_shr.rs:LL:CC | LL | unsafe { *xraw = 42 }; // unfreeze | ^^^^^^^^^^ = help: this transition corresponds to a loss of read permissions = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/load_invalid_shr.rs:LL:CC + = note: inside `main` at tests/fail/both_borrows/load_invalid_shr.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation1.stack.stderr b/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation1.stack.stderr index 264503f2f2fca..92df9bcbe384f 100644 --- a/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation1.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation1.stack.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: attempting a write access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/mut_exclusive_violation1.rs:LL:CC + --> tests/fail/both_borrows/mut_exclusive_violation1.rs:LL:CC | LL | *LEAK = 7; | ^^^^^^^^^ @@ -10,24 +10,24 @@ LL | *LEAK = 7; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadOnly retag at offsets [0x0..0x4] - --> $DIR/mut_exclusive_violation1.rs:LL:CC + --> tests/fail/both_borrows/mut_exclusive_violation1.rs:LL:CC | LL | LEAK = x as *const _ as *mut _; | ^ help: was later invalidated at offsets [0x0..0x4] by a write access - --> $DIR/mut_exclusive_violation1.rs:LL:CC + --> tests/fail/both_borrows/mut_exclusive_violation1.rs:LL:CC | LL | *our = 5; | ^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `unknown_code_2` at $DIR/mut_exclusive_violation1.rs:LL:CC + = note: inside `unknown_code_2` at tests/fail/both_borrows/mut_exclusive_violation1.rs:LL:CC note: inside `demo_mut_advanced_unique` - --> $DIR/mut_exclusive_violation1.rs:LL:CC + --> tests/fail/both_borrows/mut_exclusive_violation1.rs:LL:CC | LL | unknown_code_2(); | ^^^^^^^^^^^^^^^^ note: inside `main` - --> $DIR/mut_exclusive_violation1.rs:LL:CC + --> tests/fail/both_borrows/mut_exclusive_violation1.rs:LL:CC | LL | demo_mut_advanced_unique(&mut 0); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation1.tree.stderr b/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation1.tree.stderr index 5b4ee4a891302..46660d312953e 100644 --- a/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation1.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation1.tree.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: write access through at ALLOC[0x0] is forbidden - --> $DIR/mut_exclusive_violation1.rs:LL:CC + --> tests/fail/both_borrows/mut_exclusive_violation1.rs:LL:CC | LL | *LEAK = 7; | ^^^^^^^^^ write access through at ALLOC[0x0] is forbidden @@ -7,25 +7,25 @@ LL | *LEAK = 7; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental = help: the accessed tag has state Disabled which forbids this child write access help: the accessed tag was created here, in the initial state Frozen - --> $DIR/mut_exclusive_violation1.rs:LL:CC + --> tests/fail/both_borrows/mut_exclusive_violation1.rs:LL:CC | LL | fn unknown_code_1(x: &i32) { | ^ help: the accessed tag later transitioned to Disabled due to a foreign write access at offsets [0x0..0x4] - --> $DIR/mut_exclusive_violation1.rs:LL:CC + --> tests/fail/both_borrows/mut_exclusive_violation1.rs:LL:CC | LL | *our = 5; | ^^^^^^^^ = help: this transition corresponds to a loss of read permissions = note: BACKTRACE (of the first span): - = note: inside `unknown_code_2` at $DIR/mut_exclusive_violation1.rs:LL:CC + = note: inside `unknown_code_2` at tests/fail/both_borrows/mut_exclusive_violation1.rs:LL:CC note: inside `demo_mut_advanced_unique` - --> $DIR/mut_exclusive_violation1.rs:LL:CC + --> tests/fail/both_borrows/mut_exclusive_violation1.rs:LL:CC | LL | unknown_code_2(); | ^^^^^^^^^^^^^^^^ note: inside `main` - --> $DIR/mut_exclusive_violation1.rs:LL:CC + --> tests/fail/both_borrows/mut_exclusive_violation1.rs:LL:CC | LL | demo_mut_advanced_unique(&mut 0); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation2.stack.stderr b/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation2.stack.stderr index 35d418f574c9a..42e30cf10c986 100644 --- a/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation2.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation2.stack.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: attempting a read access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/mut_exclusive_violation2.rs:LL:CC + --> tests/fail/both_borrows/mut_exclusive_violation2.rs:LL:CC | LL | let _val = *raw1; | ^^^^^ @@ -10,17 +10,17 @@ LL | let _val = *raw1; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a Unique retag at offsets [0x0..0x4] - --> $DIR/mut_exclusive_violation2.rs:LL:CC + --> tests/fail/both_borrows/mut_exclusive_violation2.rs:LL:CC | LL | let raw1 = ptr1.as_mut(); | ^^^^^^^^^^^^^ help: was later invalidated at offsets [0x0..0x4] by a Unique retag - --> $DIR/mut_exclusive_violation2.rs:LL:CC + --> tests/fail/both_borrows/mut_exclusive_violation2.rs:LL:CC | LL | let raw2 = ptr2.as_mut(); | ^^^^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/mut_exclusive_violation2.rs:LL:CC + = note: inside `main` at tests/fail/both_borrows/mut_exclusive_violation2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation2.tree.stderr b/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation2.tree.stderr index d3bc54b7ef3c9..a9b1b49e3852d 100644 --- a/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation2.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation2.tree.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: write access through at ALLOC[0x0] is forbidden - --> $DIR/mut_exclusive_violation2.rs:LL:CC + --> tests/fail/both_borrows/mut_exclusive_violation2.rs:LL:CC | LL | *raw1 = 3; | ^^^^^^^^^ write access through at ALLOC[0x0] is forbidden @@ -7,18 +7,18 @@ LL | *raw1 = 3; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental = help: the accessed tag has state Disabled which forbids this child write access help: the accessed tag was created here, in the initial state Reserved - --> $DIR/mut_exclusive_violation2.rs:LL:CC + --> tests/fail/both_borrows/mut_exclusive_violation2.rs:LL:CC | LL | let raw1 = ptr1.as_mut(); | ^^^^^^^^^^^^^ help: the accessed tag later transitioned to Disabled due to a foreign write access at offsets [0x0..0x4] - --> $DIR/mut_exclusive_violation2.rs:LL:CC + --> tests/fail/both_borrows/mut_exclusive_violation2.rs:LL:CC | LL | *raw2 = 2; | ^^^^^^^^^ = help: this transition corresponds to a loss of read and write permissions = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/mut_exclusive_violation2.rs:LL:CC + = note: inside `main` at tests/fail/both_borrows/mut_exclusive_violation2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/newtype_pair_retagging.stack.stderr b/src/tools/miri/tests/fail/both_borrows/newtype_pair_retagging.stack.stderr index 9f545e5687e7f..f428447230a85 100644 --- a/src/tools/miri/tests/fail/both_borrows/newtype_pair_retagging.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/newtype_pair_retagging.stack.stderr @@ -7,12 +7,12 @@ LL | Box(unsafe { Unique::new_unchecked(raw) }, alloc) = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadWrite retag at offsets [0x0..0x4] - --> $DIR/newtype_pair_retagging.rs:LL:CC + --> tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC | LL | let ptr = Box::into_raw(Box::new(0i32)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: is this argument - --> $DIR/newtype_pair_retagging.rs:LL:CC + --> tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC | LL | fn dealloc_while_running(_n: Newtype<'_>, dealloc: impl FnOnce()) { | ^^ @@ -20,17 +20,17 @@ LL | fn dealloc_while_running(_n: Newtype<'_>, dealloc: impl FnOnce()) { = note: inside `std::boxed::Box::::from_raw_in` at RUSTLIB/alloc/src/boxed.rs:LL:CC = note: inside `std::boxed::Box::::from_raw` at RUSTLIB/alloc/src/boxed.rs:LL:CC note: inside closure - --> $DIR/newtype_pair_retagging.rs:LL:CC + --> tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC | LL | || drop(Box::from_raw(ptr)), | ^^^^^^^^^^^^^^^^^^ -note: inside `dealloc_while_running::<{closure@$DIR/newtype_pair_retagging.rs:LL:CC}>` - --> $DIR/newtype_pair_retagging.rs:LL:CC +note: inside `dealloc_while_running::<{closure@tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC}>` + --> tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC | LL | dealloc(); | ^^^^^^^^^ note: inside `main` - --> $DIR/newtype_pair_retagging.rs:LL:CC + --> tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC | LL | / dealloc_while_running( LL | | Newtype(&mut *ptr, 0), diff --git a/src/tools/miri/tests/fail/both_borrows/newtype_pair_retagging.tree.stderr b/src/tools/miri/tests/fail/both_borrows/newtype_pair_retagging.tree.stderr index a344229eeb432..ef1aa74ddf4ba 100644 --- a/src/tools/miri/tests/fail/both_borrows/newtype_pair_retagging.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/newtype_pair_retagging.tree.stderr @@ -9,17 +9,17 @@ LL | self.1.deallocate(From::from(ptr.cast()), layout); = help: this deallocation (acting as a foreign write access) would cause the protected tag (currently Reserved (conflicted)) to become Disabled = help: protected tags must never be Disabled help: the accessed tag was created here - --> $DIR/newtype_pair_retagging.rs:LL:CC + --> tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC | LL | || drop(Box::from_raw(ptr)), | ^^^^^^^^^^^^^^^^^^^^^^^^ help: the protected tag was created here, in the initial state Reserved - --> $DIR/newtype_pair_retagging.rs:LL:CC + --> tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC | LL | fn dealloc_while_running(_n: Newtype<'_>, dealloc: impl FnOnce()) { | ^^ help: the protected tag later transitioned to Reserved (conflicted) due to a reborrow (acting as a foreign read access) at offsets [0x0..0x4] - --> $DIR/newtype_pair_retagging.rs:LL:CC + --> tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC | LL | || drop(Box::from_raw(ptr)), | ^^^^^^^^^^^^^^^^^^ @@ -29,17 +29,17 @@ LL | || drop(Box::from_raw(ptr)), = note: inside `std::ptr::drop_in_place::> - shim(Some(std::boxed::Box))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC = note: inside `std::mem::drop::>` at RUSTLIB/core/src/mem/mod.rs:LL:CC note: inside closure - --> $DIR/newtype_pair_retagging.rs:LL:CC + --> tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC | LL | || drop(Box::from_raw(ptr)), | ^^^^^^^^^^^^^^^^^^^^^^^^ -note: inside `dealloc_while_running::<{closure@$DIR/newtype_pair_retagging.rs:LL:CC}>` - --> $DIR/newtype_pair_retagging.rs:LL:CC +note: inside `dealloc_while_running::<{closure@tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC}>` + --> tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC | LL | dealloc(); | ^^^^^^^^^ note: inside `main` - --> $DIR/newtype_pair_retagging.rs:LL:CC + --> tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC | LL | / dealloc_while_running( LL | | Newtype(&mut *ptr, 0), diff --git a/src/tools/miri/tests/fail/both_borrows/newtype_retagging.stack.stderr b/src/tools/miri/tests/fail/both_borrows/newtype_retagging.stack.stderr index a4111f6f5cc2f..0410c2488db02 100644 --- a/src/tools/miri/tests/fail/both_borrows/newtype_retagging.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/newtype_retagging.stack.stderr @@ -7,12 +7,12 @@ LL | Box(unsafe { Unique::new_unchecked(raw) }, alloc) = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadWrite retag at offsets [0x0..0x4] - --> $DIR/newtype_retagging.rs:LL:CC + --> tests/fail/both_borrows/newtype_retagging.rs:LL:CC | LL | let ptr = Box::into_raw(Box::new(0i32)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: is this argument - --> $DIR/newtype_retagging.rs:LL:CC + --> tests/fail/both_borrows/newtype_retagging.rs:LL:CC | LL | fn dealloc_while_running(_n: Newtype<'_>, dealloc: impl FnOnce()) { | ^^ @@ -20,17 +20,17 @@ LL | fn dealloc_while_running(_n: Newtype<'_>, dealloc: impl FnOnce()) { = note: inside `std::boxed::Box::::from_raw_in` at RUSTLIB/alloc/src/boxed.rs:LL:CC = note: inside `std::boxed::Box::::from_raw` at RUSTLIB/alloc/src/boxed.rs:LL:CC note: inside closure - --> $DIR/newtype_retagging.rs:LL:CC + --> tests/fail/both_borrows/newtype_retagging.rs:LL:CC | LL | || drop(Box::from_raw(ptr)), | ^^^^^^^^^^^^^^^^^^ -note: inside `dealloc_while_running::<{closure@$DIR/newtype_retagging.rs:LL:CC}>` - --> $DIR/newtype_retagging.rs:LL:CC +note: inside `dealloc_while_running::<{closure@tests/fail/both_borrows/newtype_retagging.rs:LL:CC}>` + --> tests/fail/both_borrows/newtype_retagging.rs:LL:CC | LL | dealloc(); | ^^^^^^^^^ note: inside `main` - --> $DIR/newtype_retagging.rs:LL:CC + --> tests/fail/both_borrows/newtype_retagging.rs:LL:CC | LL | / dealloc_while_running( LL | | Newtype(&mut *ptr), diff --git a/src/tools/miri/tests/fail/both_borrows/newtype_retagging.tree.stderr b/src/tools/miri/tests/fail/both_borrows/newtype_retagging.tree.stderr index 321ef39e62b0c..28fcd1411f962 100644 --- a/src/tools/miri/tests/fail/both_borrows/newtype_retagging.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/newtype_retagging.tree.stderr @@ -9,17 +9,17 @@ LL | self.1.deallocate(From::from(ptr.cast()), layout); = help: this deallocation (acting as a foreign write access) would cause the protected tag (currently Reserved (conflicted)) to become Disabled = help: protected tags must never be Disabled help: the accessed tag was created here - --> $DIR/newtype_retagging.rs:LL:CC + --> tests/fail/both_borrows/newtype_retagging.rs:LL:CC | LL | || drop(Box::from_raw(ptr)), | ^^^^^^^^^^^^^^^^^^^^^^^^ help: the protected tag was created here, in the initial state Reserved - --> $DIR/newtype_retagging.rs:LL:CC + --> tests/fail/both_borrows/newtype_retagging.rs:LL:CC | LL | fn dealloc_while_running(_n: Newtype<'_>, dealloc: impl FnOnce()) { | ^^ help: the protected tag later transitioned to Reserved (conflicted) due to a reborrow (acting as a foreign read access) at offsets [0x0..0x4] - --> $DIR/newtype_retagging.rs:LL:CC + --> tests/fail/both_borrows/newtype_retagging.rs:LL:CC | LL | || drop(Box::from_raw(ptr)), | ^^^^^^^^^^^^^^^^^^ @@ -29,17 +29,17 @@ LL | || drop(Box::from_raw(ptr)), = note: inside `std::ptr::drop_in_place::> - shim(Some(std::boxed::Box))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC = note: inside `std::mem::drop::>` at RUSTLIB/core/src/mem/mod.rs:LL:CC note: inside closure - --> $DIR/newtype_retagging.rs:LL:CC + --> tests/fail/both_borrows/newtype_retagging.rs:LL:CC | LL | || drop(Box::from_raw(ptr)), | ^^^^^^^^^^^^^^^^^^^^^^^^ -note: inside `dealloc_while_running::<{closure@$DIR/newtype_retagging.rs:LL:CC}>` - --> $DIR/newtype_retagging.rs:LL:CC +note: inside `dealloc_while_running::<{closure@tests/fail/both_borrows/newtype_retagging.rs:LL:CC}>` + --> tests/fail/both_borrows/newtype_retagging.rs:LL:CC | LL | dealloc(); | ^^^^^^^^^ note: inside `main` - --> $DIR/newtype_retagging.rs:LL:CC + --> tests/fail/both_borrows/newtype_retagging.rs:LL:CC | LL | / dealloc_while_running( LL | | Newtype(&mut *ptr), diff --git a/src/tools/miri/tests/fail/both_borrows/outdated_local.stack.stderr b/src/tools/miri/tests/fail/both_borrows/outdated_local.stack.stderr index 9717dd16b5b14..79d3538e920ba 100644 --- a/src/tools/miri/tests/fail/both_borrows/outdated_local.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/outdated_local.stack.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: attempting a read access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/outdated_local.rs:LL:CC + --> tests/fail/both_borrows/outdated_local.rs:LL:CC | LL | assert_eq!(unsafe { *y }, 1); | ^^ @@ -10,17 +10,17 @@ LL | assert_eq!(unsafe { *y }, 1); = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadOnly retag at offsets [0x0..0x4] - --> $DIR/outdated_local.rs:LL:CC + --> tests/fail/both_borrows/outdated_local.rs:LL:CC | LL | let y: *const i32 = &x; | ^^ help: was later invalidated at offsets [0x0..0x4] by a write access - --> $DIR/outdated_local.rs:LL:CC + --> tests/fail/both_borrows/outdated_local.rs:LL:CC | LL | x = 1; // this invalidates y by reactivating the lowermost uniq borrow for this local | ^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/outdated_local.rs:LL:CC + = note: inside `main` at tests/fail/both_borrows/outdated_local.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/outdated_local.tree.stderr b/src/tools/miri/tests/fail/both_borrows/outdated_local.tree.stderr index 60de8417c1026..fffa83a9628bd 100644 --- a/src/tools/miri/tests/fail/both_borrows/outdated_local.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/outdated_local.tree.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: read access through at ALLOC[0x0] is forbidden - --> $DIR/outdated_local.rs:LL:CC + --> tests/fail/both_borrows/outdated_local.rs:LL:CC | LL | assert_eq!(unsafe { *y }, 1); | ^^ read access through at ALLOC[0x0] is forbidden @@ -7,18 +7,18 @@ LL | assert_eq!(unsafe { *y }, 1); = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental = help: the accessed tag has state Disabled which forbids this child read access help: the accessed tag was created here, in the initial state Frozen - --> $DIR/outdated_local.rs:LL:CC + --> tests/fail/both_borrows/outdated_local.rs:LL:CC | LL | let y: *const i32 = &x; | ^^ help: the accessed tag later transitioned to Disabled due to a foreign write access at offsets [0x0..0x4] - --> $DIR/outdated_local.rs:LL:CC + --> tests/fail/both_borrows/outdated_local.rs:LL:CC | LL | x = 1; // this invalidates y by reactivating the lowermost uniq borrow for this local | ^^^^^ = help: this transition corresponds to a loss of read permissions = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/outdated_local.rs:LL:CC + = note: inside `main` at tests/fail/both_borrows/outdated_local.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr.stack.stderr b/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr.stack.stderr index 57c4a756cf725..108c78abef506 100644 --- a/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr.stack.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: trying to retag from for SharedReadOnly permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/pass_invalid_shr.rs:LL:CC + --> tests/fail/both_borrows/pass_invalid_shr.rs:LL:CC | LL | foo(xref); | ^^^^ @@ -10,17 +10,17 @@ LL | foo(xref); = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadOnly retag at offsets [0x0..0x4] - --> $DIR/pass_invalid_shr.rs:LL:CC + --> tests/fail/both_borrows/pass_invalid_shr.rs:LL:CC | LL | let xref = unsafe { &*xraw }; | ^^^^^^ help: was later invalidated at offsets [0x0..0x4] by a write access - --> $DIR/pass_invalid_shr.rs:LL:CC + --> tests/fail/both_borrows/pass_invalid_shr.rs:LL:CC | LL | unsafe { *xraw = 42 }; // unfreeze | ^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/pass_invalid_shr.rs:LL:CC + = note: inside `main` at tests/fail/both_borrows/pass_invalid_shr.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr.tree.stderr b/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr.tree.stderr index 97a6efa9f6a6c..59750d5647090 100644 --- a/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr.tree.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: reborrow through at ALLOC[0x0] is forbidden - --> $DIR/pass_invalid_shr.rs:LL:CC + --> tests/fail/both_borrows/pass_invalid_shr.rs:LL:CC | LL | foo(xref); | ^^^^ reborrow through at ALLOC[0x0] is forbidden @@ -7,18 +7,18 @@ LL | foo(xref); = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental = help: the accessed tag has state Disabled which forbids this reborrow (acting as a child read access) help: the accessed tag was created here, in the initial state Frozen - --> $DIR/pass_invalid_shr.rs:LL:CC + --> tests/fail/both_borrows/pass_invalid_shr.rs:LL:CC | LL | let xref = unsafe { &*xraw }; | ^^^^^^ help: the accessed tag later transitioned to Disabled due to a foreign write access at offsets [0x0..0x4] - --> $DIR/pass_invalid_shr.rs:LL:CC + --> tests/fail/both_borrows/pass_invalid_shr.rs:LL:CC | LL | unsafe { *xraw = 42 }; // unfreeze | ^^^^^^^^^^ = help: this transition corresponds to a loss of read permissions = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/pass_invalid_shr.rs:LL:CC + = note: inside `main` at tests/fail/both_borrows/pass_invalid_shr.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr_option.stack.stderr b/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr_option.stack.stderr index dfc99ff7cd233..5aca026cb7632 100644 --- a/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr_option.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr_option.stack.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: trying to retag from for SharedReadOnly permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/pass_invalid_shr_option.rs:LL:CC + --> tests/fail/both_borrows/pass_invalid_shr_option.rs:LL:CC | LL | foo(some_xref); | ^^^^^^^^^ @@ -11,17 +11,17 @@ LL | foo(some_xref); = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadOnly retag at offsets [0x0..0x4] - --> $DIR/pass_invalid_shr_option.rs:LL:CC + --> tests/fail/both_borrows/pass_invalid_shr_option.rs:LL:CC | LL | let some_xref = unsafe { Some(&*xraw) }; | ^^^^^^^^^^^^ help: was later invalidated at offsets [0x0..0x4] by a write access - --> $DIR/pass_invalid_shr_option.rs:LL:CC + --> tests/fail/both_borrows/pass_invalid_shr_option.rs:LL:CC | LL | unsafe { *xraw = 42 }; // unfreeze | ^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/pass_invalid_shr_option.rs:LL:CC + = note: inside `main` at tests/fail/both_borrows/pass_invalid_shr_option.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr_option.tree.stderr b/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr_option.tree.stderr index f687b3f867fc3..de63c9609a6e6 100644 --- a/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr_option.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr_option.tree.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: reborrow through at ALLOC[0x0] is forbidden - --> $DIR/pass_invalid_shr_option.rs:LL:CC + --> tests/fail/both_borrows/pass_invalid_shr_option.rs:LL:CC | LL | foo(some_xref); | ^^^^^^^^^ reborrow through at ALLOC[0x0] is forbidden @@ -7,18 +7,18 @@ LL | foo(some_xref); = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental = help: the accessed tag has state Disabled which forbids this reborrow (acting as a child read access) help: the accessed tag was created here, in the initial state Frozen - --> $DIR/pass_invalid_shr_option.rs:LL:CC + --> tests/fail/both_borrows/pass_invalid_shr_option.rs:LL:CC | LL | let some_xref = unsafe { Some(&*xraw) }; | ^^^^^^^^^^^^ help: the accessed tag later transitioned to Disabled due to a foreign write access at offsets [0x0..0x4] - --> $DIR/pass_invalid_shr_option.rs:LL:CC + --> tests/fail/both_borrows/pass_invalid_shr_option.rs:LL:CC | LL | unsafe { *xraw = 42 }; // unfreeze | ^^^^^^^^^^ = help: this transition corresponds to a loss of read permissions = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/pass_invalid_shr_option.rs:LL:CC + = note: inside `main` at tests/fail/both_borrows/pass_invalid_shr_option.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr_tuple.stack.stderr b/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr_tuple.stack.stderr index e4ebe22b60e2b..16c2af081ad7d 100644 --- a/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr_tuple.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr_tuple.stack.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: trying to retag from for SharedReadOnly permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/pass_invalid_shr_tuple.rs:LL:CC + --> tests/fail/both_borrows/pass_invalid_shr_tuple.rs:LL:CC | LL | foo(pair_xref); | ^^^^^^^^^ @@ -11,17 +11,17 @@ LL | foo(pair_xref); = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadOnly retag at offsets [0x0..0x4] - --> $DIR/pass_invalid_shr_tuple.rs:LL:CC + --> tests/fail/both_borrows/pass_invalid_shr_tuple.rs:LL:CC | LL | let pair_xref = unsafe { (&*xraw0, &*xraw1) }; | ^^^^^^^^^^^^^^^^^^ help: was later invalidated at offsets [0x0..0x4] by a write access - --> $DIR/pass_invalid_shr_tuple.rs:LL:CC + --> tests/fail/both_borrows/pass_invalid_shr_tuple.rs:LL:CC | LL | unsafe { *xraw0 = 42 }; // unfreeze | ^^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/pass_invalid_shr_tuple.rs:LL:CC + = note: inside `main` at tests/fail/both_borrows/pass_invalid_shr_tuple.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr_tuple.tree.stderr b/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr_tuple.tree.stderr index 845838f93d57d..d2a727a920d60 100644 --- a/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr_tuple.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr_tuple.tree.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: reborrow through at ALLOC[0x0] is forbidden - --> $DIR/pass_invalid_shr_tuple.rs:LL:CC + --> tests/fail/both_borrows/pass_invalid_shr_tuple.rs:LL:CC | LL | foo(pair_xref); | ^^^^^^^^^ reborrow through at ALLOC[0x0] is forbidden @@ -7,18 +7,18 @@ LL | foo(pair_xref); = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental = help: the accessed tag has state Disabled which forbids this reborrow (acting as a child read access) help: the accessed tag was created here, in the initial state Frozen - --> $DIR/pass_invalid_shr_tuple.rs:LL:CC + --> tests/fail/both_borrows/pass_invalid_shr_tuple.rs:LL:CC | LL | let pair_xref = unsafe { (&*xraw0, &*xraw1) }; | ^^^^^^^^^^^^^^^^^^ help: the accessed tag later transitioned to Disabled due to a foreign write access at offsets [0x0..0x4] - --> $DIR/pass_invalid_shr_tuple.rs:LL:CC + --> tests/fail/both_borrows/pass_invalid_shr_tuple.rs:LL:CC | LL | unsafe { *xraw0 = 42 }; // unfreeze | ^^^^^^^^^^^ = help: this transition corresponds to a loss of read permissions = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/pass_invalid_shr_tuple.rs:LL:CC + = note: inside `main` at tests/fail/both_borrows/pass_invalid_shr_tuple.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/retag_data_race_write.stack.stderr b/src/tools/miri/tests/fail/both_borrows/retag_data_race_write.stack.stderr index 6f4b52fb88718..6bc66f2419272 100644 --- a/src/tools/miri/tests/fail/both_borrows/retag_data_race_write.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/retag_data_race_write.stack.stderr @@ -1,11 +1,11 @@ error: Undefined Behavior: Data race detected between (1) retag write on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here - --> $DIR/retag_data_race_write.rs:LL:CC + --> tests/fail/both_borrows/retag_data_race_write.rs:LL:CC | LL | *p = 5; | ^^^^^^ Data race detected between (1) retag write on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/retag_data_race_write.rs:LL:CC + --> tests/fail/both_borrows/retag_data_race_write.rs:LL:CC | LL | let _r = &mut *p; | ^^^^^^^ @@ -15,9 +15,9 @@ LL | let _r = &mut *p; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside `thread_2` at $DIR/retag_data_race_write.rs:LL:CC + = note: inside `thread_2` at tests/fail/both_borrows/retag_data_race_write.rs:LL:CC note: inside closure - --> $DIR/retag_data_race_write.rs:LL:CC + --> tests/fail/both_borrows/retag_data_race_write.rs:LL:CC | LL | let t2 = std::thread::spawn(move || thread_2(p)); | ^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/both_borrows/retag_data_race_write.tree.stderr b/src/tools/miri/tests/fail/both_borrows/retag_data_race_write.tree.stderr index fa0012f9b26cf..510e592539fe8 100644 --- a/src/tools/miri/tests/fail/both_borrows/retag_data_race_write.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/retag_data_race_write.tree.stderr @@ -1,11 +1,11 @@ error: Undefined Behavior: Data race detected between (1) retag read on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here - --> $DIR/retag_data_race_write.rs:LL:CC + --> tests/fail/both_borrows/retag_data_race_write.rs:LL:CC | LL | *p = 5; | ^^^^^^ Data race detected between (1) retag read on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/retag_data_race_write.rs:LL:CC + --> tests/fail/both_borrows/retag_data_race_write.rs:LL:CC | LL | let _r = &mut *p; | ^^^^^^^ @@ -15,9 +15,9 @@ LL | let _r = &mut *p; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside `thread_2` at $DIR/retag_data_race_write.rs:LL:CC + = note: inside `thread_2` at tests/fail/both_borrows/retag_data_race_write.rs:LL:CC note: inside closure - --> $DIR/retag_data_race_write.rs:LL:CC + --> tests/fail/both_borrows/retag_data_race_write.rs:LL:CC | LL | let t2 = std::thread::spawn(move || thread_2(p)); | ^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/both_borrows/return_invalid_shr.stack.stderr b/src/tools/miri/tests/fail/both_borrows/return_invalid_shr.stack.stderr index 858afa6fb3c60..0ac3ed9db356f 100644 --- a/src/tools/miri/tests/fail/both_borrows/return_invalid_shr.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/return_invalid_shr.stack.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: trying to retag from for SharedReadOnly permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location - --> $DIR/return_invalid_shr.rs:LL:CC + --> tests/fail/both_borrows/return_invalid_shr.rs:LL:CC | LL | ret | ^^^ @@ -10,19 +10,19 @@ LL | ret = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadOnly retag at offsets [0x4..0x8] - --> $DIR/return_invalid_shr.rs:LL:CC + --> tests/fail/both_borrows/return_invalid_shr.rs:LL:CC | LL | let ret = unsafe { &(*xraw).1 }; | ^^^^^^^^^^ help: was later invalidated at offsets [0x0..0x8] by a write access - --> $DIR/return_invalid_shr.rs:LL:CC + --> tests/fail/both_borrows/return_invalid_shr.rs:LL:CC | LL | unsafe { *xraw = (42, 23) }; // unfreeze | ^^^^^^^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `foo` at $DIR/return_invalid_shr.rs:LL:CC + = note: inside `foo` at tests/fail/both_borrows/return_invalid_shr.rs:LL:CC note: inside `main` - --> $DIR/return_invalid_shr.rs:LL:CC + --> tests/fail/both_borrows/return_invalid_shr.rs:LL:CC | LL | foo(&mut (1, 2)); | ^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/both_borrows/return_invalid_shr.tree.stderr b/src/tools/miri/tests/fail/both_borrows/return_invalid_shr.tree.stderr index 0d19681f637da..cc51f4c77ee1b 100644 --- a/src/tools/miri/tests/fail/both_borrows/return_invalid_shr.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/return_invalid_shr.tree.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: reborrow through at ALLOC[0x4] is forbidden - --> $DIR/return_invalid_shr.rs:LL:CC + --> tests/fail/both_borrows/return_invalid_shr.rs:LL:CC | LL | ret | ^^^ reborrow through at ALLOC[0x4] is forbidden @@ -7,20 +7,20 @@ LL | ret = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental = help: the accessed tag has state Disabled which forbids this reborrow (acting as a child read access) help: the accessed tag was created here, in the initial state Frozen - --> $DIR/return_invalid_shr.rs:LL:CC + --> tests/fail/both_borrows/return_invalid_shr.rs:LL:CC | LL | let ret = unsafe { &(*xraw).1 }; | ^^^^^^^^^^ help: the accessed tag later transitioned to Disabled due to a foreign write access at offsets [0x0..0x8] - --> $DIR/return_invalid_shr.rs:LL:CC + --> tests/fail/both_borrows/return_invalid_shr.rs:LL:CC | LL | unsafe { *xraw = (42, 23) }; // unfreeze | ^^^^^^^^^^^^^^^^ = help: this transition corresponds to a loss of read permissions = note: BACKTRACE (of the first span): - = note: inside `foo` at $DIR/return_invalid_shr.rs:LL:CC + = note: inside `foo` at tests/fail/both_borrows/return_invalid_shr.rs:LL:CC note: inside `main` - --> $DIR/return_invalid_shr.rs:LL:CC + --> tests/fail/both_borrows/return_invalid_shr.rs:LL:CC | LL | foo(&mut (1, 2)); | ^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_option.stack.stderr b/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_option.stack.stderr index ab67bb516ffe3..d8e0f52ff02df 100644 --- a/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_option.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_option.stack.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: trying to retag from for SharedReadOnly permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location - --> $DIR/return_invalid_shr_option.rs:LL:CC + --> tests/fail/both_borrows/return_invalid_shr_option.rs:LL:CC | LL | ret | ^^^ @@ -11,19 +11,19 @@ LL | ret = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadOnly retag at offsets [0x4..0x8] - --> $DIR/return_invalid_shr_option.rs:LL:CC + --> tests/fail/both_borrows/return_invalid_shr_option.rs:LL:CC | LL | let ret = Some(unsafe { &(*xraw).1 }); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: was later invalidated at offsets [0x0..0x8] by a write access - --> $DIR/return_invalid_shr_option.rs:LL:CC + --> tests/fail/both_borrows/return_invalid_shr_option.rs:LL:CC | LL | unsafe { *xraw = (42, 23) }; // unfreeze | ^^^^^^^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `foo` at $DIR/return_invalid_shr_option.rs:LL:CC + = note: inside `foo` at tests/fail/both_borrows/return_invalid_shr_option.rs:LL:CC note: inside `main` - --> $DIR/return_invalid_shr_option.rs:LL:CC + --> tests/fail/both_borrows/return_invalid_shr_option.rs:LL:CC | LL | match foo(&mut (1, 2)) { | ^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_option.tree.stderr b/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_option.tree.stderr index e770372925130..7a7d8f20fa889 100644 --- a/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_option.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_option.tree.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: reborrow through at ALLOC[0x4] is forbidden - --> $DIR/return_invalid_shr_option.rs:LL:CC + --> tests/fail/both_borrows/return_invalid_shr_option.rs:LL:CC | LL | ret | ^^^ reborrow through at ALLOC[0x4] is forbidden @@ -7,20 +7,20 @@ LL | ret = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental = help: the accessed tag has state Disabled which forbids this reborrow (acting as a child read access) help: the accessed tag was created here, in the initial state Frozen - --> $DIR/return_invalid_shr_option.rs:LL:CC + --> tests/fail/both_borrows/return_invalid_shr_option.rs:LL:CC | LL | let ret = Some(unsafe { &(*xraw).1 }); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: the accessed tag later transitioned to Disabled due to a foreign write access at offsets [0x0..0x8] - --> $DIR/return_invalid_shr_option.rs:LL:CC + --> tests/fail/both_borrows/return_invalid_shr_option.rs:LL:CC | LL | unsafe { *xraw = (42, 23) }; // unfreeze | ^^^^^^^^^^^^^^^^ = help: this transition corresponds to a loss of read permissions = note: BACKTRACE (of the first span): - = note: inside `foo` at $DIR/return_invalid_shr_option.rs:LL:CC + = note: inside `foo` at tests/fail/both_borrows/return_invalid_shr_option.rs:LL:CC note: inside `main` - --> $DIR/return_invalid_shr_option.rs:LL:CC + --> tests/fail/both_borrows/return_invalid_shr_option.rs:LL:CC | LL | match foo(&mut (1, 2)) { | ^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_tuple.stack.stderr b/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_tuple.stack.stderr index 22a55f0d37cd6..38b8758964b1c 100644 --- a/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_tuple.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_tuple.stack.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: trying to retag from for SharedReadOnly permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location - --> $DIR/return_invalid_shr_tuple.rs:LL:CC + --> tests/fail/both_borrows/return_invalid_shr_tuple.rs:LL:CC | LL | ret | ^^^ @@ -11,19 +11,19 @@ LL | ret = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadOnly retag at offsets [0x4..0x8] - --> $DIR/return_invalid_shr_tuple.rs:LL:CC + --> tests/fail/both_borrows/return_invalid_shr_tuple.rs:LL:CC | LL | let ret = (unsafe { &(*xraw).1 },); | ^^^^^^^^^^^^^^^^^^^^^^^^ help: was later invalidated at offsets [0x0..0x8] by a write access - --> $DIR/return_invalid_shr_tuple.rs:LL:CC + --> tests/fail/both_borrows/return_invalid_shr_tuple.rs:LL:CC | LL | unsafe { *xraw = (42, 23) }; // unfreeze | ^^^^^^^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `foo` at $DIR/return_invalid_shr_tuple.rs:LL:CC + = note: inside `foo` at tests/fail/both_borrows/return_invalid_shr_tuple.rs:LL:CC note: inside `main` - --> $DIR/return_invalid_shr_tuple.rs:LL:CC + --> tests/fail/both_borrows/return_invalid_shr_tuple.rs:LL:CC | LL | foo(&mut (1, 2)).0; | ^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_tuple.tree.stderr b/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_tuple.tree.stderr index a5c6be3f13aa8..57b4f5fbe2d1b 100644 --- a/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_tuple.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_tuple.tree.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: reborrow through at ALLOC[0x4] is forbidden - --> $DIR/return_invalid_shr_tuple.rs:LL:CC + --> tests/fail/both_borrows/return_invalid_shr_tuple.rs:LL:CC | LL | ret | ^^^ reborrow through at ALLOC[0x4] is forbidden @@ -7,20 +7,20 @@ LL | ret = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental = help: the accessed tag has state Disabled which forbids this reborrow (acting as a child read access) help: the accessed tag was created here, in the initial state Frozen - --> $DIR/return_invalid_shr_tuple.rs:LL:CC + --> tests/fail/both_borrows/return_invalid_shr_tuple.rs:LL:CC | LL | let ret = (unsafe { &(*xraw).1 },); | ^^^^^^^^^^^^^^^^^^^^^^^^ help: the accessed tag later transitioned to Disabled due to a foreign write access at offsets [0x0..0x8] - --> $DIR/return_invalid_shr_tuple.rs:LL:CC + --> tests/fail/both_borrows/return_invalid_shr_tuple.rs:LL:CC | LL | unsafe { *xraw = (42, 23) }; // unfreeze | ^^^^^^^^^^^^^^^^ = help: this transition corresponds to a loss of read permissions = note: BACKTRACE (of the first span): - = note: inside `foo` at $DIR/return_invalid_shr_tuple.rs:LL:CC + = note: inside `foo` at tests/fail/both_borrows/return_invalid_shr_tuple.rs:LL:CC note: inside `main` - --> $DIR/return_invalid_shr_tuple.rs:LL:CC + --> tests/fail/both_borrows/return_invalid_shr_tuple.rs:LL:CC | LL | foo(&mut (1, 2)).0; | ^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation1.stack.stderr b/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation1.stack.stderr index 52ac2184d4948..22efda1efae6c 100644 --- a/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation1.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation1.stack.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: attempting a write access using at ALLOC[0x0], but that tag only grants SharedReadOnly permission for this location - --> $DIR/shr_frozen_violation1.rs:LL:CC + --> tests/fail/both_borrows/shr_frozen_violation1.rs:LL:CC | LL | *(x as *const i32 as *mut i32) = 7; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -10,19 +10,19 @@ LL | *(x as *const i32 as *mut i32) = 7; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadOnly retag at offsets [0x0..0x4] - --> $DIR/shr_frozen_violation1.rs:LL:CC + --> tests/fail/both_borrows/shr_frozen_violation1.rs:LL:CC | LL | *(x as *const i32 as *mut i32) = 7; | ^ = note: BACKTRACE (of the first span): - = note: inside `unknown_code` at $DIR/shr_frozen_violation1.rs:LL:CC + = note: inside `unknown_code` at tests/fail/both_borrows/shr_frozen_violation1.rs:LL:CC note: inside `foo` - --> $DIR/shr_frozen_violation1.rs:LL:CC + --> tests/fail/both_borrows/shr_frozen_violation1.rs:LL:CC | LL | unknown_code(&*x); | ^^^^^^^^^^^^^^^^^ note: inside `main` - --> $DIR/shr_frozen_violation1.rs:LL:CC + --> tests/fail/both_borrows/shr_frozen_violation1.rs:LL:CC | LL | println!("{}", foo(&mut 0)); | ^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation1.tree.stderr b/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation1.tree.stderr index 45b3bceb7287e..2e544583cb210 100644 --- a/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation1.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation1.tree.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: write access through at ALLOC[0x0] is forbidden - --> $DIR/shr_frozen_violation1.rs:LL:CC + --> tests/fail/both_borrows/shr_frozen_violation1.rs:LL:CC | LL | *(x as *const i32 as *mut i32) = 7; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ write access through at ALLOC[0x0] is forbidden @@ -7,19 +7,19 @@ LL | *(x as *const i32 as *mut i32) = 7; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental = help: the accessed tag has state Frozen which forbids this child write access help: the accessed tag was created here, in the initial state Frozen - --> $DIR/shr_frozen_violation1.rs:LL:CC + --> tests/fail/both_borrows/shr_frozen_violation1.rs:LL:CC | LL | fn unknown_code(x: &i32) { | ^ = note: BACKTRACE (of the first span): - = note: inside `unknown_code` at $DIR/shr_frozen_violation1.rs:LL:CC + = note: inside `unknown_code` at tests/fail/both_borrows/shr_frozen_violation1.rs:LL:CC note: inside `foo` - --> $DIR/shr_frozen_violation1.rs:LL:CC + --> tests/fail/both_borrows/shr_frozen_violation1.rs:LL:CC | LL | unknown_code(&*x); | ^^^^^^^^^^^^^^^^^ note: inside `main` - --> $DIR/shr_frozen_violation1.rs:LL:CC + --> tests/fail/both_borrows/shr_frozen_violation1.rs:LL:CC | LL | println!("{}", foo(&mut 0)); | ^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation2.stack.stderr b/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation2.stack.stderr index e05ffb3d35e18..7e6d057a4b6b7 100644 --- a/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation2.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation2.stack.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: attempting a read access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/shr_frozen_violation2.rs:LL:CC + --> tests/fail/both_borrows/shr_frozen_violation2.rs:LL:CC | LL | let _val = *frozen; | ^^^^^^^ @@ -10,17 +10,17 @@ LL | let _val = *frozen; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadOnly retag at offsets [0x0..0x4] - --> $DIR/shr_frozen_violation2.rs:LL:CC + --> tests/fail/both_borrows/shr_frozen_violation2.rs:LL:CC | LL | let frozen = &*ptr; | ^^^^^ help: was later invalidated at offsets [0x0..0x4] by a write access - --> $DIR/shr_frozen_violation2.rs:LL:CC + --> tests/fail/both_borrows/shr_frozen_violation2.rs:LL:CC | LL | x = 1; | ^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/shr_frozen_violation2.rs:LL:CC + = note: inside `main` at tests/fail/both_borrows/shr_frozen_violation2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation2.tree.stderr b/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation2.tree.stderr index 96c2e39edd20a..17c4542e19510 100644 --- a/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation2.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation2.tree.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: read access through at ALLOC[0x0] is forbidden - --> $DIR/shr_frozen_violation2.rs:LL:CC + --> tests/fail/both_borrows/shr_frozen_violation2.rs:LL:CC | LL | let _val = *frozen; | ^^^^^^^ read access through at ALLOC[0x0] is forbidden @@ -7,18 +7,18 @@ LL | let _val = *frozen; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental = help: the accessed tag has state Disabled which forbids this child read access help: the accessed tag was created here, in the initial state Frozen - --> $DIR/shr_frozen_violation2.rs:LL:CC + --> tests/fail/both_borrows/shr_frozen_violation2.rs:LL:CC | LL | let frozen = &*ptr; | ^^^^^ help: the accessed tag later transitioned to Disabled due to a foreign write access at offsets [0x0..0x4] - --> $DIR/shr_frozen_violation2.rs:LL:CC + --> tests/fail/both_borrows/shr_frozen_violation2.rs:LL:CC | LL | x = 1; | ^^^^^ = help: this transition corresponds to a loss of read permissions = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/shr_frozen_violation2.rs:LL:CC + = note: inside `main` at tests/fail/both_borrows/shr_frozen_violation2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/zero-sized-protected.stack.stderr b/src/tools/miri/tests/fail/both_borrows/zero-sized-protected.stack.stderr index 672682ff29401..c01fa2a86c218 100644 --- a/src/tools/miri/tests/fail/both_borrows/zero-sized-protected.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/zero-sized-protected.stack.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: entering unreachable code - --> $DIR/zero-sized-protected.rs:LL:CC + --> tests/fail/both_borrows/zero-sized-protected.rs:LL:CC | LL | unsafe { std::hint::unreachable_unchecked() }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ entering unreachable code @@ -7,7 +7,7 @@ LL | unsafe { std::hint::unreachable_unchecked() }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/zero-sized-protected.rs:LL:CC + = note: inside `main` at tests/fail/both_borrows/zero-sized-protected.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/zero-sized-protected.tree.stderr b/src/tools/miri/tests/fail/both_borrows/zero-sized-protected.tree.stderr index e798833058961..18d1fb6939540 100644 --- a/src/tools/miri/tests/fail/both_borrows/zero-sized-protected.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/zero-sized-protected.tree.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: deallocation through (root of the allocation) at ALLOC[0x0] is forbidden - --> $DIR/zero-sized-protected.rs:LL:CC + --> tests/fail/both_borrows/zero-sized-protected.rs:LL:CC | LL | unsafe { dealloc(ptr, l) }; | ^^^^^^^^^^^^^^^ deallocation through (root of the allocation) at ALLOC[0x0] is forbidden @@ -8,19 +8,19 @@ LL | unsafe { dealloc(ptr, l) }; = help: the allocation of the accessed tag (root of the allocation) also contains the strongly protected tag = help: the strongly protected tag disallows deallocations help: the accessed tag was created here - --> $DIR/zero-sized-protected.rs:LL:CC + --> tests/fail/both_borrows/zero-sized-protected.rs:LL:CC | LL | let ptr = unsafe { alloc(l) }; | ^^^^^^^^ help: the strongly protected tag was created here, in the initial state Reserved - --> $DIR/zero-sized-protected.rs:LL:CC + --> tests/fail/both_borrows/zero-sized-protected.rs:LL:CC | LL | fn test(_x: &mut (), ptr: *mut u8, l: Layout) { | ^^ = note: BACKTRACE (of the first span): - = note: inside `test` at $DIR/zero-sized-protected.rs:LL:CC + = note: inside `test` at tests/fail/both_borrows/zero-sized-protected.rs:LL:CC note: inside `main` - --> $DIR/zero-sized-protected.rs:LL:CC + --> tests/fail/both_borrows/zero-sized-protected.rs:LL:CC | LL | unsafe { test(&mut *ptr.cast::<()>(), ptr, l) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/box-cell-alias.stderr b/src/tools/miri/tests/fail/box-cell-alias.stderr index 697cee52d137e..f9cc6003dc688 100644 --- a/src/tools/miri/tests/fail/box-cell-alias.stderr +++ b/src/tools/miri/tests/fail/box-cell-alias.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: trying to retag from for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/box-cell-alias.rs:LL:CC + --> tests/fail/box-cell-alias.rs:LL:CC | LL | unsafe { (*ptr).set(20) }; | ^^^^^^ @@ -10,19 +10,19 @@ LL | unsafe { (*ptr).set(20) }; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadWrite retag at offsets [0x0..0x1] - --> $DIR/box-cell-alias.rs:LL:CC + --> tests/fail/box-cell-alias.rs:LL:CC | LL | let ptr: *const Cell = &*val; | ^^^^^ help: was later invalidated at offsets [0x0..0x1] by a Unique retag - --> $DIR/box-cell-alias.rs:LL:CC + --> tests/fail/box-cell-alias.rs:LL:CC | LL | let res = helper(val, ptr); | ^^^ = note: BACKTRACE (of the first span): - = note: inside `helper` at $DIR/box-cell-alias.rs:LL:CC + = note: inside `helper` at tests/fail/box-cell-alias.rs:LL:CC note: inside `main` - --> $DIR/box-cell-alias.rs:LL:CC + --> tests/fail/box-cell-alias.rs:LL:CC | LL | let res = helper(val, ptr); | ^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/branchless-select-i128-pointer.stderr b/src/tools/miri/tests/fail/branchless-select-i128-pointer.stderr index 655e682636ead..d9de23dc91221 100644 --- a/src/tools/miri/tests/fail/branchless-select-i128-pointer.stderr +++ b/src/tools/miri/tests/fail/branchless-select-i128-pointer.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value: encountered a dangling reference ($HEX[noalloc] has no provenance) - --> $DIR/branchless-select-i128-pointer.rs:LL:CC + --> tests/fail/branchless-select-i128-pointer.rs:LL:CC | LL | / transmute::<_, &str>( LL | | @@ -11,7 +11,7 @@ LL | | ) = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/branchless-select-i128-pointer.rs:LL:CC + = note: inside `main` at tests/fail/branchless-select-i128-pointer.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/breakpoint.stderr b/src/tools/miri/tests/fail/breakpoint.stderr index a5666d52a2f2b..ca98e81f1f4ed 100644 --- a/src/tools/miri/tests/fail/breakpoint.stderr +++ b/src/tools/miri/tests/fail/breakpoint.stderr @@ -1,11 +1,11 @@ error: abnormal termination: trace/breakpoint trap - --> $DIR/breakpoint.rs:LL:CC + --> tests/fail/breakpoint.rs:LL:CC | LL | core::intrinsics::breakpoint() | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trace/breakpoint trap | = note: BACKTRACE: - = note: inside `main` at $DIR/breakpoint.rs:LL:CC + = note: inside `main` at tests/fail/breakpoint.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/concurrency/read_only_atomic_cmpxchg.stderr b/src/tools/miri/tests/fail/concurrency/read_only_atomic_cmpxchg.stderr index f3e1796f3c9af..62ade0a6793b0 100644 --- a/src/tools/miri/tests/fail/concurrency/read_only_atomic_cmpxchg.stderr +++ b/src/tools/miri/tests/fail/concurrency/read_only_atomic_cmpxchg.stderr @@ -1,6 +1,6 @@ error: Undefined Behavior: atomic store and read-modify-write operations cannot be performed on read-only memory see for more information - --> $DIR/read_only_atomic_cmpxchg.rs:LL:CC + --> tests/fail/concurrency/read_only_atomic_cmpxchg.rs:LL:CC | LL | x.compare_exchange(1, 2, Ordering::Relaxed, Ordering::Relaxed).unwrap_err(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ atomic store and read-modify-write operations cannot be performed on read-only memory @@ -9,7 +9,7 @@ see for more information - --> $DIR/read_only_atomic_load_acquire.rs:LL:CC + --> tests/fail/concurrency/read_only_atomic_load_acquire.rs:LL:CC | LL | x.load(Ordering::Acquire); | ^^^^^^^^^^^^^^^^^^^^^^^^^ non-relaxed atomic load operations cannot be performed on read-only memory @@ -11,7 +11,7 @@ see for more information - --> $DIR/read_only_atomic_load_large.rs:LL:CC + --> tests/fail/concurrency/read_only_atomic_load_large.rs:LL:CC | LL | x.load(Ordering::Relaxed); | ^^^^^^^^^^^^^^^^^^^^^^^^^ large atomic load operations cannot be performed on read-only memory @@ -11,7 +11,7 @@ see $DIR/const-ub-checks.rs:LL:CC + --> tests/fail/const-ub-checks.rs:LL:CC | LL | ptr.read(); | ^^^^^^^^^^ accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required note: erroneous constant encountered - --> $DIR/const-ub-checks.rs:LL:CC + --> tests/fail/const-ub-checks.rs:LL:CC | LL | let _x = UNALIGNED_READ; | ^^^^^^^^^^^^^^ note: erroneous constant encountered - --> $DIR/const-ub-checks.rs:LL:CC + --> tests/fail/const-ub-checks.rs:LL:CC | LL | let _x = UNALIGNED_READ; | ^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/coroutine-pinned-moved.stderr b/src/tools/miri/tests/fail/coroutine-pinned-moved.stderr index b5b0cbb04e017..c2c6ce987e555 100644 --- a/src/tools/miri/tests/fail/coroutine-pinned-moved.stderr +++ b/src/tools/miri/tests/fail/coroutine-pinned-moved.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: memory access failed: ALLOC has been freed, so this pointer is dangling - --> $DIR/coroutine-pinned-moved.rs:LL:CC + --> tests/fail/coroutine-pinned-moved.rs:LL:CC | LL | *num += 1; | ^^^^^^^^^ memory access failed: ALLOC has been freed, so this pointer is dangling @@ -7,25 +7,25 @@ LL | *num += 1; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information help: ALLOC was allocated here: - --> $DIR/coroutine-pinned-moved.rs:LL:CC + --> tests/fail/coroutine-pinned-moved.rs:LL:CC | LL | let mut coroutine_iterator = Box::new(CoroutineIteratorAdapter(firstn())); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: ALLOC was deallocated here: - --> $DIR/coroutine-pinned-moved.rs:LL:CC + --> tests/fail/coroutine-pinned-moved.rs:LL:CC | LL | }; // *deallocate* coroutine_iterator | ^ = note: BACKTRACE (of the first span): - = note: inside closure at $DIR/coroutine-pinned-moved.rs:LL:CC -note: inside ` as std::iter::Iterator>::next` - --> $DIR/coroutine-pinned-moved.rs:LL:CC + = note: inside closure at tests/fail/coroutine-pinned-moved.rs:LL:CC +note: inside ` as std::iter::Iterator>::next` + --> tests/fail/coroutine-pinned-moved.rs:LL:CC | LL | match me.resume(()) { | ^^^^^^^^^^^^^ - = note: inside `> as std::iter::Iterator>::next` at RUSTLIB/alloc/src/boxed.rs:LL:CC + = note: inside `> as std::iter::Iterator>::next` at RUSTLIB/alloc/src/boxed.rs:LL:CC note: inside `main` - --> $DIR/coroutine-pinned-moved.rs:LL:CC + --> tests/fail/coroutine-pinned-moved.rs:LL:CC | LL | coroutine_iterator_2.next(); // and use moved value | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_deref.stderr b/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_deref.stderr index d7fa84e0ca1da..7613552b4b0e8 100644 --- a/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_deref.stderr +++ b/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_deref.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: memory access failed: ALLOC has been freed, so this pointer is dangling - --> $DIR/dangling_pointer_deref.rs:LL:CC + --> tests/fail/dangling_pointers/dangling_pointer_deref.rs:LL:CC | LL | let x = unsafe { *p }; | ^^ memory access failed: ALLOC has been freed, so this pointer is dangling @@ -7,17 +7,17 @@ LL | let x = unsafe { *p }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information help: ALLOC was allocated here: - --> $DIR/dangling_pointer_deref.rs:LL:CC + --> tests/fail/dangling_pointers/dangling_pointer_deref.rs:LL:CC | LL | let b = Box::new(42); | ^^^^^^^^^^^^ help: ALLOC was deallocated here: - --> $DIR/dangling_pointer_deref.rs:LL:CC + --> tests/fail/dangling_pointers/dangling_pointer_deref.rs:LL:CC | LL | }; | ^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/dangling_pointer_deref.rs:LL:CC + = note: inside `main` at tests/fail/dangling_pointers/dangling_pointer_deref.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_deref_match_never.stderr b/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_deref_match_never.stderr index 7d38a5649a5da..032cbccaf9bd0 100644 --- a/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_deref_match_never.stderr +++ b/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_deref_match_never.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: entering unreachable code - --> $DIR/dangling_pointer_deref_match_never.rs:LL:CC + --> tests/fail/dangling_pointers/dangling_pointer_deref_match_never.rs:LL:CC | LL | match *p {} | ^^ entering unreachable code @@ -7,7 +7,7 @@ LL | match *p {} = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/dangling_pointer_deref_match_never.rs:LL:CC + = note: inside `main` at tests/fail/dangling_pointers/dangling_pointer_deref_match_never.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_offset.stderr b/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_offset.stderr index b9fbadb1f898d..076d688046186 100644 --- a/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_offset.stderr +++ b/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_offset.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: out-of-bounds pointer arithmetic: ALLOC has been freed, so this pointer is dangling - --> $DIR/dangling_pointer_offset.rs:LL:CC + --> tests/fail/dangling_pointers/dangling_pointer_offset.rs:LL:CC | LL | let x = unsafe { p.offset(42) }; | ^^^^^^^^^^^^ out-of-bounds pointer arithmetic: ALLOC has been freed, so this pointer is dangling @@ -7,17 +7,17 @@ LL | let x = unsafe { p.offset(42) }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information help: ALLOC was allocated here: - --> $DIR/dangling_pointer_offset.rs:LL:CC + --> tests/fail/dangling_pointers/dangling_pointer_offset.rs:LL:CC | LL | let b = Box::new(42); | ^^^^^^^^^^^^ help: ALLOC was deallocated here: - --> $DIR/dangling_pointer_offset.rs:LL:CC + --> tests/fail/dangling_pointers/dangling_pointer_offset.rs:LL:CC | LL | }; | ^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/dangling_pointer_offset.rs:LL:CC + = note: inside `main` at tests/fail/dangling_pointers/dangling_pointer_offset.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_project_underscore_let.stderr b/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_project_underscore_let.stderr index 05e8c95166c85..ffb525e398142 100644 --- a/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_project_underscore_let.stderr +++ b/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_project_underscore_let.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: out-of-bounds pointer arithmetic: ALLOC has been freed, so this pointer is dangling - --> $DIR/dangling_pointer_project_underscore_let.rs:LL:CC + --> tests/fail/dangling_pointers/dangling_pointer_project_underscore_let.rs:LL:CC | LL | let _ = (*p).1; | ^^^^^^ out-of-bounds pointer arithmetic: ALLOC has been freed, so this pointer is dangling @@ -7,17 +7,17 @@ LL | let _ = (*p).1; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information help: ALLOC was allocated here: - --> $DIR/dangling_pointer_project_underscore_let.rs:LL:CC + --> tests/fail/dangling_pointers/dangling_pointer_project_underscore_let.rs:LL:CC | LL | let b = Box::new(42); | ^^^^^^^^^^^^ help: ALLOC was deallocated here: - --> $DIR/dangling_pointer_project_underscore_let.rs:LL:CC + --> tests/fail/dangling_pointers/dangling_pointer_project_underscore_let.rs:LL:CC | LL | }; | ^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/dangling_pointer_project_underscore_let.rs:LL:CC + = note: inside `main` at tests/fail/dangling_pointers/dangling_pointer_project_underscore_let.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_project_underscore_let_type_annotation.stderr b/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_project_underscore_let_type_annotation.stderr index 8f7ba156a937b..14dfa43b2d687 100644 --- a/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_project_underscore_let_type_annotation.stderr +++ b/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_project_underscore_let_type_annotation.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: out-of-bounds pointer arithmetic: ALLOC has been freed, so this pointer is dangling - --> $DIR/dangling_pointer_project_underscore_let_type_annotation.rs:LL:CC + --> tests/fail/dangling_pointers/dangling_pointer_project_underscore_let_type_annotation.rs:LL:CC | LL | let _: u8 = (*p).1; | ^^^^^^ out-of-bounds pointer arithmetic: ALLOC has been freed, so this pointer is dangling @@ -7,17 +7,17 @@ LL | let _: u8 = (*p).1; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information help: ALLOC was allocated here: - --> $DIR/dangling_pointer_project_underscore_let_type_annotation.rs:LL:CC + --> tests/fail/dangling_pointers/dangling_pointer_project_underscore_let_type_annotation.rs:LL:CC | LL | let b = Box::new(42); | ^^^^^^^^^^^^ help: ALLOC was deallocated here: - --> $DIR/dangling_pointer_project_underscore_let_type_annotation.rs:LL:CC + --> tests/fail/dangling_pointers/dangling_pointer_project_underscore_let_type_annotation.rs:LL:CC | LL | }; | ^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/dangling_pointer_project_underscore_let_type_annotation.rs:LL:CC + = note: inside `main` at tests/fail/dangling_pointers/dangling_pointer_project_underscore_let_type_annotation.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_project_underscore_match.stderr b/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_project_underscore_match.stderr index c2b5d7b23cbc8..ff39e1475738f 100644 --- a/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_project_underscore_match.stderr +++ b/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_project_underscore_match.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: out-of-bounds pointer arithmetic: ALLOC has been freed, so this pointer is dangling - --> $DIR/dangling_pointer_project_underscore_match.rs:LL:CC + --> tests/fail/dangling_pointers/dangling_pointer_project_underscore_match.rs:LL:CC | LL | match (*p).1 { | ^^^^^^ out-of-bounds pointer arithmetic: ALLOC has been freed, so this pointer is dangling @@ -7,17 +7,17 @@ LL | match (*p).1 { = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information help: ALLOC was allocated here: - --> $DIR/dangling_pointer_project_underscore_match.rs:LL:CC + --> tests/fail/dangling_pointers/dangling_pointer_project_underscore_match.rs:LL:CC | LL | let b = Box::new(42); | ^^^^^^^^^^^^ help: ALLOC was deallocated here: - --> $DIR/dangling_pointer_project_underscore_match.rs:LL:CC + --> tests/fail/dangling_pointers/dangling_pointer_project_underscore_match.rs:LL:CC | LL | }; | ^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/dangling_pointer_project_underscore_match.rs:LL:CC + = note: inside `main` at tests/fail/dangling_pointers/dangling_pointer_project_underscore_match.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_to_raw_pointer.stderr b/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_to_raw_pointer.stderr index a5c031b949643..99194d6e07256 100644 --- a/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_to_raw_pointer.stderr +++ b/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_to_raw_pointer.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: out-of-bounds pointer use: expected a pointer to 4 bytes of memory, but got 0x10[noalloc] which is a dangling pointer (it has no provenance) - --> $DIR/dangling_pointer_to_raw_pointer.rs:LL:CC + --> tests/fail/dangling_pointers/dangling_pointer_to_raw_pointer.rs:LL:CC | LL | unsafe { &(*x).0 as *const i32 } | ^^^^^^^ out-of-bounds pointer use: expected a pointer to 4 bytes of memory, but got 0x10[noalloc] which is a dangling pointer (it has no provenance) @@ -7,9 +7,9 @@ LL | unsafe { &(*x).0 as *const i32 } = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `via_ref` at $DIR/dangling_pointer_to_raw_pointer.rs:LL:CC + = note: inside `via_ref` at tests/fail/dangling_pointers/dangling_pointer_to_raw_pointer.rs:LL:CC note: inside `main` - --> $DIR/dangling_pointer_to_raw_pointer.rs:LL:CC + --> tests/fail/dangling_pointers/dangling_pointer_to_raw_pointer.rs:LL:CC | LL | via_ref(ptr); // this is not | ^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/dangling_pointers/dangling_primitive.stderr b/src/tools/miri/tests/fail/dangling_pointers/dangling_primitive.stderr index ee02c1040c704..2d7456c15b96b 100644 --- a/src/tools/miri/tests/fail/dangling_pointers/dangling_primitive.stderr +++ b/src/tools/miri/tests/fail/dangling_pointers/dangling_primitive.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: memory access failed: ALLOC has been freed, so this pointer is dangling - --> $DIR/dangling_primitive.rs:LL:CC + --> tests/fail/dangling_pointers/dangling_primitive.rs:LL:CC | LL | dbg!(*ptr); | ^^^^^^^^^^ memory access failed: ALLOC has been freed, so this pointer is dangling @@ -7,12 +7,12 @@ LL | dbg!(*ptr); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information help: ALLOC was allocated here: - --> $DIR/dangling_primitive.rs:LL:CC + --> tests/fail/dangling_pointers/dangling_primitive.rs:LL:CC | LL | let x = 0usize; // This line should appear in the helps | ^ help: ALLOC was deallocated here: - --> $DIR/dangling_primitive.rs:LL:CC + --> tests/fail/dangling_pointers/dangling_primitive.rs:LL:CC | LL | }; | ^ diff --git a/src/tools/miri/tests/fail/dangling_pointers/deref-invalid-ptr.stderr b/src/tools/miri/tests/fail/dangling_pointers/deref-invalid-ptr.stderr index d989bff4516f2..09a201983b1f3 100644 --- a/src/tools/miri/tests/fail/dangling_pointers/deref-invalid-ptr.stderr +++ b/src/tools/miri/tests/fail/dangling_pointers/deref-invalid-ptr.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: out-of-bounds pointer use: expected a pointer to 4 bytes of memory, but got 0x10[noalloc] which is a dangling pointer (it has no provenance) - --> $DIR/deref-invalid-ptr.rs:LL:CC + --> tests/fail/dangling_pointers/deref-invalid-ptr.rs:LL:CC | LL | let _y = unsafe { &*x as *const u32 }; | ^^^ out-of-bounds pointer use: expected a pointer to 4 bytes of memory, but got 0x10[noalloc] which is a dangling pointer (it has no provenance) @@ -7,7 +7,7 @@ LL | let _y = unsafe { &*x as *const u32 }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/deref-invalid-ptr.rs:LL:CC + = note: inside `main` at tests/fail/dangling_pointers/deref-invalid-ptr.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/dangling_pointers/deref_dangling_box.stderr b/src/tools/miri/tests/fail/dangling_pointers/deref_dangling_box.stderr index eb4482f5caea8..82802f02b992b 100644 --- a/src/tools/miri/tests/fail/dangling_pointers/deref_dangling_box.stderr +++ b/src/tools/miri/tests/fail/dangling_pointers/deref_dangling_box.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value: encountered a dangling box (0x18[noalloc] has no provenance) - --> $DIR/deref_dangling_box.rs:LL:CC + --> tests/fail/dangling_pointers/deref_dangling_box.rs:LL:CC | LL | let _val = unsafe { addr_of_mut!(**outer) }; | ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (0x18[noalloc] has no provenance) diff --git a/src/tools/miri/tests/fail/dangling_pointers/deref_dangling_ref.stderr b/src/tools/miri/tests/fail/dangling_pointers/deref_dangling_ref.stderr index c0d989dc1a0cd..364d193b0c5f1 100644 --- a/src/tools/miri/tests/fail/dangling_pointers/deref_dangling_ref.stderr +++ b/src/tools/miri/tests/fail/dangling_pointers/deref_dangling_ref.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value: encountered a dangling reference (0x18[noalloc] has no provenance) - --> $DIR/deref_dangling_ref.rs:LL:CC + --> tests/fail/dangling_pointers/deref_dangling_ref.rs:LL:CC | LL | let _val = unsafe { addr_of_mut!(**outer) }; | ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (0x18[noalloc] has no provenance) diff --git a/src/tools/miri/tests/fail/dangling_pointers/dyn_size.stderr b/src/tools/miri/tests/fail/dangling_pointers/dyn_size.stderr index 7d43857b9bfb4..f3596347f61b8 100644 --- a/src/tools/miri/tests/fail/dangling_pointers/dyn_size.stderr +++ b/src/tools/miri/tests/fail/dangling_pointers/dyn_size.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation) - --> $DIR/dyn_size.rs:LL:CC + --> tests/fail/dangling_pointers/dyn_size.rs:LL:CC | LL | let _ptr = unsafe { &*ptr }; | ^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation) @@ -7,7 +7,7 @@ LL | let _ptr = unsafe { &*ptr }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/dyn_size.rs:LL:CC + = note: inside `main` at tests/fail/dangling_pointers/dyn_size.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/dangling_pointers/null_pointer_deref.stderr b/src/tools/miri/tests/fail/dangling_pointers/null_pointer_deref.stderr index 1b97265eb32f6..d87a8bc59e951 100644 --- a/src/tools/miri/tests/fail/dangling_pointers/null_pointer_deref.stderr +++ b/src/tools/miri/tests/fail/dangling_pointers/null_pointer_deref.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: memory access failed: expected a pointer to 4 bytes of memory, but got a null pointer - --> $DIR/null_pointer_deref.rs:LL:CC + --> tests/fail/dangling_pointers/null_pointer_deref.rs:LL:CC | LL | let x: i32 = unsafe { *std::ptr::null() }; | ^^^^^^^^^^^^^^^^^ memory access failed: expected a pointer to 4 bytes of memory, but got a null pointer @@ -7,7 +7,7 @@ LL | let x: i32 = unsafe { *std::ptr::null() }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/null_pointer_deref.rs:LL:CC + = note: inside `main` at tests/fail/dangling_pointers/null_pointer_deref.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/dangling_pointers/null_pointer_write.stderr b/src/tools/miri/tests/fail/dangling_pointers/null_pointer_write.stderr index 3d75e7a0254b6..39d861a63882b 100644 --- a/src/tools/miri/tests/fail/dangling_pointers/null_pointer_write.stderr +++ b/src/tools/miri/tests/fail/dangling_pointers/null_pointer_write.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: memory access failed: expected a pointer to 4 bytes of memory, but got a null pointer - --> $DIR/null_pointer_write.rs:LL:CC + --> tests/fail/dangling_pointers/null_pointer_write.rs:LL:CC | LL | unsafe { *std::ptr::null_mut() = 0i32 }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: expected a pointer to 4 bytes of memory, but got a null pointer @@ -7,7 +7,7 @@ LL | unsafe { *std::ptr::null_mut() = 0i32 }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/null_pointer_write.rs:LL:CC + = note: inside `main` at tests/fail/dangling_pointers/null_pointer_write.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/dangling_pointers/out_of_bounds_project.stderr b/src/tools/miri/tests/fail/dangling_pointers/out_of_bounds_project.stderr index 4bfac8f96578d..27a437c7483d0 100644 --- a/src/tools/miri/tests/fail/dangling_pointers/out_of_bounds_project.stderr +++ b/src/tools/miri/tests/fail/dangling_pointers/out_of_bounds_project.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: out-of-bounds pointer arithmetic: expected a pointer to 8 bytes of memory, but got ALLOC which is only 4 bytes from the end of the allocation - --> $DIR/out_of_bounds_project.rs:LL:CC + --> tests/fail/dangling_pointers/out_of_bounds_project.rs:LL:CC | LL | let _field = addr_of!((*ptr).2); | ^^^^^^^^^^^^^^^^^^ out-of-bounds pointer arithmetic: expected a pointer to 8 bytes of memory, but got ALLOC which is only 4 bytes from the end of the allocation @@ -7,7 +7,7 @@ LL | let _field = addr_of!((*ptr).2); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information help: ALLOC was allocated here: - --> $DIR/out_of_bounds_project.rs:LL:CC + --> tests/fail/dangling_pointers/out_of_bounds_project.rs:LL:CC | LL | let v = 0u32; | ^ diff --git a/src/tools/miri/tests/fail/dangling_pointers/out_of_bounds_read.stderr b/src/tools/miri/tests/fail/dangling_pointers/out_of_bounds_read.stderr index 8a774c21bb7c1..813bcef54f12c 100644 --- a/src/tools/miri/tests/fail/dangling_pointers/out_of_bounds_read.stderr +++ b/src/tools/miri/tests/fail/dangling_pointers/out_of_bounds_read.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: memory access failed: expected a pointer to 2 bytes of memory, but got ALLOC+0x5 which is at or beyond the end of the allocation of size 4 bytes - --> $DIR/out_of_bounds_read.rs:LL:CC + --> tests/fail/dangling_pointers/out_of_bounds_read.rs:LL:CC | LL | let x = unsafe { *v.as_ptr().wrapping_byte_add(5) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: expected a pointer to 2 bytes of memory, but got ALLOC+0x5 which is at or beyond the end of the allocation of size 4 bytes @@ -7,12 +7,12 @@ LL | let x = unsafe { *v.as_ptr().wrapping_byte_add(5) }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information help: ALLOC was allocated here: - --> $DIR/out_of_bounds_read.rs:LL:CC + --> tests/fail/dangling_pointers/out_of_bounds_read.rs:LL:CC | LL | let v: Vec = vec![1, 2]; | ^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/out_of_bounds_read.rs:LL:CC + = note: inside `main` at tests/fail/dangling_pointers/out_of_bounds_read.rs:LL:CC = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info) note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/dangling_pointers/out_of_bounds_write.stderr b/src/tools/miri/tests/fail/dangling_pointers/out_of_bounds_write.stderr index 6ae9f05d17381..1056a739a436f 100644 --- a/src/tools/miri/tests/fail/dangling_pointers/out_of_bounds_write.stderr +++ b/src/tools/miri/tests/fail/dangling_pointers/out_of_bounds_write.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: memory access failed: expected a pointer to 2 bytes of memory, but got ALLOC+0x5 which is at or beyond the end of the allocation of size 4 bytes - --> $DIR/out_of_bounds_write.rs:LL:CC + --> tests/fail/dangling_pointers/out_of_bounds_write.rs:LL:CC | LL | unsafe { *v.as_mut_ptr().wrapping_byte_add(5) = 0 }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: expected a pointer to 2 bytes of memory, but got ALLOC+0x5 which is at or beyond the end of the allocation of size 4 bytes @@ -7,12 +7,12 @@ LL | unsafe { *v.as_mut_ptr().wrapping_byte_add(5) = 0 }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information help: ALLOC was allocated here: - --> $DIR/out_of_bounds_write.rs:LL:CC + --> tests/fail/dangling_pointers/out_of_bounds_write.rs:LL:CC | LL | let mut v: Vec = vec![1, 2]; | ^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/out_of_bounds_write.rs:LL:CC + = note: inside `main` at tests/fail/dangling_pointers/out_of_bounds_write.rs:LL:CC = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info) note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/dangling_pointers/stack_temporary.stderr b/src/tools/miri/tests/fail/dangling_pointers/stack_temporary.stderr index d5c53e4ad6476..c617dfdb3a632 100644 --- a/src/tools/miri/tests/fail/dangling_pointers/stack_temporary.stderr +++ b/src/tools/miri/tests/fail/dangling_pointers/stack_temporary.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: memory access failed: ALLOC has been freed, so this pointer is dangling - --> $DIR/stack_temporary.rs:LL:CC + --> tests/fail/dangling_pointers/stack_temporary.rs:LL:CC | LL | let val = *x; | ^^ memory access failed: ALLOC has been freed, so this pointer is dangling @@ -7,17 +7,17 @@ LL | let val = *x; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information help: ALLOC was allocated here: - --> $DIR/stack_temporary.rs:LL:CC + --> tests/fail/dangling_pointers/stack_temporary.rs:LL:CC | LL | let x = make_ref(&mut 0); // The temporary storing "0" is deallocated at the ";"! | ^ help: ALLOC was deallocated here: - --> $DIR/stack_temporary.rs:LL:CC + --> tests/fail/dangling_pointers/stack_temporary.rs:LL:CC | LL | let x = make_ref(&mut 0); // The temporary storing "0" is deallocated at the ";"! | ^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/stack_temporary.rs:LL:CC + = note: inside `main` at tests/fail/dangling_pointers/stack_temporary.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/dangling_pointers/storage_dead_dangling.stderr b/src/tools/miri/tests/fail/dangling_pointers/storage_dead_dangling.stderr index 2d4fbafd8b7f6..9061121494d0e 100644 --- a/src/tools/miri/tests/fail/dangling_pointers/storage_dead_dangling.stderr +++ b/src/tools/miri/tests/fail/dangling_pointers/storage_dead_dangling.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: out-of-bounds pointer use: expected a pointer to 4 bytes of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance) - --> $DIR/storage_dead_dangling.rs:LL:CC + --> tests/fail/dangling_pointers/storage_dead_dangling.rs:LL:CC | LL | let _ref = unsafe { &mut *(LEAK as *mut i32) }; | ^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer use: expected a pointer to 4 bytes of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance) @@ -7,9 +7,9 @@ LL | let _ref = unsafe { &mut *(LEAK as *mut i32) }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `evil` at $DIR/storage_dead_dangling.rs:LL:CC + = note: inside `evil` at tests/fail/dangling_pointers/storage_dead_dangling.rs:LL:CC note: inside `main` - --> $DIR/storage_dead_dangling.rs:LL:CC + --> tests/fail/dangling_pointers/storage_dead_dangling.rs:LL:CC | LL | evil(); | ^^^^^^ diff --git a/src/tools/miri/tests/fail/dangling_pointers/wild_pointer_deref.stderr b/src/tools/miri/tests/fail/dangling_pointers/wild_pointer_deref.stderr index 1d8eed3d30a7c..3e7aac4724dcc 100644 --- a/src/tools/miri/tests/fail/dangling_pointers/wild_pointer_deref.stderr +++ b/src/tools/miri/tests/fail/dangling_pointers/wild_pointer_deref.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: memory access failed: expected a pointer to 4 bytes of memory, but got 0x2c[noalloc] which is a dangling pointer (it has no provenance) - --> $DIR/wild_pointer_deref.rs:LL:CC + --> tests/fail/dangling_pointers/wild_pointer_deref.rs:LL:CC | LL | let x = unsafe { *p }; | ^^ memory access failed: expected a pointer to 4 bytes of memory, but got 0x2c[noalloc] which is a dangling pointer (it has no provenance) @@ -7,7 +7,7 @@ LL | let x = unsafe { *p }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/wild_pointer_deref.rs:LL:CC + = note: inside `main` at tests/fail/dangling_pointers/wild_pointer_deref.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/alloc_read_race.stderr b/src/tools/miri/tests/fail/data_race/alloc_read_race.stderr index 59ed5fe9cf2c4..e6ee9ce81fd98 100644 --- a/src/tools/miri/tests/fail/data_race/alloc_read_race.stderr +++ b/src/tools/miri/tests/fail/data_race/alloc_read_race.stderr @@ -1,18 +1,18 @@ error: Undefined Behavior: Data race detected between (1) creating a new allocation on thread `unnamed-ID` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here - --> $DIR/alloc_read_race.rs:LL:CC + --> tests/fail/data_race/alloc_read_race.rs:LL:CC | LL | *pointer.load(Ordering::Relaxed) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) creating a new allocation on thread `unnamed-ID` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/alloc_read_race.rs:LL:CC + --> tests/fail/data_race/alloc_read_race.rs:LL:CC | LL | pointer.store(Box::into_raw(Box::new_uninit()), Ordering::Relaxed); | ^^^^^^^^^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at $DIR/alloc_read_race.rs:LL:CC + = note: inside closure at tests/fail/data_race/alloc_read_race.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/alloc_write_race.stderr b/src/tools/miri/tests/fail/data_race/alloc_write_race.stderr index 9770684fc52d2..97b54609aded8 100644 --- a/src/tools/miri/tests/fail/data_race/alloc_write_race.stderr +++ b/src/tools/miri/tests/fail/data_race/alloc_write_race.stderr @@ -1,18 +1,18 @@ error: Undefined Behavior: Data race detected between (1) creating a new allocation on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here - --> $DIR/alloc_write_race.rs:LL:CC + --> tests/fail/data_race/alloc_write_race.rs:LL:CC | LL | *pointer.load(Ordering::Relaxed) = 2; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) creating a new allocation on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/alloc_write_race.rs:LL:CC + --> tests/fail/data_race/alloc_write_race.rs:LL:CC | LL | .store(Box::into_raw(Box::::new_uninit()) as *mut usize, Ordering::Relaxed); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at $DIR/alloc_write_race.rs:LL:CC + = note: inside closure at tests/fail/data_race/alloc_write_race.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/atomic_read_na_write_race1.stderr b/src/tools/miri/tests/fail/data_race/atomic_read_na_write_race1.stderr index a1132ed20679c..d3d6ed2e31139 100644 --- a/src/tools/miri/tests/fail/data_race/atomic_read_na_write_race1.stderr +++ b/src/tools/miri/tests/fail/data_race/atomic_read_na_write_race1.stderr @@ -1,18 +1,18 @@ error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) atomic load on thread `unnamed-ID` at ALLOC. (2) just happened here - --> $DIR/atomic_read_na_write_race1.rs:LL:CC + --> tests/fail/data_race/atomic_read_na_write_race1.rs:LL:CC | LL | (&*c.0).load(Ordering::SeqCst) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) atomic load on thread `unnamed-ID` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/atomic_read_na_write_race1.rs:LL:CC + --> tests/fail/data_race/atomic_read_na_write_race1.rs:LL:CC | LL | *(c.0 as *mut usize) = 32; | ^^^^^^^^^^^^^^^^^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at $DIR/atomic_read_na_write_race1.rs:LL:CC + = note: inside closure at tests/fail/data_race/atomic_read_na_write_race1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/atomic_read_na_write_race2.stderr b/src/tools/miri/tests/fail/data_race/atomic_read_na_write_race2.stderr index 865357cb0ef4b..ea535ddac4fff 100644 --- a/src/tools/miri/tests/fail/data_race/atomic_read_na_write_race2.stderr +++ b/src/tools/miri/tests/fail/data_race/atomic_read_na_write_race2.stderr @@ -1,18 +1,18 @@ error: Undefined Behavior: Data race detected between (1) atomic load on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here - --> $DIR/atomic_read_na_write_race2.rs:LL:CC + --> tests/fail/data_race/atomic_read_na_write_race2.rs:LL:CC | LL | *atomic_ref.get_mut() = 32; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) atomic load on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/atomic_read_na_write_race2.rs:LL:CC + --> tests/fail/data_race/atomic_read_na_write_race2.rs:LL:CC | LL | atomic_ref.load(Ordering::SeqCst) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at $DIR/atomic_read_na_write_race2.rs:LL:CC + = note: inside closure at tests/fail/data_race/atomic_read_na_write_race2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/atomic_write_na_read_race1.stderr b/src/tools/miri/tests/fail/data_race/atomic_write_na_read_race1.stderr index 355ea48f11716..fe65eca4bc69e 100644 --- a/src/tools/miri/tests/fail/data_race/atomic_write_na_read_race1.stderr +++ b/src/tools/miri/tests/fail/data_race/atomic_write_na_read_race1.stderr @@ -1,18 +1,18 @@ error: Undefined Behavior: Data race detected between (1) atomic store on thread `unnamed-ID` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here - --> $DIR/atomic_write_na_read_race1.rs:LL:CC + --> tests/fail/data_race/atomic_write_na_read_race1.rs:LL:CC | LL | *atomic_ref.get_mut() | ^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) atomic store on thread `unnamed-ID` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/atomic_write_na_read_race1.rs:LL:CC + --> tests/fail/data_race/atomic_write_na_read_race1.rs:LL:CC | LL | atomic_ref.store(32, Ordering::SeqCst) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at $DIR/atomic_write_na_read_race1.rs:LL:CC + = note: inside closure at tests/fail/data_race/atomic_write_na_read_race1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/atomic_write_na_read_race2.stderr b/src/tools/miri/tests/fail/data_race/atomic_write_na_read_race2.stderr index 500cd09a33307..4393cc3c09301 100644 --- a/src/tools/miri/tests/fail/data_race/atomic_write_na_read_race2.stderr +++ b/src/tools/miri/tests/fail/data_race/atomic_write_na_read_race2.stderr @@ -1,18 +1,18 @@ error: Undefined Behavior: Data race detected between (1) non-atomic read on thread `unnamed-ID` and (2) atomic store on thread `unnamed-ID` at ALLOC. (2) just happened here - --> $DIR/atomic_write_na_read_race2.rs:LL:CC + --> tests/fail/data_race/atomic_write_na_read_race2.rs:LL:CC | LL | (&*c.0).store(32, Ordering::SeqCst); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) non-atomic read on thread `unnamed-ID` and (2) atomic store on thread `unnamed-ID` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/atomic_write_na_read_race2.rs:LL:CC + --> tests/fail/data_race/atomic_write_na_read_race2.rs:LL:CC | LL | let _val = *(c.0 as *mut usize); | ^^^^^^^^^^^^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at $DIR/atomic_write_na_read_race2.rs:LL:CC + = note: inside closure at tests/fail/data_race/atomic_write_na_read_race2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/atomic_write_na_write_race1.stderr b/src/tools/miri/tests/fail/data_race/atomic_write_na_write_race1.stderr index 0b870f13bb2b9..5a7f90447f0e3 100644 --- a/src/tools/miri/tests/fail/data_race/atomic_write_na_write_race1.stderr +++ b/src/tools/miri/tests/fail/data_race/atomic_write_na_write_race1.stderr @@ -1,18 +1,18 @@ error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) atomic store on thread `unnamed-ID` at ALLOC. (2) just happened here - --> $DIR/atomic_write_na_write_race1.rs:LL:CC + --> tests/fail/data_race/atomic_write_na_write_race1.rs:LL:CC | LL | (&*c.0).store(64, Ordering::SeqCst); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) atomic store on thread `unnamed-ID` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/atomic_write_na_write_race1.rs:LL:CC + --> tests/fail/data_race/atomic_write_na_write_race1.rs:LL:CC | LL | *(c.0 as *mut usize) = 32; | ^^^^^^^^^^^^^^^^^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at $DIR/atomic_write_na_write_race1.rs:LL:CC + = note: inside closure at tests/fail/data_race/atomic_write_na_write_race1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/atomic_write_na_write_race2.stderr b/src/tools/miri/tests/fail/data_race/atomic_write_na_write_race2.stderr index dbbf6bf1ef573..9ee4f16d0d5c4 100644 --- a/src/tools/miri/tests/fail/data_race/atomic_write_na_write_race2.stderr +++ b/src/tools/miri/tests/fail/data_race/atomic_write_na_write_race2.stderr @@ -1,18 +1,18 @@ error: Undefined Behavior: Data race detected between (1) atomic store on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here - --> $DIR/atomic_write_na_write_race2.rs:LL:CC + --> tests/fail/data_race/atomic_write_na_write_race2.rs:LL:CC | LL | *atomic_ref.get_mut() = 32; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) atomic store on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/atomic_write_na_write_race2.rs:LL:CC + --> tests/fail/data_race/atomic_write_na_write_race2.rs:LL:CC | LL | atomic_ref.store(64, Ordering::SeqCst); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at $DIR/atomic_write_na_write_race2.rs:LL:CC + = note: inside closure at tests/fail/data_race/atomic_write_na_write_race2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/dangling_thread_async_race.stderr b/src/tools/miri/tests/fail/data_race/dangling_thread_async_race.stderr index 1b02880b99861..1051a1c51f21a 100644 --- a/src/tools/miri/tests/fail/data_race/dangling_thread_async_race.stderr +++ b/src/tools/miri/tests/fail/data_race/dangling_thread_async_race.stderr @@ -1,18 +1,18 @@ error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here - --> $DIR/dangling_thread_async_race.rs:LL:CC + --> tests/fail/data_race/dangling_thread_async_race.rs:LL:CC | LL | *c.0 = 64; | ^^^^^^^^^ Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/dangling_thread_async_race.rs:LL:CC + --> tests/fail/data_race/dangling_thread_async_race.rs:LL:CC | LL | *c.0 = 32; | ^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at $DIR/dangling_thread_async_race.rs:LL:CC + = note: inside closure at tests/fail/data_race/dangling_thread_async_race.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/dangling_thread_race.stderr b/src/tools/miri/tests/fail/data_race/dangling_thread_race.stderr index 7f6ba5ee04088..23a99ff6c8ac5 100644 --- a/src/tools/miri/tests/fail/data_race/dangling_thread_race.stderr +++ b/src/tools/miri/tests/fail/data_race/dangling_thread_race.stderr @@ -1,18 +1,18 @@ error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic write on thread `main` at ALLOC. (2) just happened here - --> $DIR/dangling_thread_race.rs:LL:CC + --> tests/fail/data_race/dangling_thread_race.rs:LL:CC | LL | *c.0 = 64; | ^^^^^^^^^ Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic write on thread `main` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/dangling_thread_race.rs:LL:CC + --> tests/fail/data_race/dangling_thread_race.rs:LL:CC | LL | *c.0 = 32; | ^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/dangling_thread_race.rs:LL:CC + = note: inside `main` at tests/fail/data_race/dangling_thread_race.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/dealloc_read_race1.stderr b/src/tools/miri/tests/fail/data_race/dealloc_read_race1.stderr index a4a22a8d71e94..8eb4ebbcf729d 100644 --- a/src/tools/miri/tests/fail/data_race/dealloc_read_race1.stderr +++ b/src/tools/miri/tests/fail/data_race/dealloc_read_race1.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: Data race detected between (1) non-atomic read on thread `unnamed-ID` and (2) deallocation on thread `unnamed-ID` at ALLOC. (2) just happened here - --> $DIR/dealloc_read_race1.rs:LL:CC + --> tests/fail/data_race/dealloc_read_race1.rs:LL:CC | LL | / __rust_dealloc( LL | | @@ -10,14 +10,14 @@ LL | | ); | |_____________^ Data race detected between (1) non-atomic read on thread `unnamed-ID` and (2) deallocation on thread `unnamed-ID` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/dealloc_read_race1.rs:LL:CC + --> tests/fail/data_race/dealloc_read_race1.rs:LL:CC | LL | let _val = *ptr.0; | ^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at $DIR/dealloc_read_race1.rs:LL:CC + = note: inside closure at tests/fail/data_race/dealloc_read_race1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/dealloc_read_race2.stderr b/src/tools/miri/tests/fail/data_race/dealloc_read_race2.stderr index dbf9acd23b6e0..1a2b048572a5c 100644 --- a/src/tools/miri/tests/fail/data_race/dealloc_read_race2.stderr +++ b/src/tools/miri/tests/fail/data_race/dealloc_read_race2.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: memory access failed: ALLOC has been freed, so this pointer is dangling - --> $DIR/dealloc_read_race2.rs:LL:CC + --> tests/fail/data_race/dealloc_read_race2.rs:LL:CC | LL | *ptr.0 | ^^^^^^ memory access failed: ALLOC has been freed, so this pointer is dangling @@ -7,12 +7,12 @@ LL | *ptr.0 = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information help: ALLOC was allocated here: - --> $DIR/dealloc_read_race2.rs:LL:CC + --> tests/fail/data_race/dealloc_read_race2.rs:LL:CC | LL | let pointer: *mut usize = Box::into_raw(Box::new(0usize)); | ^^^^^^^^^^^^^^^^ help: ALLOC was deallocated here: - --> $DIR/dealloc_read_race2.rs:LL:CC + --> tests/fail/data_race/dealloc_read_race2.rs:LL:CC | LL | / __rust_dealloc( LL | | ptr.0 as *mut _, @@ -21,7 +21,7 @@ LL | | std::mem::align_of::(), LL | | ) | |_____________^ = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at $DIR/dealloc_read_race2.rs:LL:CC + = note: inside closure at tests/fail/data_race/dealloc_read_race2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/dealloc_read_race_stack.stderr b/src/tools/miri/tests/fail/data_race/dealloc_read_race_stack.stderr index e36376d0c75b2..ce9719b1d4632 100644 --- a/src/tools/miri/tests/fail/data_race/dealloc_read_race_stack.stderr +++ b/src/tools/miri/tests/fail/data_race/dealloc_read_race_stack.stderr @@ -1,18 +1,18 @@ error: Undefined Behavior: Data race detected between (1) non-atomic read on thread `unnamed-ID` and (2) deallocation on thread `unnamed-ID` at ALLOC. (2) just happened here - --> $DIR/dealloc_read_race_stack.rs:LL:CC + --> tests/fail/data_race/dealloc_read_race_stack.rs:LL:CC | LL | } | ^ Data race detected between (1) non-atomic read on thread `unnamed-ID` and (2) deallocation on thread `unnamed-ID` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/dealloc_read_race_stack.rs:LL:CC + --> tests/fail/data_race/dealloc_read_race_stack.rs:LL:CC | LL | *pointer.load(Ordering::Acquire) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at $DIR/dealloc_read_race_stack.rs:LL:CC + = note: inside closure at tests/fail/data_race/dealloc_read_race_stack.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/dealloc_write_race1.stderr b/src/tools/miri/tests/fail/data_race/dealloc_write_race1.stderr index 0c6cd9bbd932e..48d974241aada 100644 --- a/src/tools/miri/tests/fail/data_race/dealloc_write_race1.stderr +++ b/src/tools/miri/tests/fail/data_race/dealloc_write_race1.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) deallocation on thread `unnamed-ID` at ALLOC. (2) just happened here - --> $DIR/dealloc_write_race1.rs:LL:CC + --> tests/fail/data_race/dealloc_write_race1.rs:LL:CC | LL | / __rust_dealloc( LL | | @@ -10,14 +10,14 @@ LL | | ); | |_____________^ Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) deallocation on thread `unnamed-ID` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/dealloc_write_race1.rs:LL:CC + --> tests/fail/data_race/dealloc_write_race1.rs:LL:CC | LL | *ptr.0 = 2; | ^^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at $DIR/dealloc_write_race1.rs:LL:CC + = note: inside closure at tests/fail/data_race/dealloc_write_race1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/dealloc_write_race2.stderr b/src/tools/miri/tests/fail/data_race/dealloc_write_race2.stderr index 3009373531356..077d458826623 100644 --- a/src/tools/miri/tests/fail/data_race/dealloc_write_race2.stderr +++ b/src/tools/miri/tests/fail/data_race/dealloc_write_race2.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: memory access failed: ALLOC has been freed, so this pointer is dangling - --> $DIR/dealloc_write_race2.rs:LL:CC + --> tests/fail/data_race/dealloc_write_race2.rs:LL:CC | LL | *ptr.0 = 2; | ^^^^^^^^^^ memory access failed: ALLOC has been freed, so this pointer is dangling @@ -7,12 +7,12 @@ LL | *ptr.0 = 2; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information help: ALLOC was allocated here: - --> $DIR/dealloc_write_race2.rs:LL:CC + --> tests/fail/data_race/dealloc_write_race2.rs:LL:CC | LL | let pointer: *mut usize = Box::into_raw(Box::new(0usize)); | ^^^^^^^^^^^^^^^^ help: ALLOC was deallocated here: - --> $DIR/dealloc_write_race2.rs:LL:CC + --> tests/fail/data_race/dealloc_write_race2.rs:LL:CC | LL | / __rust_dealloc( LL | | ptr.0 as *mut _, @@ -21,7 +21,7 @@ LL | | std::mem::align_of::(), LL | | ); | |_____________^ = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at $DIR/dealloc_write_race2.rs:LL:CC + = note: inside closure at tests/fail/data_race/dealloc_write_race2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/dealloc_write_race_stack.stderr b/src/tools/miri/tests/fail/data_race/dealloc_write_race_stack.stderr index 4c16162fa1f16..2b531b6440c43 100644 --- a/src/tools/miri/tests/fail/data_race/dealloc_write_race_stack.stderr +++ b/src/tools/miri/tests/fail/data_race/dealloc_write_race_stack.stderr @@ -1,18 +1,18 @@ error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) deallocation on thread `unnamed-ID` at ALLOC. (2) just happened here - --> $DIR/dealloc_write_race_stack.rs:LL:CC + --> tests/fail/data_race/dealloc_write_race_stack.rs:LL:CC | LL | } | ^ Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) deallocation on thread `unnamed-ID` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/dealloc_write_race_stack.rs:LL:CC + --> tests/fail/data_race/dealloc_write_race_stack.rs:LL:CC | LL | *pointer.load(Ordering::Acquire) = 3; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at $DIR/dealloc_write_race_stack.rs:LL:CC + = note: inside closure at tests/fail/data_race/dealloc_write_race_stack.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/enable_after_join_to_main.stderr b/src/tools/miri/tests/fail/data_race/enable_after_join_to_main.stderr index 686d9b48e5312..5d5d1c8cc6861 100644 --- a/src/tools/miri/tests/fail/data_race/enable_after_join_to_main.stderr +++ b/src/tools/miri/tests/fail/data_race/enable_after_join_to_main.stderr @@ -1,18 +1,18 @@ error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here - --> $DIR/enable_after_join_to_main.rs:LL:CC + --> tests/fail/data_race/enable_after_join_to_main.rs:LL:CC | LL | *c.0 = 64; | ^^^^^^^^^ Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/enable_after_join_to_main.rs:LL:CC + --> tests/fail/data_race/enable_after_join_to_main.rs:LL:CC | LL | *c.0 = 32; | ^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at $DIR/enable_after_join_to_main.rs:LL:CC + = note: inside closure at tests/fail/data_race/enable_after_join_to_main.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/fence_after_load.stderr b/src/tools/miri/tests/fail/data_race/fence_after_load.stderr index 776cf7c17b95a..03b3c6f8f0b02 100644 --- a/src/tools/miri/tests/fail/data_race/fence_after_load.stderr +++ b/src/tools/miri/tests/fail/data_race/fence_after_load.stderr @@ -1,18 +1,18 @@ error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic write on thread `main` at ALLOC. (2) just happened here - --> $DIR/fence_after_load.rs:LL:CC + --> tests/fail/data_race/fence_after_load.rs:LL:CC | LL | unsafe { V = 2 } | ^^^^^ Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic write on thread `main` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/fence_after_load.rs:LL:CC + --> tests/fail/data_race/fence_after_load.rs:LL:CC | LL | unsafe { V = 1 } | ^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/fence_after_load.rs:LL:CC + = note: inside `main` at tests/fail/data_race/fence_after_load.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/local_variable_alloc_race.stderr b/src/tools/miri/tests/fail/data_race/local_variable_alloc_race.stderr index f46eb078a5189..51a4c5cea30d5 100644 --- a/src/tools/miri/tests/fail/data_race/local_variable_alloc_race.stderr +++ b/src/tools/miri/tests/fail/data_race/local_variable_alloc_race.stderr @@ -1,18 +1,18 @@ error: Undefined Behavior: Data race detected between (1) creating a new allocation on thread `main` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here - --> $DIR/local_variable_alloc_race.rs:LL:CC + --> tests/fail/data_race/local_variable_alloc_race.rs:LL:CC | LL | *ptr = 127; | ^^^^^^^^^^ Data race detected between (1) creating a new allocation on thread `main` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/local_variable_alloc_race.rs:LL:CC + --> tests/fail/data_race/local_variable_alloc_race.rs:LL:CC | LL | StorageLive(val); | ^^^^^^^^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at $DIR/local_variable_alloc_race.rs:LL:CC + = note: inside closure at tests/fail/data_race/local_variable_alloc_race.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/local_variable_read_race.rs b/src/tools/miri/tests/fail/data_race/local_variable_read_race.rs index 80d2b7b7c12bd..16a23f595ee47 100644 --- a/src/tools/miri/tests/fail/data_race/local_variable_read_race.rs +++ b/src/tools/miri/tests/fail/data_race/local_variable_read_race.rs @@ -29,7 +29,7 @@ fn main() { // when it actually happened), we'd miss the UB in this test. // Also, the UB error should point at the write above, not the addr-of here. P.store(std::ptr::addr_of_mut!(val), Relaxed); - + // Wait for the thread to be done. t1.join().unwrap(); diff --git a/src/tools/miri/tests/fail/data_race/local_variable_read_race.stderr b/src/tools/miri/tests/fail/data_race/local_variable_read_race.stderr index d14c2fb47ffc8..3faffd4131e31 100644 --- a/src/tools/miri/tests/fail/data_race/local_variable_read_race.stderr +++ b/src/tools/miri/tests/fail/data_race/local_variable_read_race.stderr @@ -1,18 +1,18 @@ error: Undefined Behavior: Data race detected between (1) non-atomic read on thread `main` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here - --> $DIR/local_variable_read_race.rs:LL:CC + --> tests/fail/data_race/local_variable_read_race.rs:LL:CC | LL | *ptr = 127; | ^^^^^^^^^^ Data race detected between (1) non-atomic read on thread `main` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/local_variable_read_race.rs:LL:CC + --> tests/fail/data_race/local_variable_read_race.rs:LL:CC | LL | let _val = val; | ^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at $DIR/local_variable_read_race.rs:LL:CC + = note: inside closure at tests/fail/data_race/local_variable_read_race.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/local_variable_write_race.rs b/src/tools/miri/tests/fail/data_race/local_variable_write_race.rs index eabbe4403c676..7e00573146c25 100644 --- a/src/tools/miri/tests/fail/data_race/local_variable_write_race.rs +++ b/src/tools/miri/tests/fail/data_race/local_variable_write_race.rs @@ -28,7 +28,7 @@ fn main() { // when it actually happened), we'd miss the UB in this test. // Also, the UB error should point at the write above, not the addr-of here. P.store(std::ptr::addr_of_mut!(val), Relaxed); - + // Wait for the thread to be done. t1.join().unwrap(); diff --git a/src/tools/miri/tests/fail/data_race/local_variable_write_race.stderr b/src/tools/miri/tests/fail/data_race/local_variable_write_race.stderr index d84db955a3d78..24bbe227f9e83 100644 --- a/src/tools/miri/tests/fail/data_race/local_variable_write_race.stderr +++ b/src/tools/miri/tests/fail/data_race/local_variable_write_race.stderr @@ -1,18 +1,18 @@ error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `main` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here - --> $DIR/local_variable_write_race.rs:LL:CC + --> tests/fail/data_race/local_variable_write_race.rs:LL:CC | LL | *ptr = 127; | ^^^^^^^^^^ Data race detected between (1) non-atomic write on thread `main` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/local_variable_write_race.rs:LL:CC + --> tests/fail/data_race/local_variable_write_race.rs:LL:CC | LL | let mut val: u8 = 0; | ^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at $DIR/local_variable_write_race.rs:LL:CC + = note: inside closure at tests/fail/data_race/local_variable_write_race.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/mixed_size_read.stderr b/src/tools/miri/tests/fail/data_race/mixed_size_read.stderr index 5b25c666f4199..31a798a89b133 100644 --- a/src/tools/miri/tests/fail/data_race/mixed_size_read.stderr +++ b/src/tools/miri/tests/fail/data_race/mixed_size_read.stderr @@ -1,11 +1,11 @@ error: Undefined Behavior: Race condition detected between (1) 2-byte atomic load on thread `unnamed-ID` and (2) 1-byte atomic load on thread `unnamed-ID` at ALLOC. (2) just happened here - --> $DIR/mixed_size_read.rs:LL:CC + --> tests/fail/data_race/mixed_size_read.rs:LL:CC | LL | a8[0].load(Ordering::SeqCst); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Race condition detected between (1) 2-byte atomic load on thread `unnamed-ID` and (2) 1-byte atomic load on thread `unnamed-ID` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/mixed_size_read.rs:LL:CC + --> tests/fail/data_race/mixed_size_read.rs:LL:CC | LL | a16.load(Ordering::SeqCst); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -14,7 +14,7 @@ LL | a16.load(Ordering::SeqCst); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at $DIR/mixed_size_read.rs:LL:CC + = note: inside closure at tests/fail/data_race/mixed_size_read.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/mixed_size_write.stderr b/src/tools/miri/tests/fail/data_race/mixed_size_write.stderr index c6157b87b387c..c30b48c1f32b0 100644 --- a/src/tools/miri/tests/fail/data_race/mixed_size_write.stderr +++ b/src/tools/miri/tests/fail/data_race/mixed_size_write.stderr @@ -1,11 +1,11 @@ error: Undefined Behavior: Race condition detected between (1) 2-byte atomic store on thread `unnamed-ID` and (2) 1-byte atomic store on thread `unnamed-ID` at ALLOC. (2) just happened here - --> $DIR/mixed_size_write.rs:LL:CC + --> tests/fail/data_race/mixed_size_write.rs:LL:CC | LL | a8[0].store(1, Ordering::SeqCst); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Race condition detected between (1) 2-byte atomic store on thread `unnamed-ID` and (2) 1-byte atomic store on thread `unnamed-ID` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/mixed_size_write.rs:LL:CC + --> tests/fail/data_race/mixed_size_write.rs:LL:CC | LL | a16.store(1, Ordering::SeqCst); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -14,7 +14,7 @@ LL | a16.store(1, Ordering::SeqCst); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at $DIR/mixed_size_write.rs:LL:CC + = note: inside closure at tests/fail/data_race/mixed_size_write.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/read_read_race1.stderr b/src/tools/miri/tests/fail/data_race/read_read_race1.stderr index 37ef46335d414..e97c4a4fdcb37 100644 --- a/src/tools/miri/tests/fail/data_race/read_read_race1.stderr +++ b/src/tools/miri/tests/fail/data_race/read_read_race1.stderr @@ -1,11 +1,11 @@ error: Undefined Behavior: Data race detected between (1) non-atomic read on thread `unnamed-ID` and (2) atomic load on thread `unnamed-ID` at ALLOC. (2) just happened here - --> $DIR/read_read_race1.rs:LL:CC + --> tests/fail/data_race/read_read_race1.rs:LL:CC | LL | a.load(Ordering::SeqCst); | ^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) non-atomic read on thread `unnamed-ID` and (2) atomic load on thread `unnamed-ID` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/read_read_race1.rs:LL:CC + --> tests/fail/data_race/read_read_race1.rs:LL:CC | LL | unsafe { ptr.read() }; | ^^^^^^^^^^ @@ -14,7 +14,7 @@ LL | unsafe { ptr.read() }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at $DIR/read_read_race1.rs:LL:CC + = note: inside closure at tests/fail/data_race/read_read_race1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/read_read_race2.stderr b/src/tools/miri/tests/fail/data_race/read_read_race2.stderr index e0cabf62a2504..d64032db7b32c 100644 --- a/src/tools/miri/tests/fail/data_race/read_read_race2.stderr +++ b/src/tools/miri/tests/fail/data_race/read_read_race2.stderr @@ -1,11 +1,11 @@ error: Undefined Behavior: Data race detected between (1) atomic load on thread `unnamed-ID` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here - --> $DIR/read_read_race2.rs:LL:CC + --> tests/fail/data_race/read_read_race2.rs:LL:CC | LL | unsafe { ptr.read() }; | ^^^^^^^^^^ Data race detected between (1) atomic load on thread `unnamed-ID` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/read_read_race2.rs:LL:CC + --> tests/fail/data_race/read_read_race2.rs:LL:CC | LL | a.load(Ordering::SeqCst); | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -14,7 +14,7 @@ LL | a.load(Ordering::SeqCst); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at $DIR/read_read_race2.rs:LL:CC + = note: inside closure at tests/fail/data_race/read_read_race2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/read_write_race.stderr b/src/tools/miri/tests/fail/data_race/read_write_race.stderr index 8558db4bfdc8c..eac5a0c8a6cbe 100644 --- a/src/tools/miri/tests/fail/data_race/read_write_race.stderr +++ b/src/tools/miri/tests/fail/data_race/read_write_race.stderr @@ -1,18 +1,18 @@ error: Undefined Behavior: Data race detected between (1) non-atomic read on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here - --> $DIR/read_write_race.rs:LL:CC + --> tests/fail/data_race/read_write_race.rs:LL:CC | LL | *c.0 = 64; | ^^^^^^^^^ Data race detected between (1) non-atomic read on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/read_write_race.rs:LL:CC + --> tests/fail/data_race/read_write_race.rs:LL:CC | LL | let _val = *c.0; | ^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at $DIR/read_write_race.rs:LL:CC + = note: inside closure at tests/fail/data_race/read_write_race.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/read_write_race_stack.stderr b/src/tools/miri/tests/fail/data_race/read_write_race_stack.stderr index 7ca249a917b27..9af78bc79a300 100644 --- a/src/tools/miri/tests/fail/data_race/read_write_race_stack.stderr +++ b/src/tools/miri/tests/fail/data_race/read_write_race_stack.stderr @@ -1,18 +1,18 @@ error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here - --> $DIR/read_write_race_stack.rs:LL:CC + --> tests/fail/data_race/read_write_race_stack.rs:LL:CC | LL | stack_var | ^^^^^^^^^ Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/read_write_race_stack.rs:LL:CC + --> tests/fail/data_race/read_write_race_stack.rs:LL:CC | LL | *pointer.load(Ordering::Acquire) = 3; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at $DIR/read_write_race_stack.rs:LL:CC + = note: inside closure at tests/fail/data_race/read_write_race_stack.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/relax_acquire_race.stderr b/src/tools/miri/tests/fail/data_race/relax_acquire_race.stderr index b5e6895302f30..a358d8da364e5 100644 --- a/src/tools/miri/tests/fail/data_race/relax_acquire_race.stderr +++ b/src/tools/miri/tests/fail/data_race/relax_acquire_race.stderr @@ -1,18 +1,18 @@ error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here - --> $DIR/relax_acquire_race.rs:LL:CC + --> tests/fail/data_race/relax_acquire_race.rs:LL:CC | LL | *c.0 | ^^^^ Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/relax_acquire_race.rs:LL:CC + --> tests/fail/data_race/relax_acquire_race.rs:LL:CC | LL | *c.0 = 1; | ^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at $DIR/relax_acquire_race.rs:LL:CC + = note: inside closure at tests/fail/data_race/relax_acquire_race.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/release_seq_race.stderr b/src/tools/miri/tests/fail/data_race/release_seq_race.stderr index e031c55ecb17f..f47e463dd6322 100644 --- a/src/tools/miri/tests/fail/data_race/release_seq_race.stderr +++ b/src/tools/miri/tests/fail/data_race/release_seq_race.stderr @@ -1,18 +1,18 @@ error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here - --> $DIR/release_seq_race.rs:LL:CC + --> tests/fail/data_race/release_seq_race.rs:LL:CC | LL | *c.0 | ^^^^ Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/release_seq_race.rs:LL:CC + --> tests/fail/data_race/release_seq_race.rs:LL:CC | LL | *c.0 = 1; | ^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at $DIR/release_seq_race.rs:LL:CC + = note: inside closure at tests/fail/data_race/release_seq_race.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/release_seq_race_same_thread.stderr b/src/tools/miri/tests/fail/data_race/release_seq_race_same_thread.stderr index 86183e1e43f7a..2d26d4cf68a26 100644 --- a/src/tools/miri/tests/fail/data_race/release_seq_race_same_thread.stderr +++ b/src/tools/miri/tests/fail/data_race/release_seq_race_same_thread.stderr @@ -1,18 +1,18 @@ error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here - --> $DIR/release_seq_race_same_thread.rs:LL:CC + --> tests/fail/data_race/release_seq_race_same_thread.rs:LL:CC | LL | *c.0 | ^^^^ Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/release_seq_race_same_thread.rs:LL:CC + --> tests/fail/data_race/release_seq_race_same_thread.rs:LL:CC | LL | *c.0 = 1; | ^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at $DIR/release_seq_race_same_thread.rs:LL:CC + = note: inside closure at tests/fail/data_race/release_seq_race_same_thread.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/rmw_race.stderr b/src/tools/miri/tests/fail/data_race/rmw_race.stderr index 2aa27cc8c7f2e..4a991db32d610 100644 --- a/src/tools/miri/tests/fail/data_race/rmw_race.stderr +++ b/src/tools/miri/tests/fail/data_race/rmw_race.stderr @@ -1,18 +1,18 @@ error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here - --> $DIR/rmw_race.rs:LL:CC + --> tests/fail/data_race/rmw_race.rs:LL:CC | LL | *c.0 | ^^^^ Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/rmw_race.rs:LL:CC + --> tests/fail/data_race/rmw_race.rs:LL:CC | LL | *c.0 = 1; | ^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at $DIR/rmw_race.rs:LL:CC + = note: inside closure at tests/fail/data_race/rmw_race.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/stack_pop_race.stderr b/src/tools/miri/tests/fail/data_race/stack_pop_race.stderr index 683acc1abd252..643426aba99eb 100644 --- a/src/tools/miri/tests/fail/data_race/stack_pop_race.stderr +++ b/src/tools/miri/tests/fail/data_race/stack_pop_race.stderr @@ -1,20 +1,20 @@ error: Undefined Behavior: Data race detected between (1) non-atomic read on thread `unnamed-ID` and (2) deallocation on thread `main` at ALLOC. (2) just happened here - --> $DIR/stack_pop_race.rs:LL:CC + --> tests/fail/data_race/stack_pop_race.rs:LL:CC | LL | } | ^ Data race detected between (1) non-atomic read on thread `unnamed-ID` and (2) deallocation on thread `main` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/stack_pop_race.rs:LL:CC + --> tests/fail/data_race/stack_pop_race.rs:LL:CC | LL | let _val = unsafe { *ptr.0 }; | ^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span): - = note: inside `race` at $DIR/stack_pop_race.rs:LL:CC + = note: inside `race` at tests/fail/data_race/stack_pop_race.rs:LL:CC note: inside `main` - --> $DIR/stack_pop_race.rs:LL:CC + --> tests/fail/data_race/stack_pop_race.rs:LL:CC | LL | race(0); | ^^^^^^^ diff --git a/src/tools/miri/tests/fail/data_race/write_write_race.stderr b/src/tools/miri/tests/fail/data_race/write_write_race.stderr index 37b758ab2a5cd..2ea54421b89c7 100644 --- a/src/tools/miri/tests/fail/data_race/write_write_race.stderr +++ b/src/tools/miri/tests/fail/data_race/write_write_race.stderr @@ -1,18 +1,18 @@ error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here - --> $DIR/write_write_race.rs:LL:CC + --> tests/fail/data_race/write_write_race.rs:LL:CC | LL | *c.0 = 64; | ^^^^^^^^^ Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/write_write_race.rs:LL:CC + --> tests/fail/data_race/write_write_race.rs:LL:CC | LL | *c.0 = 32; | ^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at $DIR/write_write_race.rs:LL:CC + = note: inside closure at tests/fail/data_race/write_write_race.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/write_write_race_stack.stderr b/src/tools/miri/tests/fail/data_race/write_write_race_stack.stderr index 2503a4f4ba870..0cd9de1131808 100644 --- a/src/tools/miri/tests/fail/data_race/write_write_race_stack.stderr +++ b/src/tools/miri/tests/fail/data_race/write_write_race_stack.stderr @@ -1,18 +1,18 @@ error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here - --> $DIR/write_write_race_stack.rs:LL:CC + --> tests/fail/data_race/write_write_race_stack.rs:LL:CC | LL | stack_var = 1usize; | ^^^^^^^^^^^^^^^^^^ Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/write_write_race_stack.rs:LL:CC + --> tests/fail/data_race/write_write_race_stack.rs:LL:CC | LL | *pointer.load(Ordering::Acquire) = 3; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at $DIR/write_write_race_stack.rs:LL:CC + = note: inside closure at tests/fail/data_race/write_write_race_stack.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/deny_lint.stderr b/src/tools/miri/tests/fail/deny_lint.stderr index d1c9b4818071a..fe96edf934612 100644 --- a/src/tools/miri/tests/fail/deny_lint.stderr +++ b/src/tools/miri/tests/fail/deny_lint.stderr @@ -1,11 +1,11 @@ error: struct `Foo` is never constructed - --> $DIR/deny_lint.rs:LL:CC + --> tests/fail/deny_lint.rs:LL:CC | LL | struct Foo; | ^^^ | note: the lint level is defined here - --> $DIR/deny_lint.rs:LL:CC + --> tests/fail/deny_lint.rs:LL:CC | LL | #![deny(warnings, unused)] | ^^^^^^ diff --git a/src/tools/miri/tests/fail/dyn-call-trait-mismatch.stderr b/src/tools/miri/tests/fail/dyn-call-trait-mismatch.stderr index 019a55bcdcb1a..3680a84fac271 100644 --- a/src/tools/miri/tests/fail/dyn-call-trait-mismatch.stderr +++ b/src/tools/miri/tests/fail/dyn-call-trait-mismatch.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: using vtable for trait `T1` but trait `T2` was expected - --> $DIR/dyn-call-trait-mismatch.rs:LL:CC + --> tests/fail/dyn-call-trait-mismatch.rs:LL:CC | LL | r2.method2(); | ^^^^^^^^^^^^ using vtable for trait `T1` but trait `T2` was expected @@ -7,7 +7,7 @@ LL | r2.method2(); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/dyn-call-trait-mismatch.rs:LL:CC + = note: inside `main` at tests/fail/dyn-call-trait-mismatch.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/dyn-upcast-nop-wrong-trait.stderr b/src/tools/miri/tests/fail/dyn-upcast-nop-wrong-trait.stderr index 4165d5ea15d97..54d9d385e9623 100644 --- a/src/tools/miri/tests/fail/dyn-upcast-nop-wrong-trait.stderr +++ b/src/tools/miri/tests/fail/dyn-upcast-nop-wrong-trait.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value: wrong trait in wide pointer vtable: expected `std::fmt::Debug + std::marker::Send + std::marker::Sync`, but encountered `std::fmt::Display` - --> $DIR/dyn-upcast-nop-wrong-trait.rs:LL:CC + --> tests/fail/dyn-upcast-nop-wrong-trait.rs:LL:CC | LL | let ptr: *const (dyn fmt::Debug + Send + Sync) = unsafe { std::mem::transmute(ptr) }; | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: wrong trait in wide pointer vtable: expected `std::fmt::Debug + std::marker::Send + std::marker::Sync`, but encountered `std::fmt::Display` @@ -7,7 +7,7 @@ LL | let ptr: *const (dyn fmt::Debug + Send + Sync) = unsafe { std::mem::tra = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/dyn-upcast-nop-wrong-trait.rs:LL:CC + = note: inside `main` at tests/fail/dyn-upcast-nop-wrong-trait.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/dyn-upcast-trait-mismatch.stderr b/src/tools/miri/tests/fail/dyn-upcast-trait-mismatch.stderr index 87b1361c3e504..2129fe66e9c02 100644 --- a/src/tools/miri/tests/fail/dyn-upcast-trait-mismatch.stderr +++ b/src/tools/miri/tests/fail/dyn-upcast-trait-mismatch.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: using vtable for trait `Baz` but trait `Bar` was expected - --> $DIR/dyn-upcast-trait-mismatch.rs:LL:CC + --> tests/fail/dyn-upcast-trait-mismatch.rs:LL:CC | LL | let _err = baz_fake as *const dyn Foo; | ^^^^^^^^ using vtable for trait `Baz` but trait `Bar` was expected @@ -7,7 +7,7 @@ LL | let _err = baz_fake as *const dyn Foo; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/dyn-upcast-trait-mismatch.rs:LL:CC + = note: inside `main` at tests/fail/dyn-upcast-trait-mismatch.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/enum-set-discriminant-niche-variant-wrong.stderr b/src/tools/miri/tests/fail/enum-set-discriminant-niche-variant-wrong.stderr index a48a0a993daa1..4e2b9c03eae19 100644 --- a/src/tools/miri/tests/fail/enum-set-discriminant-niche-variant-wrong.stderr +++ b/src/tools/miri/tests/fail/enum-set-discriminant-niche-variant-wrong.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: trying to set discriminant of a Option> to the niched variant, but the value does not match - --> $DIR/enum-set-discriminant-niche-variant-wrong.rs:LL:CC + --> tests/fail/enum-set-discriminant-niche-variant-wrong.rs:LL:CC | LL | SetDiscriminant(*ptr, 1); | ^^^^^^^^^^^^^^^^^^^^^^^^ trying to set discriminant of a Option> to the niched variant, but the value does not match @@ -7,9 +7,9 @@ LL | SetDiscriminant(*ptr, 1); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `set_discriminant` at $DIR/enum-set-discriminant-niche-variant-wrong.rs:LL:CC + = note: inside `set_discriminant` at tests/fail/enum-set-discriminant-niche-variant-wrong.rs:LL:CC note: inside `main` - --> $DIR/enum-set-discriminant-niche-variant-wrong.rs:LL:CC + --> tests/fail/enum-set-discriminant-niche-variant-wrong.rs:LL:CC | LL | set_discriminant(&mut v); | ^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/environ-gets-deallocated.rs b/src/tools/miri/tests/fail/environ-gets-deallocated.rs index 5391a9176d0dd..84618abc6dbba 100644 --- a/src/tools/miri/tests/fail/environ-gets-deallocated.rs +++ b/src/tools/miri/tests/fail/environ-gets-deallocated.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: Windows does not have a global environ list that the program can access directly +//@ignore-target: windows # Windows does not have a global environ list that the program can access directly fn get_environ() -> *const *const u8 { extern "C" { diff --git a/src/tools/miri/tests/fail/environ-gets-deallocated.stderr b/src/tools/miri/tests/fail/environ-gets-deallocated.stderr index c9bda00493e06..bb3fe1cec73df 100644 --- a/src/tools/miri/tests/fail/environ-gets-deallocated.stderr +++ b/src/tools/miri/tests/fail/environ-gets-deallocated.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: memory access failed: ALLOC has been freed, so this pointer is dangling - --> $DIR/environ-gets-deallocated.rs:LL:CC + --> tests/fail/environ-gets-deallocated.rs:LL:CC | LL | let _y = unsafe { *pointer }; | ^^^^^^^^ memory access failed: ALLOC has been freed, so this pointer is dangling @@ -7,7 +7,7 @@ LL | let _y = unsafe { *pointer }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/environ-gets-deallocated.rs:LL:CC + = note: inside `main` at tests/fail/environ-gets-deallocated.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/erroneous_const.stderr b/src/tools/miri/tests/fail/erroneous_const.stderr index ab036247a314b..3528620cb6a83 100644 --- a/src/tools/miri/tests/fail/erroneous_const.stderr +++ b/src/tools/miri/tests/fail/erroneous_const.stderr @@ -1,13 +1,13 @@ error[E0080]: evaluation of `PrintName::::VOID` failed - --> $DIR/erroneous_const.rs:LL:CC + --> tests/fail/erroneous_const.rs:LL:CC | LL | const VOID: ! = panic!(); - | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/erroneous_const.rs:LL:CC + | ^^^^^^^^ the evaluated program panicked at 'explicit panic', tests/fail/erroneous_const.rs:LL:CC | = note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) note: erroneous constant encountered - --> $DIR/erroneous_const.rs:LL:CC + --> tests/fail/erroneous_const.rs:LL:CC | LL | let _ = PrintName::::VOID; | ^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/erroneous_const2.stderr b/src/tools/miri/tests/fail/erroneous_const2.stderr index 2227436707482..76f8cbcd2893c 100644 --- a/src/tools/miri/tests/fail/erroneous_const2.stderr +++ b/src/tools/miri/tests/fail/erroneous_const2.stderr @@ -1,17 +1,17 @@ error[E0080]: evaluation of constant value failed - --> $DIR/erroneous_const2.rs:LL:CC + --> tests/fail/erroneous_const2.rs:LL:CC | LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize]; | ^^^^^ attempt to compute `5_u32 - 6_u32`, which would overflow note: erroneous constant encountered - --> $DIR/erroneous_const2.rs:LL:CC + --> tests/fail/erroneous_const2.rs:LL:CC | LL | println!("{}", FOO); | ^^^ note: erroneous constant encountered - --> $DIR/erroneous_const2.rs:LL:CC + --> tests/fail/erroneous_const2.rs:LL:CC | LL | println!("{}", FOO); | ^^^ @@ -19,7 +19,7 @@ LL | println!("{}", FOO); = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` note: erroneous constant encountered - --> $DIR/erroneous_const2.rs:LL:CC + --> tests/fail/erroneous_const2.rs:LL:CC | LL | println!("{}", FOO); | ^^^ diff --git a/src/tools/miri/tests/fail/extern-type-field-offset.stderr b/src/tools/miri/tests/fail/extern-type-field-offset.stderr index c07b63e0c0384..1ed440c7a33b2 100644 --- a/src/tools/miri/tests/fail/extern-type-field-offset.stderr +++ b/src/tools/miri/tests/fail/extern-type-field-offset.stderr @@ -1,5 +1,5 @@ warning: reborrow of reference to `extern type` - --> $DIR/extern-type-field-offset.rs:LL:CC + --> tests/fail/extern-type-field-offset.rs:LL:CC | LL | let x: &Newtype = unsafe { &*(&buf as *const _ as *const Newtype) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ reborrow of a reference to `extern type` is not properly supported @@ -7,17 +7,17 @@ LL | let x: &Newtype = unsafe { &*(&buf as *const _ as *const Newtype) }; = help: `extern type` are not compatible with the Stacked Borrows aliasing model implemented by Miri; Miri may miss bugs in this code = help: try running with `MIRIFLAGS=-Zmiri-tree-borrows` to use the more permissive but also even more experimental Tree Borrows aliasing checks instead = note: BACKTRACE: - = note: inside `main` at $DIR/extern-type-field-offset.rs:LL:CC + = note: inside `main` at tests/fail/extern-type-field-offset.rs:LL:CC error: unsupported operation: `extern type` field does not have a known offset - --> $DIR/extern-type-field-offset.rs:LL:CC + --> tests/fail/extern-type-field-offset.rs:LL:CC | LL | let _field = &x.a; | ^^^^ `extern type` field does not have a known offset | = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support = note: BACKTRACE: - = note: inside `main` at $DIR/extern-type-field-offset.rs:LL:CC + = note: inside `main` at tests/fail/extern-type-field-offset.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/extern_static.stderr b/src/tools/miri/tests/fail/extern_static.stderr index c7ab128e2fe97..c0bedbbcbf957 100644 --- a/src/tools/miri/tests/fail/extern_static.stderr +++ b/src/tools/miri/tests/fail/extern_static.stderr @@ -1,12 +1,12 @@ error: unsupported operation: extern static `FOO` is not supported by Miri - --> $DIR/extern_static.rs:LL:CC + --> tests/fail/extern_static.rs:LL:CC | LL | let _val = std::ptr::addr_of!(FOO); | ^^^ extern static `FOO` is not supported by Miri | = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support = note: BACKTRACE: - = note: inside `main` at $DIR/extern_static.rs:LL:CC + = note: inside `main` at tests/fail/extern_static.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/extern_static_in_const.stderr b/src/tools/miri/tests/fail/extern_static_in_const.stderr index aa524c064694e..067a2a2b643ba 100644 --- a/src/tools/miri/tests/fail/extern_static_in_const.stderr +++ b/src/tools/miri/tests/fail/extern_static_in_const.stderr @@ -1,12 +1,12 @@ error: unsupported operation: extern static `E` is not supported by Miri - --> $DIR/extern_static_in_const.rs:LL:CC + --> tests/fail/extern_static_in_const.rs:LL:CC | LL | let _val = X; | ^ extern static `E` is not supported by Miri | = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support = note: BACKTRACE: - = note: inside `main` at $DIR/extern_static_in_const.rs:LL:CC + = note: inside `main` at tests/fail/extern_static_in_const.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/extern_static_wrong_size.rs b/src/tools/miri/tests/fail/extern_static_wrong_size.rs index fee3c38c25e5e..56c3ddd351612 100644 --- a/src/tools/miri/tests/fail/extern_static_wrong_size.rs +++ b/src/tools/miri/tests/fail/extern_static_wrong_size.rs @@ -1,4 +1,4 @@ -//@ only-target-linux: we need a specific extern supported on this target +//@only-target: linux # we need a specific extern supported on this target //@normalize-stderr-test: "[48] bytes" -> "N bytes" extern "C" { diff --git a/src/tools/miri/tests/fail/extern_static_wrong_size.stderr b/src/tools/miri/tests/fail/extern_static_wrong_size.stderr index 3c013a5d15d05..1af84e23682d5 100644 --- a/src/tools/miri/tests/fail/extern_static_wrong_size.stderr +++ b/src/tools/miri/tests/fail/extern_static_wrong_size.stderr @@ -1,12 +1,12 @@ error: unsupported operation: extern static `environ` has been declared as `extern_static_wrong_size::environ` with a size of 1 bytes and alignment of 1 bytes, but Miri emulates it via an extern static shim with a size of N bytes and alignment of N bytes - --> $DIR/extern_static_wrong_size.rs:LL:CC + --> tests/fail/extern_static_wrong_size.rs:LL:CC | LL | let _val = unsafe { environ }; | ^^^^^^^ extern static `environ` has been declared as `extern_static_wrong_size::environ` with a size of 1 bytes and alignment of 1 bytes, but Miri emulates it via an extern static shim with a size of N bytes and alignment of N bytes | = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support = note: BACKTRACE: - = note: inside `main` at $DIR/extern_static_wrong_size.rs:LL:CC + = note: inside `main` at tests/fail/extern_static_wrong_size.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.stack.stderr b/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.stack.stderr index 609426bb28916..d9ab782986fbe 100644 --- a/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.stack.stderr +++ b/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.stack.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: not granting access to tag because that would remove [Unique for ] which is strongly protected - --> $DIR/arg_inplace_mutate.rs:LL:CC + --> tests/fail/function_calls/arg_inplace_mutate.rs:LL:CC | LL | unsafe { ptr.write(S(0)) }; | ^^^^^^^^^^^^^^^ not granting access to tag because that would remove [Unique for ] which is strongly protected @@ -7,7 +7,7 @@ LL | unsafe { ptr.write(S(0)) }; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadWrite retag at offsets [0x0..0x4] - --> $DIR/arg_inplace_mutate.rs:LL:CC + --> tests/fail/function_calls/arg_inplace_mutate.rs:LL:CC | LL | / mir! { LL | | let _unit: (); @@ -18,14 +18,14 @@ LL | | } LL | | } | |_____^ help: is this argument - --> $DIR/arg_inplace_mutate.rs:LL:CC + --> tests/fail/function_calls/arg_inplace_mutate.rs:LL:CC | LL | unsafe { ptr.write(S(0)) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `callee` at $DIR/arg_inplace_mutate.rs:LL:CC + = note: inside `callee` at tests/fail/function_calls/arg_inplace_mutate.rs:LL:CC note: inside `main` - --> $DIR/arg_inplace_mutate.rs:LL:CC + --> tests/fail/function_calls/arg_inplace_mutate.rs:LL:CC | LL | Call(_unit = callee(Move(*ptr), ptr), ReturnTo(after_call), UnwindContinue()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.tree.stderr b/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.tree.stderr index c187d24e5e893..677952b39da10 100644 --- a/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.tree.stderr +++ b/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.tree.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: write access through (root of the allocation) at ALLOC[0x0] is forbidden - --> $DIR/arg_inplace_mutate.rs:LL:CC + --> tests/fail/function_calls/arg_inplace_mutate.rs:LL:CC | LL | unsafe { ptr.write(S(0)) }; | ^^^^^^^^^^^^^^^ write access through (root of the allocation) at ALLOC[0x0] is forbidden @@ -9,7 +9,7 @@ LL | unsafe { ptr.write(S(0)) }; = help: this foreign write access would cause the protected tag (currently Active) to become Disabled = help: protected tags must never be Disabled help: the accessed tag was created here - --> $DIR/arg_inplace_mutate.rs:LL:CC + --> tests/fail/function_calls/arg_inplace_mutate.rs:LL:CC | LL | / mir! { LL | | let _unit: (); @@ -20,20 +20,20 @@ LL | | } LL | | } | |_____^ help: the protected tag was created here, in the initial state Reserved - --> $DIR/arg_inplace_mutate.rs:LL:CC + --> tests/fail/function_calls/arg_inplace_mutate.rs:LL:CC | LL | unsafe { ptr.write(S(0)) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: the protected tag later transitioned to Active due to a child write access at offsets [0x0..0x4] - --> $DIR/arg_inplace_mutate.rs:LL:CC + --> tests/fail/function_calls/arg_inplace_mutate.rs:LL:CC | LL | unsafe { ptr.write(S(0)) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: this transition corresponds to the first write to a 2-phase borrowed mutable reference = note: BACKTRACE (of the first span): - = note: inside `callee` at $DIR/arg_inplace_mutate.rs:LL:CC + = note: inside `callee` at tests/fail/function_calls/arg_inplace_mutate.rs:LL:CC note: inside `main` - --> $DIR/arg_inplace_mutate.rs:LL:CC + --> tests/fail/function_calls/arg_inplace_mutate.rs:LL:CC | LL | Call(_unit = callee(Move(*ptr), ptr), ReturnTo(after_call), UnwindContinue()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_after.stderr b/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_after.stderr index 2cd9966bbf59e..7fd71c6084719 100644 --- a/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_after.stderr +++ b/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_after.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory - --> $DIR/arg_inplace_observe_after.rs:LL:CC + --> tests/fail/function_calls/arg_inplace_observe_after.rs:LL:CC | LL | _observe = non_copy.0; | ^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory @@ -7,7 +7,7 @@ LL | _observe = non_copy.0; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/arg_inplace_observe_after.rs:LL:CC + = note: inside `main` at tests/fail/function_calls/arg_inplace_observe_after.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.none.stderr b/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.none.stderr index 1c73577f5cd5d..032bbfa8f18cc 100644 --- a/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.none.stderr +++ b/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.none.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory - --> $DIR/arg_inplace_observe_during.rs:LL:CC + --> tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC | LL | unsafe { ptr.read() }; | ^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory @@ -7,9 +7,9 @@ LL | unsafe { ptr.read() }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `change_arg` at $DIR/arg_inplace_observe_during.rs:LL:CC + = note: inside `change_arg` at tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC note: inside `main` - --> $DIR/arg_inplace_observe_during.rs:LL:CC + --> tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC | LL | Call(_unit = change_arg(Move(*ptr), ptr), ReturnTo(after_call), UnwindContinue()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.stack.stderr b/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.stack.stderr index 68b7c0307c846..efdd6129d7443 100644 --- a/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.stack.stderr +++ b/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.stack.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: not granting access to tag because that would remove [Unique for ] which is strongly protected - --> $DIR/arg_inplace_observe_during.rs:LL:CC + --> tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC | LL | unsafe { ptr.read() }; | ^^^^^^^^^^ not granting access to tag because that would remove [Unique for ] which is strongly protected @@ -7,7 +7,7 @@ LL | unsafe { ptr.read() }; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadWrite retag at offsets [0x0..0x4] - --> $DIR/arg_inplace_observe_during.rs:LL:CC + --> tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC | LL | / mir! { LL | | let _unit: (); @@ -18,14 +18,14 @@ LL | | LL | | } | |_____^ help: is this argument - --> $DIR/arg_inplace_observe_during.rs:LL:CC + --> tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC | LL | x.0 = 0; | ^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `change_arg` at $DIR/arg_inplace_observe_during.rs:LL:CC + = note: inside `change_arg` at tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC note: inside `main` - --> $DIR/arg_inplace_observe_during.rs:LL:CC + --> tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC | LL | Call(_unit = change_arg(Move(*ptr), ptr), ReturnTo(after_call), UnwindContinue()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.tree.stderr b/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.tree.stderr index 64888cce6135c..5746ad1e13d1a 100644 --- a/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.tree.stderr +++ b/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.tree.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: read access through (root of the allocation) at ALLOC[0x0] is forbidden - --> $DIR/arg_inplace_observe_during.rs:LL:CC + --> tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC | LL | unsafe { ptr.read() }; | ^^^^^^^^^^ read access through (root of the allocation) at ALLOC[0x0] is forbidden @@ -9,7 +9,7 @@ LL | unsafe { ptr.read() }; = help: this foreign read access would cause the protected tag (currently Active) to become Disabled = help: protected tags must never be Disabled help: the accessed tag was created here - --> $DIR/arg_inplace_observe_during.rs:LL:CC + --> tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC | LL | / mir! { LL | | let _unit: (); @@ -20,20 +20,20 @@ LL | | LL | | } | |_____^ help: the protected tag was created here, in the initial state Reserved - --> $DIR/arg_inplace_observe_during.rs:LL:CC + --> tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC | LL | x.0 = 0; | ^^^^^^^ help: the protected tag later transitioned to Active due to a child write access at offsets [0x0..0x4] - --> $DIR/arg_inplace_observe_during.rs:LL:CC + --> tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC | LL | x.0 = 0; | ^^^^^^^ = help: this transition corresponds to the first write to a 2-phase borrowed mutable reference = note: BACKTRACE (of the first span): - = note: inside `change_arg` at $DIR/arg_inplace_observe_during.rs:LL:CC + = note: inside `change_arg` at tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC note: inside `main` - --> $DIR/arg_inplace_observe_during.rs:LL:CC + --> tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC | LL | Call(_unit = change_arg(Move(*ptr), ptr), ReturnTo(after_call), UnwindContinue()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/function_calls/check_arg_abi.stderr b/src/tools/miri/tests/fail/function_calls/check_arg_abi.stderr index 2f24425ed1d64..bf1fbb7721f1f 100644 --- a/src/tools/miri/tests/fail/function_calls/check_arg_abi.stderr +++ b/src/tools/miri/tests/fail/function_calls/check_arg_abi.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: calling a function with ABI C using caller ABI Rust - --> $DIR/check_arg_abi.rs:LL:CC + --> tests/fail/function_calls/check_arg_abi.rs:LL:CC | LL | let _ = malloc(0); | ^^^^^^^^^ calling a function with ABI C using caller ABI Rust @@ -7,7 +7,7 @@ LL | let _ = malloc(0); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/check_arg_abi.rs:LL:CC + = note: inside `main` at tests/fail/function_calls/check_arg_abi.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/check_arg_count_abort.stderr b/src/tools/miri/tests/fail/function_calls/check_arg_count_abort.stderr index d475801f41cd0..687d0538b3c70 100644 --- a/src/tools/miri/tests/fail/function_calls/check_arg_count_abort.stderr +++ b/src/tools/miri/tests/fail/function_calls/check_arg_count_abort.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: incorrect number of arguments: got 1, expected 0 - --> $DIR/check_arg_count_abort.rs:LL:CC + --> tests/fail/function_calls/check_arg_count_abort.rs:LL:CC | LL | abort(1); | ^^^^^^^^ incorrect number of arguments: got 1, expected 0 @@ -7,7 +7,7 @@ LL | abort(1); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/check_arg_count_abort.rs:LL:CC + = note: inside `main` at tests/fail/function_calls/check_arg_count_abort.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/check_arg_count_too_few_args.stderr b/src/tools/miri/tests/fail/function_calls/check_arg_count_too_few_args.stderr index ad952804ecc96..d778eae64fa4b 100644 --- a/src/tools/miri/tests/fail/function_calls/check_arg_count_too_few_args.stderr +++ b/src/tools/miri/tests/fail/function_calls/check_arg_count_too_few_args.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: incorrect number of arguments: got 0, expected 1 - --> $DIR/check_arg_count_too_few_args.rs:LL:CC + --> tests/fail/function_calls/check_arg_count_too_few_args.rs:LL:CC | LL | let _ = malloc(); | ^^^^^^^^ incorrect number of arguments: got 0, expected 1 @@ -7,7 +7,7 @@ LL | let _ = malloc(); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/check_arg_count_too_few_args.rs:LL:CC + = note: inside `main` at tests/fail/function_calls/check_arg_count_too_few_args.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/check_arg_count_too_many_args.stderr b/src/tools/miri/tests/fail/function_calls/check_arg_count_too_many_args.stderr index 3b1df8a9d4202..dfec2a8628706 100644 --- a/src/tools/miri/tests/fail/function_calls/check_arg_count_too_many_args.stderr +++ b/src/tools/miri/tests/fail/function_calls/check_arg_count_too_many_args.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: incorrect number of arguments: got 2, expected 1 - --> $DIR/check_arg_count_too_many_args.rs:LL:CC + --> tests/fail/function_calls/check_arg_count_too_many_args.rs:LL:CC | LL | let _ = malloc(1, 2); | ^^^^^^^^^^^^ incorrect number of arguments: got 2, expected 1 @@ -7,7 +7,7 @@ LL | let _ = malloc(1, 2); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/check_arg_count_too_many_args.rs:LL:CC + = note: inside `main` at tests/fail/function_calls/check_arg_count_too_many_args.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/check_callback_abi.stderr b/src/tools/miri/tests/fail/function_calls/check_callback_abi.stderr index 890fed09e4819..6b0692e1c6e8d 100644 --- a/src/tools/miri/tests/fail/function_calls/check_callback_abi.stderr +++ b/src/tools/miri/tests/fail/function_calls/check_callback_abi.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: calling a function with calling convention C using calling convention Rust - --> $DIR/check_callback_abi.rs:LL:CC + --> tests/fail/function_calls/check_callback_abi.rs:LL:CC | LL | / std::intrinsics::catch_unwind( LL | | @@ -12,7 +12,7 @@ LL | | ); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/check_callback_abi.rs:LL:CC + = note: inside `main` at tests/fail/function_calls/check_callback_abi.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_abi_mismatch.cache.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_abi_mismatch.cache.stderr index 2feba7d8e3480..e4302ad1d3a53 100644 --- a/src/tools/miri/tests/fail/function_calls/exported_symbol_abi_mismatch.cache.stderr +++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_abi_mismatch.cache.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: calling a function with calling convention Rust using calling convention C - --> $DIR/exported_symbol_abi_mismatch.rs:LL:CC + --> tests/fail/function_calls/exported_symbol_abi_mismatch.rs:LL:CC | LL | foo(); | ^^^^^ calling a function with calling convention Rust using calling convention C @@ -7,7 +7,7 @@ LL | foo(); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/exported_symbol_abi_mismatch.rs:LL:CC + = note: inside `main` at tests/fail/function_calls/exported_symbol_abi_mismatch.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_abi_mismatch.fn_ptr.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_abi_mismatch.fn_ptr.stderr index 0537508babd9f..9f40c48b338e3 100644 --- a/src/tools/miri/tests/fail/function_calls/exported_symbol_abi_mismatch.fn_ptr.stderr +++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_abi_mismatch.fn_ptr.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: calling a function with calling convention Rust using calling convention C - --> $DIR/exported_symbol_abi_mismatch.rs:LL:CC + --> tests/fail/function_calls/exported_symbol_abi_mismatch.rs:LL:CC | LL | std::mem::transmute::(foo)(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ calling a function with calling convention Rust using calling convention C @@ -7,7 +7,7 @@ LL | std::mem::transmute::(foo)(); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/exported_symbol_abi_mismatch.rs:LL:CC + = note: inside `main` at tests/fail/function_calls/exported_symbol_abi_mismatch.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_abi_mismatch.no_cache.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_abi_mismatch.no_cache.stderr index 2feba7d8e3480..e4302ad1d3a53 100644 --- a/src/tools/miri/tests/fail/function_calls/exported_symbol_abi_mismatch.no_cache.stderr +++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_abi_mismatch.no_cache.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: calling a function with calling convention Rust using calling convention C - --> $DIR/exported_symbol_abi_mismatch.rs:LL:CC + --> tests/fail/function_calls/exported_symbol_abi_mismatch.rs:LL:CC | LL | foo(); | ^^^^^ calling a function with calling convention Rust using calling convention C @@ -7,7 +7,7 @@ LL | foo(); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/exported_symbol_abi_mismatch.rs:LL:CC + = note: inside `main` at tests/fail/function_calls/exported_symbol_abi_mismatch.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind1.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind1.stderr index a11a2b95689bb..5f306cc8ab1f9 100644 --- a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind1.stderr +++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind1.stderr @@ -1,9 +1,9 @@ -thread 'main' panicked at $DIR/exported_symbol_bad_unwind1.rs:LL:CC: +thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind1.rs:LL:CC: explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect error: Undefined Behavior: unwinding past a stack frame that does not allow unwinding - --> $DIR/exported_symbol_bad_unwind1.rs:LL:CC + --> tests/fail/function_calls/exported_symbol_bad_unwind1.rs:LL:CC | LL | unsafe { unwind() } | ^^^^^^^^ unwinding past a stack frame that does not allow unwinding @@ -11,7 +11,7 @@ LL | unsafe { unwind() } = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/exported_symbol_bad_unwind1.rs:LL:CC + = note: inside `main` at tests/fail/function_calls/exported_symbol_bad_unwind1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr index 12425cc48927b..aef45042e8bd5 100644 --- a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr +++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr @@ -1,4 +1,4 @@ -thread 'main' panicked at $DIR/exported_symbol_bad_unwind2.rs:LL:CC: +thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC: explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect @@ -21,14 +21,14 @@ LL | ABORT(); = note: inside `core::panicking::panic_nounwind` at RUSTLIB/core/src/panicking.rs:LL:CC = note: inside `core::panicking::panic_cannot_unwind` at RUSTLIB/core/src/panicking.rs:LL:CC note: inside `nounwind` - --> $DIR/exported_symbol_bad_unwind2.rs:LL:CC + --> tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC | LL | / extern "C-unwind" fn nounwind() { LL | | panic!(); LL | | } | |_^ note: inside `main` - --> $DIR/exported_symbol_bad_unwind2.rs:LL:CC + --> tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC | LL | unsafe { nounwind() } | ^ diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr index 12425cc48927b..aef45042e8bd5 100644 --- a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr +++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr @@ -1,4 +1,4 @@ -thread 'main' panicked at $DIR/exported_symbol_bad_unwind2.rs:LL:CC: +thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC: explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect @@ -21,14 +21,14 @@ LL | ABORT(); = note: inside `core::panicking::panic_nounwind` at RUSTLIB/core/src/panicking.rs:LL:CC = note: inside `core::panicking::panic_cannot_unwind` at RUSTLIB/core/src/panicking.rs:LL:CC note: inside `nounwind` - --> $DIR/exported_symbol_bad_unwind2.rs:LL:CC + --> tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC | LL | / extern "C-unwind" fn nounwind() { LL | | panic!(); LL | | } | |_^ note: inside `main` - --> $DIR/exported_symbol_bad_unwind2.rs:LL:CC + --> tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC | LL | unsafe { nounwind() } | ^ diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.extern_block.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.extern_block.stderr index f9e299bf5d2e4..a81e8226e5ac4 100644 --- a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.extern_block.stderr +++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.extern_block.stderr @@ -1,9 +1,9 @@ -thread 'main' panicked at $DIR/exported_symbol_bad_unwind2.rs:LL:CC: +thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC: explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect error: Undefined Behavior: unwinding past a stack frame that does not allow unwinding - --> $DIR/exported_symbol_bad_unwind2.rs:LL:CC + --> tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC | LL | unsafe { nounwind() } | ^ unwinding past a stack frame that does not allow unwinding @@ -11,7 +11,7 @@ LL | unsafe { nounwind() } = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/exported_symbol_bad_unwind2.rs:LL:CC + = note: inside `main` at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_clashing.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_clashing.stderr index 2f561ed88e3f1..e9e580ffc86f7 100644 --- a/src/tools/miri/tests/fail/function_calls/exported_symbol_clashing.stderr +++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_clashing.stderr @@ -1,21 +1,21 @@ error: multiple definitions of symbol `foo` - --> $DIR/exported_symbol_clashing.rs:LL:CC + --> tests/fail/function_calls/exported_symbol_clashing.rs:LL:CC | LL | unsafe { foo() } | ^^^^^ multiple definitions of symbol `foo` | help: it's first defined here, in crate `exported_symbol_clashing` - --> $DIR/exported_symbol_clashing.rs:LL:CC + --> tests/fail/function_calls/exported_symbol_clashing.rs:LL:CC | LL | fn foo() {} | ^^^^^^^^ help: then it's defined here again, in crate `exported_symbol_clashing` - --> $DIR/exported_symbol_clashing.rs:LL:CC + --> tests/fail/function_calls/exported_symbol_clashing.rs:LL:CC | LL | fn bar() {} | ^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/exported_symbol_clashing.rs:LL:CC + = note: inside `main` at tests/fail/function_calls/exported_symbol_clashing.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_shim_clashing.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_shim_clashing.stderr index d51156b3c3360..fb9cc47c7a8ca 100644 --- a/src/tools/miri/tests/fail/function_calls/exported_symbol_shim_clashing.stderr +++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_shim_clashing.stderr @@ -1,11 +1,11 @@ error: found `malloc` symbol definition that clashes with a built-in shim - --> $DIR/exported_symbol_shim_clashing.rs:LL:CC + --> tests/fail/function_calls/exported_symbol_shim_clashing.rs:LL:CC | LL | malloc(0); | ^^^^^^^^^ found `malloc` symbol definition that clashes with a built-in shim | help: the `malloc` symbol is defined here - --> $DIR/exported_symbol_shim_clashing.rs:LL:CC + --> tests/fail/function_calls/exported_symbol_shim_clashing.rs:LL:CC | LL | / extern "C" fn malloc(_: usize) -> *mut std::ffi::c_void { LL | | @@ -13,7 +13,7 @@ LL | | unreachable!() LL | | } | |_^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/exported_symbol_shim_clashing.rs:LL:CC + = note: inside `main` at tests/fail/function_calls/exported_symbol_shim_clashing.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_wrong_arguments.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_wrong_arguments.stderr index 69b710b3d3b16..1ff9aa36f1ee8 100644 --- a/src/tools/miri/tests/fail/function_calls/exported_symbol_wrong_arguments.stderr +++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_wrong_arguments.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: calling a function with more arguments than it expected - --> $DIR/exported_symbol_wrong_arguments.rs:LL:CC + --> tests/fail/function_calls/exported_symbol_wrong_arguments.rs:LL:CC | LL | unsafe { foo(1) } | ^^^^^^ calling a function with more arguments than it expected @@ -7,7 +7,7 @@ LL | unsafe { foo(1) } = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/exported_symbol_wrong_arguments.rs:LL:CC + = note: inside `main` at tests/fail/function_calls/exported_symbol_wrong_arguments.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_wrong_type.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_wrong_type.stderr index 96b483059b0e3..29c87e8c4377c 100644 --- a/src/tools/miri/tests/fail/function_calls/exported_symbol_wrong_type.stderr +++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_wrong_type.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: attempt to call an exported symbol that is not defined as a function - --> $DIR/exported_symbol_wrong_type.rs:LL:CC + --> tests/fail/function_calls/exported_symbol_wrong_type.rs:LL:CC | LL | unsafe { FOO() } | ^^^^^ attempt to call an exported symbol that is not defined as a function @@ -7,7 +7,7 @@ LL | unsafe { FOO() } = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/exported_symbol_wrong_type.rs:LL:CC + = note: inside `main` at tests/fail/function_calls/exported_symbol_wrong_type.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.none.stderr b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.none.stderr index e8b766d0b0e28..9da2c3589da88 100644 --- a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.none.stderr +++ b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.none.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory - --> $DIR/return_pointer_aliasing_read.rs:LL:CC + --> tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC | LL | unsafe { ptr.read() }; | ^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory @@ -7,9 +7,9 @@ LL | unsafe { ptr.read() }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `myfun` at $DIR/return_pointer_aliasing_read.rs:LL:CC + = note: inside `myfun` at tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC note: inside `main` - --> $DIR/return_pointer_aliasing_read.rs:LL:CC + --> tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC | LL | Call(*ptr = myfun(ptr), ReturnTo(after_call), UnwindContinue()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.stack.stderr b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.stack.stderr index 941470e92959e..b009b0901c416 100644 --- a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.stack.stderr +++ b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.stack.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: not granting access to tag because that would remove [Unique for ] which is strongly protected - --> $DIR/return_pointer_aliasing_read.rs:LL:CC + --> tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC | LL | unsafe { ptr.read() }; | ^^^^^^^^^^ not granting access to tag because that would remove [Unique for ] which is strongly protected @@ -7,7 +7,7 @@ LL | unsafe { ptr.read() }; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadWrite retag at offsets [0x0..0x4] - --> $DIR/return_pointer_aliasing_read.rs:LL:CC + --> tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC | LL | / mir! { LL | | { @@ -18,14 +18,14 @@ LL | | } LL | | } | |_____^ help: is this argument - --> $DIR/return_pointer_aliasing_read.rs:LL:CC + --> tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC | LL | unsafe { ptr.read() }; | ^^^^^^^^^^^^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `myfun` at $DIR/return_pointer_aliasing_read.rs:LL:CC + = note: inside `myfun` at tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC note: inside `main` - --> $DIR/return_pointer_aliasing_read.rs:LL:CC + --> tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC | LL | Call(*ptr = myfun(ptr), ReturnTo(after_call), UnwindContinue()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.tree.stderr b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.tree.stderr index 715ee33061994..6d2cbe9b7cd68 100644 --- a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.tree.stderr +++ b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.tree.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: read access through (root of the allocation) at ALLOC[0x0] is forbidden - --> $DIR/return_pointer_aliasing_read.rs:LL:CC + --> tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC | LL | unsafe { ptr.read() }; | ^^^^^^^^^^ read access through (root of the allocation) at ALLOC[0x0] is forbidden @@ -9,7 +9,7 @@ LL | unsafe { ptr.read() }; = help: this foreign read access would cause the protected tag (currently Active) to become Disabled = help: protected tags must never be Disabled help: the accessed tag was created here - --> $DIR/return_pointer_aliasing_read.rs:LL:CC + --> tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC | LL | / mir! { LL | | { @@ -20,20 +20,20 @@ LL | | } LL | | } | |_____^ help: the protected tag was created here, in the initial state Reserved - --> $DIR/return_pointer_aliasing_read.rs:LL:CC + --> tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC | LL | unsafe { ptr.read() }; | ^^^^^^^^^^^^^^^^^^^^^ help: the protected tag later transitioned to Active due to a child write access at offsets [0x0..0x4] - --> $DIR/return_pointer_aliasing_read.rs:LL:CC + --> tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC | LL | unsafe { ptr.read() }; | ^^^^^^^^^^^^^^^^^^^^^ = help: this transition corresponds to the first write to a 2-phase borrowed mutable reference = note: BACKTRACE (of the first span): - = note: inside `myfun` at $DIR/return_pointer_aliasing_read.rs:LL:CC + = note: inside `myfun` at tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC note: inside `main` - --> $DIR/return_pointer_aliasing_read.rs:LL:CC + --> tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC | LL | Call(*ptr = myfun(ptr), ReturnTo(after_call), UnwindContinue()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write.stack.stderr b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write.stack.stderr index 51cb270dd2ecb..54f9a7aebd604 100644 --- a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write.stack.stderr +++ b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write.stack.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: not granting access to tag because that would remove [Unique for ] which is strongly protected - --> $DIR/return_pointer_aliasing_write.rs:LL:CC + --> tests/fail/function_calls/return_pointer_aliasing_write.rs:LL:CC | LL | unsafe { ptr.write(0) }; | ^^^^^^^^^^^^ not granting access to tag because that would remove [Unique for ] which is strongly protected @@ -7,7 +7,7 @@ LL | unsafe { ptr.write(0) }; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadWrite retag at offsets [0x0..0x4] - --> $DIR/return_pointer_aliasing_write.rs:LL:CC + --> tests/fail/function_calls/return_pointer_aliasing_write.rs:LL:CC | LL | / mir! { LL | | { @@ -18,14 +18,14 @@ LL | | } LL | | } | |_____^ help: is this argument - --> $DIR/return_pointer_aliasing_write.rs:LL:CC + --> tests/fail/function_calls/return_pointer_aliasing_write.rs:LL:CC | LL | unsafe { ptr.write(0) }; | ^^^^^^^^^^^^^^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `myfun` at $DIR/return_pointer_aliasing_write.rs:LL:CC + = note: inside `myfun` at tests/fail/function_calls/return_pointer_aliasing_write.rs:LL:CC note: inside `main` - --> $DIR/return_pointer_aliasing_write.rs:LL:CC + --> tests/fail/function_calls/return_pointer_aliasing_write.rs:LL:CC | LL | Call(*ptr = myfun(ptr), ReturnTo(after_call), UnwindContinue()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write.tree.stderr b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write.tree.stderr index 66ca1027edce2..693534be2e00d 100644 --- a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write.tree.stderr +++ b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write.tree.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: write access through (root of the allocation) at ALLOC[0x0] is forbidden - --> $DIR/return_pointer_aliasing_write.rs:LL:CC + --> tests/fail/function_calls/return_pointer_aliasing_write.rs:LL:CC | LL | unsafe { ptr.write(0) }; | ^^^^^^^^^^^^ write access through (root of the allocation) at ALLOC[0x0] is forbidden @@ -9,7 +9,7 @@ LL | unsafe { ptr.write(0) }; = help: this foreign write access would cause the protected tag (currently Active) to become Disabled = help: protected tags must never be Disabled help: the accessed tag was created here - --> $DIR/return_pointer_aliasing_write.rs:LL:CC + --> tests/fail/function_calls/return_pointer_aliasing_write.rs:LL:CC | LL | / mir! { LL | | { @@ -20,20 +20,20 @@ LL | | } LL | | } | |_____^ help: the protected tag was created here, in the initial state Reserved - --> $DIR/return_pointer_aliasing_write.rs:LL:CC + --> tests/fail/function_calls/return_pointer_aliasing_write.rs:LL:CC | LL | unsafe { ptr.write(0) }; | ^^^^^^^^^^^^^^^^^^^^^^^ help: the protected tag later transitioned to Active due to a child write access at offsets [0x0..0x4] - --> $DIR/return_pointer_aliasing_write.rs:LL:CC + --> tests/fail/function_calls/return_pointer_aliasing_write.rs:LL:CC | LL | unsafe { ptr.write(0) }; | ^^^^^^^^^^^^^^^^^^^^^^^ = help: this transition corresponds to the first write to a 2-phase borrowed mutable reference = note: BACKTRACE (of the first span): - = note: inside `myfun` at $DIR/return_pointer_aliasing_write.rs:LL:CC + = note: inside `myfun` at tests/fail/function_calls/return_pointer_aliasing_write.rs:LL:CC note: inside `main` - --> $DIR/return_pointer_aliasing_write.rs:LL:CC + --> tests/fail/function_calls/return_pointer_aliasing_write.rs:LL:CC | LL | Call(*ptr = myfun(ptr), ReturnTo(after_call), UnwindContinue()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write_tail_call.stack.stderr b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write_tail_call.stack.stderr index 7e527a440d128..520937beaeb8c 100644 --- a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write_tail_call.stack.stderr +++ b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write_tail_call.stack.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: not granting access to tag because that would remove [Unique for ] which is strongly protected - --> $DIR/return_pointer_aliasing_write_tail_call.rs:LL:CC + --> tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs:LL:CC | LL | unsafe { ptr.write(0) }; | ^^^^^^^^^^^^ not granting access to tag because that would remove [Unique for ] which is strongly protected @@ -7,7 +7,7 @@ LL | unsafe { ptr.write(0) }; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadWrite retag at offsets [0x0..0x4] - --> $DIR/return_pointer_aliasing_write_tail_call.rs:LL:CC + --> tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs:LL:CC | LL | / mir! { LL | | { @@ -18,14 +18,14 @@ LL | | } LL | | } | |_____^ help: is this argument - --> $DIR/return_pointer_aliasing_write_tail_call.rs:LL:CC + --> tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs:LL:CC | LL | unsafe { ptr.write(0) }; | ^^^^^^^^^^^^^^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `myfun2` at $DIR/return_pointer_aliasing_write_tail_call.rs:LL:CC + = note: inside `myfun2` at tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs:LL:CC note: inside `main` - --> $DIR/return_pointer_aliasing_write_tail_call.rs:LL:CC + --> tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs:LL:CC | LL | Call(*ptr = myfun(ptr), ReturnTo(after_call), UnwindContinue()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write_tail_call.tree.stderr b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write_tail_call.tree.stderr index b1f2cab031e4d..a879189d0c139 100644 --- a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write_tail_call.tree.stderr +++ b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write_tail_call.tree.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: write access through (root of the allocation) at ALLOC[0x0] is forbidden - --> $DIR/return_pointer_aliasing_write_tail_call.rs:LL:CC + --> tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs:LL:CC | LL | unsafe { ptr.write(0) }; | ^^^^^^^^^^^^ write access through (root of the allocation) at ALLOC[0x0] is forbidden @@ -9,7 +9,7 @@ LL | unsafe { ptr.write(0) }; = help: this foreign write access would cause the protected tag (currently Active) to become Disabled = help: protected tags must never be Disabled help: the accessed tag was created here - --> $DIR/return_pointer_aliasing_write_tail_call.rs:LL:CC + --> tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs:LL:CC | LL | / mir! { LL | | { @@ -20,20 +20,20 @@ LL | | } LL | | } | |_____^ help: the protected tag was created here, in the initial state Reserved - --> $DIR/return_pointer_aliasing_write_tail_call.rs:LL:CC + --> tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs:LL:CC | LL | unsafe { ptr.write(0) }; | ^^^^^^^^^^^^^^^^^^^^^^^ help: the protected tag later transitioned to Active due to a child write access at offsets [0x0..0x4] - --> $DIR/return_pointer_aliasing_write_tail_call.rs:LL:CC + --> tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs:LL:CC | LL | unsafe { ptr.write(0) }; | ^^^^^^^^^^^^^^^^^^^^^^^ = help: this transition corresponds to the first write to a 2-phase borrowed mutable reference = note: BACKTRACE (of the first span): - = note: inside `myfun2` at $DIR/return_pointer_aliasing_write_tail_call.rs:LL:CC + = note: inside `myfun2` at tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs:LL:CC note: inside `main` - --> $DIR/return_pointer_aliasing_write_tail_call.rs:LL:CC + --> tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs:LL:CC | LL | Call(*ptr = myfun(ptr), ReturnTo(after_call), UnwindContinue()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.stderr b/src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.stderr index 83efc9974e895..db876cb5ce6db 100644 --- a/src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.stderr +++ b/src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.stderr @@ -1,9 +1,9 @@ -thread 'main' panicked at $DIR/return_pointer_on_unwind.rs:LL:CC: +thread 'main' panicked at tests/fail/function_calls/return_pointer_on_unwind.rs:LL:CC: explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory - --> $DIR/return_pointer_on_unwind.rs:LL:CC + --> tests/fail/function_calls/return_pointer_on_unwind.rs:LL:CC | LL | dbg!(x.0); | ^^^^^^^^^ using uninitialized data, but this operation requires initialized memory diff --git a/src/tools/miri/tests/fail/function_calls/simd_feature_flag_difference.rs b/src/tools/miri/tests/fail/function_calls/simd_feature_flag_difference.rs index e98a3abadf59b..200f1062a3e80 100644 --- a/src/tools/miri/tests/fail/function_calls/simd_feature_flag_difference.rs +++ b/src/tools/miri/tests/fail/function_calls/simd_feature_flag_difference.rs @@ -1,4 +1,4 @@ -//@only-target-x86_64 +//@only-target: x86_64 #![allow(improper_ctypes_definitions)] use std::arch::x86_64::*; use std::mem::transmute; diff --git a/src/tools/miri/tests/fail/function_calls/simd_feature_flag_difference.stderr b/src/tools/miri/tests/fail/function_calls/simd_feature_flag_difference.stderr index 2544421c7e8c7..1d5b331be6c5e 100644 --- a/src/tools/miri/tests/fail/function_calls/simd_feature_flag_difference.stderr +++ b/src/tools/miri/tests/fail/function_calls/simd_feature_flag_difference.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: calling a function that requires unavailable target features: avx - --> $DIR/simd_feature_flag_difference.rs:LL:CC + --> tests/fail/function_calls/simd_feature_flag_difference.rs:LL:CC | LL | unsafe { foo(0.0, x) } | ^^^^^^^^^^^ calling a function that requires unavailable target features: avx @@ -7,9 +7,9 @@ LL | unsafe { foo(0.0, x) } = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `bar` at $DIR/simd_feature_flag_difference.rs:LL:CC + = note: inside `bar` at tests/fail/function_calls/simd_feature_flag_difference.rs:LL:CC note: inside `main` - --> $DIR/simd_feature_flag_difference.rs:LL:CC + --> tests/fail/function_calls/simd_feature_flag_difference.rs:LL:CC | LL | let copy = bar(input); | ^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/function_calls/target_feature.rs b/src/tools/miri/tests/fail/function_calls/target_feature.rs index 84e01eb4803fe..32207ffae4865 100644 --- a/src/tools/miri/tests/fail/function_calls/target_feature.rs +++ b/src/tools/miri/tests/fail/function_calls/target_feature.rs @@ -1,5 +1,5 @@ -//@only-target-x86_64: uses x86 target features -//@ignore-target-x86_64-apple-darwin: that target actually has ssse3 +//@only-target: x86_64 # uses x86 target features +//@ignore-target: x86_64-apple-darwin # that target actually has ssse3 fn main() { assert!(!is_x86_feature_detected!("ssse3")); diff --git a/src/tools/miri/tests/fail/function_calls/target_feature.stderr b/src/tools/miri/tests/fail/function_calls/target_feature.stderr index 4d3cf6e9d3bc0..937bd4a5951f6 100644 --- a/src/tools/miri/tests/fail/function_calls/target_feature.stderr +++ b/src/tools/miri/tests/fail/function_calls/target_feature.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: calling a function that requires unavailable target features: ssse3 - --> $DIR/target_feature.rs:LL:CC + --> tests/fail/function_calls/target_feature.rs:LL:CC | LL | ssse3_fn(); | ^^^^^^^^^^ calling a function that requires unavailable target features: ssse3 @@ -7,7 +7,7 @@ LL | ssse3_fn(); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/target_feature.rs:LL:CC + = note: inside `main` at tests/fail/function_calls/target_feature.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/target_feature_wasm.rs b/src/tools/miri/tests/fail/function_calls/target_feature_wasm.rs index bd400e8824ac3..28d3d4a60548a 100644 --- a/src/tools/miri/tests/fail/function_calls/target_feature_wasm.rs +++ b/src/tools/miri/tests/fail/function_calls/target_feature_wasm.rs @@ -1,4 +1,4 @@ -//@only-target-wasm: tests WASM-specific behavior +//@only-target: wasm # tests WASM-specific behavior //@compile-flags: -C target-feature=-simd128 fn main() { diff --git a/src/tools/miri/tests/fail/function_calls/target_feature_wasm.stderr b/src/tools/miri/tests/fail/function_calls/target_feature_wasm.stderr index dc0aca77f9eb5..9cc8154653121 100644 --- a/src/tools/miri/tests/fail/function_calls/target_feature_wasm.stderr +++ b/src/tools/miri/tests/fail/function_calls/target_feature_wasm.stderr @@ -1,11 +1,11 @@ error: abnormal termination: calling a function that requires unavailable target features: simd128 - --> $DIR/target_feature_wasm.rs:LL:CC + --> tests/fail/function_calls/target_feature_wasm.rs:LL:CC | LL | simd128_fn(); | ^^^^^^^^^^^^ calling a function that requires unavailable target features: simd128 | = note: BACKTRACE: - = note: inside `main` at $DIR/target_feature_wasm.rs:LL:CC + = note: inside `main` at tests/fail/function_calls/target_feature_wasm.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_pointers/abi_mismatch_array_vs_struct.stderr b/src/tools/miri/tests/fail/function_pointers/abi_mismatch_array_vs_struct.stderr index 2b2a898ce73bb..521cececc3750 100644 --- a/src/tools/miri/tests/fail/function_pointers/abi_mismatch_array_vs_struct.stderr +++ b/src/tools/miri/tests/fail/function_pointers/abi_mismatch_array_vs_struct.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: calling a function with argument of type S passing data of type [i32; 4] - --> $DIR/abi_mismatch_array_vs_struct.rs:LL:CC + --> tests/fail/function_pointers/abi_mismatch_array_vs_struct.rs:LL:CC | LL | g(Default::default()) | ^^^^^^^^^^^^^^^^^^^^^ calling a function with argument of type S passing data of type [i32; 4] @@ -9,7 +9,7 @@ LL | g(Default::default()) = help: this means these two types are not *guaranteed* to be ABI-compatible across all targets = help: if you think this code should be accepted anyway, please report an issue with Miri = note: BACKTRACE: - = note: inside `main` at $DIR/abi_mismatch_array_vs_struct.rs:LL:CC + = note: inside `main` at tests/fail/function_pointers/abi_mismatch_array_vs_struct.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_pointers/abi_mismatch_int_vs_float.stderr b/src/tools/miri/tests/fail/function_pointers/abi_mismatch_int_vs_float.stderr index 752e17116d12f..20704299257a0 100644 --- a/src/tools/miri/tests/fail/function_pointers/abi_mismatch_int_vs_float.stderr +++ b/src/tools/miri/tests/fail/function_pointers/abi_mismatch_int_vs_float.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: calling a function with argument of type f32 passing data of type i32 - --> $DIR/abi_mismatch_int_vs_float.rs:LL:CC + --> tests/fail/function_pointers/abi_mismatch_int_vs_float.rs:LL:CC | LL | g(42) | ^^^^^ calling a function with argument of type f32 passing data of type i32 @@ -9,7 +9,7 @@ LL | g(42) = help: this means these two types are not *guaranteed* to be ABI-compatible across all targets = help: if you think this code should be accepted anyway, please report an issue with Miri = note: BACKTRACE: - = note: inside `main` at $DIR/abi_mismatch_int_vs_float.rs:LL:CC + = note: inside `main` at tests/fail/function_pointers/abi_mismatch_int_vs_float.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_pointers/abi_mismatch_raw_pointer.stderr b/src/tools/miri/tests/fail/function_pointers/abi_mismatch_raw_pointer.stderr index 907a8e50c411d..3e3d07e1484e9 100644 --- a/src/tools/miri/tests/fail/function_pointers/abi_mismatch_raw_pointer.stderr +++ b/src/tools/miri/tests/fail/function_pointers/abi_mismatch_raw_pointer.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: calling a function with argument of type *const [i32] passing data of type *const i32 - --> $DIR/abi_mismatch_raw_pointer.rs:LL:CC + --> tests/fail/function_pointers/abi_mismatch_raw_pointer.rs:LL:CC | LL | g(&42 as *const i32) | ^^^^^^^^^^^^^^^^^^^^ calling a function with argument of type *const [i32] passing data of type *const i32 @@ -9,7 +9,7 @@ LL | g(&42 as *const i32) = help: this means these two types are not *guaranteed* to be ABI-compatible across all targets = help: if you think this code should be accepted anyway, please report an issue with Miri = note: BACKTRACE: - = note: inside `main` at $DIR/abi_mismatch_raw_pointer.rs:LL:CC + = note: inside `main` at tests/fail/function_pointers/abi_mismatch_raw_pointer.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_pointers/abi_mismatch_repr_C.stderr b/src/tools/miri/tests/fail/function_pointers/abi_mismatch_repr_C.stderr index 8ec19db813adf..6b92824494ac8 100644 --- a/src/tools/miri/tests/fail/function_pointers/abi_mismatch_repr_C.stderr +++ b/src/tools/miri/tests/fail/function_pointers/abi_mismatch_repr_C.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: calling a function with argument of type S2 passing data of type S1 - --> $DIR/abi_mismatch_repr_C.rs:LL:CC + --> tests/fail/function_pointers/abi_mismatch_repr_C.rs:LL:CC | LL | fnptr(S1(NonZero::new(1).unwrap())); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ calling a function with argument of type S2 passing data of type S1 @@ -9,7 +9,7 @@ LL | fnptr(S1(NonZero::new(1).unwrap())); = help: this means these two types are not *guaranteed* to be ABI-compatible across all targets = help: if you think this code should be accepted anyway, please report an issue with Miri = note: BACKTRACE: - = note: inside `main` at $DIR/abi_mismatch_repr_C.rs:LL:CC + = note: inside `main` at tests/fail/function_pointers/abi_mismatch_repr_C.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_pointers/abi_mismatch_return_type.stderr b/src/tools/miri/tests/fail/function_pointers/abi_mismatch_return_type.stderr index 3793590f84237..51539b078aec2 100644 --- a/src/tools/miri/tests/fail/function_pointers/abi_mismatch_return_type.stderr +++ b/src/tools/miri/tests/fail/function_pointers/abi_mismatch_return_type.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: calling a function with return type u32 passing return place of type () - --> $DIR/abi_mismatch_return_type.rs:LL:CC + --> tests/fail/function_pointers/abi_mismatch_return_type.rs:LL:CC | LL | g() | ^^^ calling a function with return type u32 passing return place of type () @@ -9,7 +9,7 @@ LL | g() = help: this means these two types are not *guaranteed* to be ABI-compatible across all targets = help: if you think this code should be accepted anyway, please report an issue with Miri = note: BACKTRACE: - = note: inside `main` at $DIR/abi_mismatch_return_type.rs:LL:CC + = note: inside `main` at tests/fail/function_pointers/abi_mismatch_return_type.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_pointers/abi_mismatch_simple.stderr b/src/tools/miri/tests/fail/function_pointers/abi_mismatch_simple.stderr index 0c533c14173da..16a83b8e3425a 100644 --- a/src/tools/miri/tests/fail/function_pointers/abi_mismatch_simple.stderr +++ b/src/tools/miri/tests/fail/function_pointers/abi_mismatch_simple.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: calling a function with argument of type (i32, i32) passing data of type i32 - --> $DIR/abi_mismatch_simple.rs:LL:CC + --> tests/fail/function_pointers/abi_mismatch_simple.rs:LL:CC | LL | g(42) | ^^^^^ calling a function with argument of type (i32, i32) passing data of type i32 @@ -9,7 +9,7 @@ LL | g(42) = help: this means these two types are not *guaranteed* to be ABI-compatible across all targets = help: if you think this code should be accepted anyway, please report an issue with Miri = note: BACKTRACE: - = note: inside `main` at $DIR/abi_mismatch_simple.rs:LL:CC + = note: inside `main` at tests/fail/function_pointers/abi_mismatch_simple.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_pointers/abi_mismatch_too_few_args.stderr b/src/tools/miri/tests/fail/function_pointers/abi_mismatch_too_few_args.stderr index 2e50d054e771f..760826805c7f1 100644 --- a/src/tools/miri/tests/fail/function_pointers/abi_mismatch_too_few_args.stderr +++ b/src/tools/miri/tests/fail/function_pointers/abi_mismatch_too_few_args.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: calling a function with fewer arguments than it requires - --> $DIR/abi_mismatch_too_few_args.rs:LL:CC + --> tests/fail/function_pointers/abi_mismatch_too_few_args.rs:LL:CC | LL | g() | ^^^ calling a function with fewer arguments than it requires @@ -7,7 +7,7 @@ LL | g() = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/abi_mismatch_too_few_args.rs:LL:CC + = note: inside `main` at tests/fail/function_pointers/abi_mismatch_too_few_args.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_pointers/abi_mismatch_too_many_args.stderr b/src/tools/miri/tests/fail/function_pointers/abi_mismatch_too_many_args.stderr index facfe9d31f2d8..9552250546bb8 100644 --- a/src/tools/miri/tests/fail/function_pointers/abi_mismatch_too_many_args.stderr +++ b/src/tools/miri/tests/fail/function_pointers/abi_mismatch_too_many_args.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: calling a function with more arguments than it expected - --> $DIR/abi_mismatch_too_many_args.rs:LL:CC + --> tests/fail/function_pointers/abi_mismatch_too_many_args.rs:LL:CC | LL | g(42) | ^^^^^ calling a function with more arguments than it expected @@ -7,7 +7,7 @@ LL | g(42) = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/abi_mismatch_too_many_args.rs:LL:CC + = note: inside `main` at tests/fail/function_pointers/abi_mismatch_too_many_args.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_pointers/abi_mismatch_vector.stderr b/src/tools/miri/tests/fail/function_pointers/abi_mismatch_vector.stderr index ef4b60b83b1ff..021be890d25df 100644 --- a/src/tools/miri/tests/fail/function_pointers/abi_mismatch_vector.stderr +++ b/src/tools/miri/tests/fail/function_pointers/abi_mismatch_vector.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: calling a function with argument of type std::simd::Simd passing data of type std::simd::Simd - --> $DIR/abi_mismatch_vector.rs:LL:CC + --> tests/fail/function_pointers/abi_mismatch_vector.rs:LL:CC | LL | g(Default::default()) | ^^^^^^^^^^^^^^^^^^^^^ calling a function with argument of type std::simd::Simd passing data of type std::simd::Simd @@ -9,7 +9,7 @@ LL | g(Default::default()) = help: this means these two types are not *guaranteed* to be ABI-compatible across all targets = help: if you think this code should be accepted anyway, please report an issue with Miri = note: BACKTRACE: - = note: inside `main` at $DIR/abi_mismatch_vector.rs:LL:CC + = note: inside `main` at tests/fail/function_pointers/abi_mismatch_vector.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_pointers/cast_box_int_to_fn_ptr.stderr b/src/tools/miri/tests/fail/function_pointers/cast_box_int_to_fn_ptr.stderr index f95a62535d893..6112e92c93949 100644 --- a/src/tools/miri/tests/fail/function_pointers/cast_box_int_to_fn_ptr.stderr +++ b/src/tools/miri/tests/fail/function_pointers/cast_box_int_to_fn_ptr.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: using ALLOC as function pointer but it does not point to a function - --> $DIR/cast_box_int_to_fn_ptr.rs:LL:CC + --> tests/fail/function_pointers/cast_box_int_to_fn_ptr.rs:LL:CC | LL | (*g)(42) | ^^^^^^^^ using ALLOC as function pointer but it does not point to a function @@ -7,7 +7,7 @@ LL | (*g)(42) = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/cast_box_int_to_fn_ptr.rs:LL:CC + = note: inside `main` at tests/fail/function_pointers/cast_box_int_to_fn_ptr.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_pointers/cast_int_to_fn_ptr.stderr b/src/tools/miri/tests/fail/function_pointers/cast_int_to_fn_ptr.stderr index 347afa77053ee..f2d9933188d7b 100644 --- a/src/tools/miri/tests/fail/function_pointers/cast_int_to_fn_ptr.stderr +++ b/src/tools/miri/tests/fail/function_pointers/cast_int_to_fn_ptr.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: out-of-bounds pointer use: expected a pointer to some allocation, but got 0x2a[noalloc] which is a dangling pointer (it has no provenance) - --> $DIR/cast_int_to_fn_ptr.rs:LL:CC + --> tests/fail/function_pointers/cast_int_to_fn_ptr.rs:LL:CC | LL | g(42) | ^^^^^ out-of-bounds pointer use: expected a pointer to some allocation, but got 0x2a[noalloc] which is a dangling pointer (it has no provenance) @@ -7,7 +7,7 @@ LL | g(42) = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/cast_int_to_fn_ptr.rs:LL:CC + = note: inside `main` at tests/fail/function_pointers/cast_int_to_fn_ptr.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_pointers/deref_fn_ptr.stderr b/src/tools/miri/tests/fail/function_pointers/deref_fn_ptr.stderr index b5cee95d66de3..f7cc82b80df7a 100644 --- a/src/tools/miri/tests/fail/function_pointers/deref_fn_ptr.stderr +++ b/src/tools/miri/tests/fail/function_pointers/deref_fn_ptr.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: accessing ALLOC which contains a function - --> $DIR/deref_fn_ptr.rs:LL:CC + --> tests/fail/function_pointers/deref_fn_ptr.rs:LL:CC | LL | *std::mem::transmute::(f) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ accessing ALLOC which contains a function @@ -7,7 +7,7 @@ LL | *std::mem::transmute::(f) = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/deref_fn_ptr.rs:LL:CC + = note: inside `main` at tests/fail/function_pointers/deref_fn_ptr.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_pointers/execute_memory.stderr b/src/tools/miri/tests/fail/function_pointers/execute_memory.stderr index 4370e6d6a295c..e057318428298 100644 --- a/src/tools/miri/tests/fail/function_pointers/execute_memory.stderr +++ b/src/tools/miri/tests/fail/function_pointers/execute_memory.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: using ALLOC as function pointer but it does not point to a function - --> $DIR/execute_memory.rs:LL:CC + --> tests/fail/function_pointers/execute_memory.rs:LL:CC | LL | f() | ^^^ using ALLOC as function pointer but it does not point to a function @@ -7,7 +7,7 @@ LL | f() = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/execute_memory.rs:LL:CC + = note: inside `main` at tests/fail/function_pointers/execute_memory.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_pointers/fn_ptr_offset.stderr b/src/tools/miri/tests/fail/function_pointers/fn_ptr_offset.stderr index e66ab681860c2..4ed09683c6301 100644 --- a/src/tools/miri/tests/fail/function_pointers/fn_ptr_offset.stderr +++ b/src/tools/miri/tests/fail/function_pointers/fn_ptr_offset.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: using ALLOC+0x1 as function pointer but it does not point to a function - --> $DIR/fn_ptr_offset.rs:LL:CC + --> tests/fail/function_pointers/fn_ptr_offset.rs:LL:CC | LL | x(); | ^^^ using ALLOC+0x1 as function pointer but it does not point to a function @@ -7,7 +7,7 @@ LL | x(); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/fn_ptr_offset.rs:LL:CC + = note: inside `main` at tests/fail/function_pointers/fn_ptr_offset.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsic_fallback_is_spec.stderr b/src/tools/miri/tests/fail/intrinsic_fallback_is_spec.stderr index db3941a32a56a..a36b0fca8023b 100644 --- a/src/tools/miri/tests/fail/intrinsic_fallback_is_spec.stderr +++ b/src/tools/miri/tests/fail/intrinsic_fallback_is_spec.stderr @@ -1,12 +1,12 @@ error: unsupported operation: Miri can only use intrinsic fallback bodies that exactly reflect the specification: they fully check for UB and are as non-deterministic as possible. After verifying that `ptr_guaranteed_cmp` does so, add the `#[miri::intrinsic_fallback_is_spec]` attribute to it; also ping @rust-lang/miri when you do that - --> $DIR/intrinsic_fallback_is_spec.rs:LL:CC + --> tests/fail/intrinsic_fallback_is_spec.rs:LL:CC | LL | ptr_guaranteed_cmp::<()>(std::ptr::null(), std::ptr::null()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Miri can only use intrinsic fallback bodies that exactly reflect the specification: they fully check for UB and are as non-deterministic as possible. After verifying that `ptr_guaranteed_cmp` does so, add the `#[miri::intrinsic_fallback_is_spec]` attribute to it; also ping @rust-lang/miri when you do that | = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support = note: BACKTRACE: - = note: inside `main` at $DIR/intrinsic_fallback_is_spec.rs:LL:CC + = note: inside `main` at tests/fail/intrinsic_fallback_is_spec.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/assume.stderr b/src/tools/miri/tests/fail/intrinsics/assume.stderr index 7fa6f7b5bfcf5..eadbd2c0d58c9 100644 --- a/src/tools/miri/tests/fail/intrinsics/assume.stderr +++ b/src/tools/miri/tests/fail/intrinsics/assume.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: `assume` called with `false` - --> $DIR/assume.rs:LL:CC + --> tests/fail/intrinsics/assume.rs:LL:CC | LL | std::intrinsics::assume(x > 42); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `assume` called with `false` @@ -7,7 +7,7 @@ LL | std::intrinsics::assume(x > 42); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/assume.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/assume.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/copy_overflow.stderr b/src/tools/miri/tests/fail/intrinsics/copy_overflow.stderr index b7c92cf4a57a8..c50c7c1ef4317 100644 --- a/src/tools/miri/tests/fail/intrinsics/copy_overflow.stderr +++ b/src/tools/miri/tests/fail/intrinsics/copy_overflow.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: overflow computing total size of `copy` - --> $DIR/copy_overflow.rs:LL:CC + --> tests/fail/intrinsics/copy_overflow.rs:LL:CC | LL | (&mut y as *mut i32).copy_from(&x, 1usize << (mem::size_of::() * 8 - 1)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflow computing total size of `copy` @@ -7,7 +7,7 @@ LL | (&mut y as *mut i32).copy_from(&x, 1usize << (mem::size_of:: = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/copy_overflow.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/copy_overflow.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/copy_overlapping.stderr b/src/tools/miri/tests/fail/intrinsics/copy_overlapping.stderr index e9ea262caf743..fef5a0a82a07d 100644 --- a/src/tools/miri/tests/fail/intrinsics/copy_overlapping.stderr +++ b/src/tools/miri/tests/fail/intrinsics/copy_overlapping.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: `copy_nonoverlapping` called on overlapping ranges - --> $DIR/copy_overlapping.rs:LL:CC + --> tests/fail/intrinsics/copy_overlapping.rs:LL:CC | LL | copy_nonoverlapping(a, b, 2); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `copy_nonoverlapping` called on overlapping ranges @@ -7,7 +7,7 @@ LL | copy_nonoverlapping(a, b, 2); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/copy_overlapping.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/copy_overlapping.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/copy_unaligned.stderr b/src/tools/miri/tests/fail/intrinsics/copy_unaligned.stderr index d190f3de6b884..2d0edd4e6cbe7 100644 --- a/src/tools/miri/tests/fail/intrinsics/copy_unaligned.stderr +++ b/src/tools/miri/tests/fail/intrinsics/copy_unaligned.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: accessing memory with alignment ALIGN, but alignment ALIGN is required - --> $DIR/copy_unaligned.rs:LL:CC + --> tests/fail/intrinsics/copy_unaligned.rs:LL:CC | LL | copy_nonoverlapping(&data[5], ptr, 0); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ accessing memory with alignment ALIGN, but alignment ALIGN is required @@ -7,7 +7,7 @@ LL | copy_nonoverlapping(&data[5], ptr, 0); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/copy_unaligned.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/copy_unaligned.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/ctlz_nonzero.stderr b/src/tools/miri/tests/fail/intrinsics/ctlz_nonzero.stderr index 9889daaa85133..5ad3b8ad2a8bf 100644 --- a/src/tools/miri/tests/fail/intrinsics/ctlz_nonzero.stderr +++ b/src/tools/miri/tests/fail/intrinsics/ctlz_nonzero.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: `ctlz_nonzero` called on 0 - --> $DIR/ctlz_nonzero.rs:LL:CC + --> tests/fail/intrinsics/ctlz_nonzero.rs:LL:CC | LL | ctlz_nonzero(0u8); | ^^^^^^^^^^^^^^^^^ `ctlz_nonzero` called on 0 @@ -7,7 +7,7 @@ LL | ctlz_nonzero(0u8); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/ctlz_nonzero.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/ctlz_nonzero.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/cttz_nonzero.stderr b/src/tools/miri/tests/fail/intrinsics/cttz_nonzero.stderr index 0f75657e170ab..d0263ac1e45ac 100644 --- a/src/tools/miri/tests/fail/intrinsics/cttz_nonzero.stderr +++ b/src/tools/miri/tests/fail/intrinsics/cttz_nonzero.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: `cttz_nonzero` called on 0 - --> $DIR/cttz_nonzero.rs:LL:CC + --> tests/fail/intrinsics/cttz_nonzero.rs:LL:CC | LL | cttz_nonzero(0u8); | ^^^^^^^^^^^^^^^^^ `cttz_nonzero` called on 0 @@ -7,7 +7,7 @@ LL | cttz_nonzero(0u8); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/cttz_nonzero.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/cttz_nonzero.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/div-by-zero.stderr b/src/tools/miri/tests/fail/intrinsics/div-by-zero.stderr index 9f66e63ca5cfa..e276874ba2559 100644 --- a/src/tools/miri/tests/fail/intrinsics/div-by-zero.stderr +++ b/src/tools/miri/tests/fail/intrinsics/div-by-zero.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: dividing by zero - --> $DIR/div-by-zero.rs:LL:CC + --> tests/fail/intrinsics/div-by-zero.rs:LL:CC | LL | let _n = unchecked_div(1i64, 0); | ^^^^^^^^^^^^^^^^^^^^^^ dividing by zero @@ -7,7 +7,7 @@ LL | let _n = unchecked_div(1i64, 0); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/div-by-zero.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/div-by-zero.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/exact_div1.stderr b/src/tools/miri/tests/fail/intrinsics/exact_div1.stderr index ca6125ab899f8..f133baecfa20d 100644 --- a/src/tools/miri/tests/fail/intrinsics/exact_div1.stderr +++ b/src/tools/miri/tests/fail/intrinsics/exact_div1.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: calculating the remainder with a divisor of zero - --> $DIR/exact_div1.rs:LL:CC + --> tests/fail/intrinsics/exact_div1.rs:LL:CC | LL | unsafe { std::intrinsics::exact_div(2, 0) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ calculating the remainder with a divisor of zero @@ -7,7 +7,7 @@ LL | unsafe { std::intrinsics::exact_div(2, 0) }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/exact_div1.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/exact_div1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/exact_div2.stderr b/src/tools/miri/tests/fail/intrinsics/exact_div2.stderr index 306e9bdc23828..315417fe8dfe5 100644 --- a/src/tools/miri/tests/fail/intrinsics/exact_div2.stderr +++ b/src/tools/miri/tests/fail/intrinsics/exact_div2.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: exact_div: 2_u16 cannot be divided by 3_u16 without remainder - --> $DIR/exact_div2.rs:LL:CC + --> tests/fail/intrinsics/exact_div2.rs:LL:CC | LL | unsafe { std::intrinsics::exact_div(2u16, 3) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ exact_div: 2_u16 cannot be divided by 3_u16 without remainder @@ -7,7 +7,7 @@ LL | unsafe { std::intrinsics::exact_div(2u16, 3) }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/exact_div2.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/exact_div2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/exact_div3.stderr b/src/tools/miri/tests/fail/intrinsics/exact_div3.stderr index cbcb093a4e6cf..42f52540a4c5a 100644 --- a/src/tools/miri/tests/fail/intrinsics/exact_div3.stderr +++ b/src/tools/miri/tests/fail/intrinsics/exact_div3.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: exact_div: -19_i8 cannot be divided by 2_i8 without remainder - --> $DIR/exact_div3.rs:LL:CC + --> tests/fail/intrinsics/exact_div3.rs:LL:CC | LL | unsafe { std::intrinsics::exact_div(-19i8, 2) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ exact_div: -19_i8 cannot be divided by 2_i8 without remainder @@ -7,7 +7,7 @@ LL | unsafe { std::intrinsics::exact_div(-19i8, 2) }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/exact_div3.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/exact_div3.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/exact_div4.stderr b/src/tools/miri/tests/fail/intrinsics/exact_div4.stderr index 1b903bc97aedb..723ed4e49ed8b 100644 --- a/src/tools/miri/tests/fail/intrinsics/exact_div4.stderr +++ b/src/tools/miri/tests/fail/intrinsics/exact_div4.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: overflow in signed remainder (dividing MIN by -1) - --> $DIR/exact_div4.rs:LL:CC + --> tests/fail/intrinsics/exact_div4.rs:LL:CC | LL | unsafe { std::intrinsics::exact_div(i64::MIN, -1) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflow in signed remainder (dividing MIN by -1) @@ -7,7 +7,7 @@ LL | unsafe { std::intrinsics::exact_div(i64::MIN, -1) }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/exact_div4.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/exact_div4.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/fast_math_both.stderr b/src/tools/miri/tests/fail/intrinsics/fast_math_both.stderr index feba0c5991cf7..7579a81e3e1fc 100644 --- a/src/tools/miri/tests/fail/intrinsics/fast_math_both.stderr +++ b/src/tools/miri/tests/fail/intrinsics/fast_math_both.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: `fsub_fast` intrinsic called with non-finite value as both parameters - --> $DIR/fast_math_both.rs:LL:CC + --> tests/fail/intrinsics/fast_math_both.rs:LL:CC | LL | ...: f32 = core::intrinsics::fsub_fast(f32::NAN, f32::NAN); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `fsub_fast` intrinsic called with non-finite value as both parameters @@ -7,7 +7,7 @@ LL | ...: f32 = core::intrinsics::fsub_fast(f32::NAN, f32::NAN); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/fast_math_both.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/fast_math_both.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/fast_math_first.stderr b/src/tools/miri/tests/fail/intrinsics/fast_math_first.stderr index b26b5a3721594..8295ec1089fb0 100644 --- a/src/tools/miri/tests/fail/intrinsics/fast_math_first.stderr +++ b/src/tools/miri/tests/fail/intrinsics/fast_math_first.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: `frem_fast` intrinsic called with non-finite value as first parameter - --> $DIR/fast_math_first.rs:LL:CC + --> tests/fail/intrinsics/fast_math_first.rs:LL:CC | LL | ... let _x: f32 = core::intrinsics::frem_fast(f32::NAN, 3.2); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `frem_fast` intrinsic called with non-finite value as first parameter @@ -7,7 +7,7 @@ LL | ... let _x: f32 = core::intrinsics::frem_fast(f32::NAN, 3.2); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/fast_math_first.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/fast_math_first.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/fast_math_result.stderr b/src/tools/miri/tests/fail/intrinsics/fast_math_result.stderr index 5b24d2250266d..8ddbd4cc19e99 100644 --- a/src/tools/miri/tests/fail/intrinsics/fast_math_result.stderr +++ b/src/tools/miri/tests/fail/intrinsics/fast_math_result.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: `fdiv_fast` intrinsic produced non-finite value as result - --> $DIR/fast_math_result.rs:LL:CC + --> tests/fail/intrinsics/fast_math_result.rs:LL:CC | LL | let _x: f32 = core::intrinsics::fdiv_fast(1.0, 0.0); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `fdiv_fast` intrinsic produced non-finite value as result @@ -7,7 +7,7 @@ LL | let _x: f32 = core::intrinsics::fdiv_fast(1.0, 0.0); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/fast_math_result.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/fast_math_result.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/fast_math_second.stderr b/src/tools/miri/tests/fail/intrinsics/fast_math_second.stderr index cb46aa97a8de9..0fde006b3bd33 100644 --- a/src/tools/miri/tests/fail/intrinsics/fast_math_second.stderr +++ b/src/tools/miri/tests/fail/intrinsics/fast_math_second.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: `fmul_fast` intrinsic called with non-finite value as second parameter - --> $DIR/fast_math_second.rs:LL:CC + --> tests/fail/intrinsics/fast_math_second.rs:LL:CC | LL | ...f32 = core::intrinsics::fmul_fast(3.4f32, f32::INFINITY); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `fmul_fast` intrinsic called with non-finite value as second parameter @@ -7,7 +7,7 @@ LL | ...f32 = core::intrinsics::fmul_fast(3.4f32, f32::INFINITY); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/fast_math_second.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/fast_math_second.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_32_inf1.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_32_inf1.stderr index 2de8f3420b7d9..bcc8ff667ff58 100644 --- a/src/tools/miri/tests/fail/intrinsics/float_to_int_32_inf1.stderr +++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_32_inf1.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on +Inf_f32 which cannot be represented in target type `i32` - --> $DIR/float_to_int_32_inf1.rs:LL:CC + --> tests/fail/intrinsics/float_to_int_32_inf1.rs:LL:CC | LL | float_to_int_unchecked::(f32::INFINITY); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on +Inf_f32 which cannot be represented in target type `i32` @@ -7,7 +7,7 @@ LL | float_to_int_unchecked::(f32::INFINITY); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/float_to_int_32_inf1.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/float_to_int_32_inf1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_32_infneg1.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_32_infneg1.stderr index 53ed208bdee73..9ac910c8d2f46 100644 --- a/src/tools/miri/tests/fail/intrinsics/float_to_int_32_infneg1.stderr +++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_32_infneg1.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on -Inf_f32 which cannot be represented in target type `i32` - --> $DIR/float_to_int_32_infneg1.rs:LL:CC + --> tests/fail/intrinsics/float_to_int_32_infneg1.rs:LL:CC | LL | float_to_int_unchecked::(f32::NEG_INFINITY); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on -Inf_f32 which cannot be represented in target type `i32` @@ -7,7 +7,7 @@ LL | float_to_int_unchecked::(f32::NEG_INFINITY); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/float_to_int_32_infneg1.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/float_to_int_32_infneg1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_32_nan.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_32_nan.stderr index afda7124c114f..b377b701361c9 100644 --- a/src/tools/miri/tests/fail/intrinsics/float_to_int_32_nan.stderr +++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_32_nan.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on NaN_f32 which cannot be represented in target type `u32` - --> $DIR/float_to_int_32_nan.rs:LL:CC + --> tests/fail/intrinsics/float_to_int_32_nan.rs:LL:CC | LL | float_to_int_unchecked::(f32::NAN); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on NaN_f32 which cannot be represented in target type `u32` @@ -7,7 +7,7 @@ LL | float_to_int_unchecked::(f32::NAN); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/float_to_int_32_nan.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/float_to_int_32_nan.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_32_nanneg.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_32_nanneg.stderr index 8ba46de8641d7..2a0dcdfaeef49 100644 --- a/src/tools/miri/tests/fail/intrinsics/float_to_int_32_nanneg.stderr +++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_32_nanneg.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on NaN_f32 which cannot be represented in target type `u32` - --> $DIR/float_to_int_32_nanneg.rs:LL:CC + --> tests/fail/intrinsics/float_to_int_32_nanneg.rs:LL:CC | LL | float_to_int_unchecked::(-f32::NAN); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on NaN_f32 which cannot be represented in target type `u32` @@ -7,7 +7,7 @@ LL | float_to_int_unchecked::(-f32::NAN); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/float_to_int_32_nanneg.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/float_to_int_32_nanneg.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_32_neg.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_32_neg.stderr index 9f4b2af2167bc..45be75e2f0261 100644 --- a/src/tools/miri/tests/fail/intrinsics/float_to_int_32_neg.stderr +++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_32_neg.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on -1f32 which cannot be represented in target type `u32` - --> $DIR/float_to_int_32_neg.rs:LL:CC + --> tests/fail/intrinsics/float_to_int_32_neg.rs:LL:CC | LL | float_to_int_unchecked::(-1.000000001f32); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on -1f32 which cannot be represented in target type `u32` @@ -7,7 +7,7 @@ LL | float_to_int_unchecked::(-1.000000001f32); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/float_to_int_32_neg.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/float_to_int_32_neg.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_32_too_big1.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_32_too_big1.stderr index a8e56ddb59b90..8597dc0b072ad 100644 --- a/src/tools/miri/tests/fail/intrinsics/float_to_int_32_too_big1.stderr +++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_32_too_big1.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on 2.14748365E+9f32 which cannot be represented in target type `i32` - --> $DIR/float_to_int_32_too_big1.rs:LL:CC + --> tests/fail/intrinsics/float_to_int_32_too_big1.rs:LL:CC | LL | float_to_int_unchecked::(2147483648.0f32); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on 2.14748365E+9f32 which cannot be represented in target type `i32` @@ -7,7 +7,7 @@ LL | float_to_int_unchecked::(2147483648.0f32); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/float_to_int_32_too_big1.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/float_to_int_32_too_big1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_32_too_big2.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_32_too_big2.stderr index a966e2e639c98..d79004e64294f 100644 --- a/src/tools/miri/tests/fail/intrinsics/float_to_int_32_too_big2.stderr +++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_32_too_big2.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on 4.2949673E+9f32 which cannot be represented in target type `u32` - --> $DIR/float_to_int_32_too_big2.rs:LL:CC + --> tests/fail/intrinsics/float_to_int_32_too_big2.rs:LL:CC | LL | float_to_int_unchecked::((u32::MAX - 127) as f32); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on 4.2949673E+9f32 which cannot be represented in target type `u32` @@ -7,7 +7,7 @@ LL | float_to_int_unchecked::((u32::MAX - 127) as f32); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/float_to_int_32_too_big2.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/float_to_int_32_too_big2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_32_too_small1.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_32_too_small1.stderr index 6115b381ebec5..6a1d48f48079a 100644 --- a/src/tools/miri/tests/fail/intrinsics/float_to_int_32_too_small1.stderr +++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_32_too_small1.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on -2.1474839E+9f32 which cannot be represented in target type `i32` - --> $DIR/float_to_int_32_too_small1.rs:LL:CC + --> tests/fail/intrinsics/float_to_int_32_too_small1.rs:LL:CC | LL | float_to_int_unchecked::(-2147483904.0f32); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on -2.1474839E+9f32 which cannot be represented in target type `i32` @@ -7,7 +7,7 @@ LL | float_to_int_unchecked::(-2147483904.0f32); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/float_to_int_32_too_small1.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/float_to_int_32_too_small1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_inf1.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_inf1.stderr index 5db9fb1417cbc..d77544cb37f19 100644 --- a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_inf1.stderr +++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_inf1.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on +Inf_f64 which cannot be represented in target type `u128` - --> $DIR/float_to_int_64_inf1.rs:LL:CC + --> tests/fail/intrinsics/float_to_int_64_inf1.rs:LL:CC | LL | float_to_int_unchecked::(f64::INFINITY); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on +Inf_f64 which cannot be represented in target type `u128` @@ -7,7 +7,7 @@ LL | float_to_int_unchecked::(f64::INFINITY); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/float_to_int_64_inf1.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/float_to_int_64_inf1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_infneg1.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_infneg1.stderr index 3e8dadb79e4d1..c6f9eb41138a1 100644 --- a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_infneg1.stderr +++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_infneg1.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on -Inf_f64 which cannot be represented in target type `u128` - --> $DIR/float_to_int_64_infneg1.rs:LL:CC + --> tests/fail/intrinsics/float_to_int_64_infneg1.rs:LL:CC | LL | float_to_int_unchecked::(f64::NEG_INFINITY); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on -Inf_f64 which cannot be represented in target type `u128` @@ -7,7 +7,7 @@ LL | float_to_int_unchecked::(f64::NEG_INFINITY); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/float_to_int_64_infneg1.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/float_to_int_64_infneg1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_infneg2.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_infneg2.stderr index cb59974bf454f..fc80f1679ceca 100644 --- a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_infneg2.stderr +++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_infneg2.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on -Inf_f64 which cannot be represented in target type `i128` - --> $DIR/float_to_int_64_infneg2.rs:LL:CC + --> tests/fail/intrinsics/float_to_int_64_infneg2.rs:LL:CC | LL | float_to_int_unchecked::(f64::NEG_INFINITY); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on -Inf_f64 which cannot be represented in target type `i128` @@ -7,7 +7,7 @@ LL | float_to_int_unchecked::(f64::NEG_INFINITY); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/float_to_int_64_infneg2.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/float_to_int_64_infneg2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_nan.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_nan.stderr index 686970605154e..01059ed5a7382 100644 --- a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_nan.stderr +++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_nan.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on NaN_f64 which cannot be represented in target type `u32` - --> $DIR/float_to_int_64_nan.rs:LL:CC + --> tests/fail/intrinsics/float_to_int_64_nan.rs:LL:CC | LL | float_to_int_unchecked::(f64::NAN); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on NaN_f64 which cannot be represented in target type `u32` @@ -7,7 +7,7 @@ LL | float_to_int_unchecked::(f64::NAN); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/float_to_int_64_nan.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/float_to_int_64_nan.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_neg.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_neg.stderr index 505a6463cd348..f17d502d51cf4 100644 --- a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_neg.stderr +++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_neg.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on -1.0000000000000999f64 which cannot be represented in target type `u128` - --> $DIR/float_to_int_64_neg.rs:LL:CC + --> tests/fail/intrinsics/float_to_int_64_neg.rs:LL:CC | LL | float_to_int_unchecked::(-1.0000000000001f64); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on -1.0000000000000999f64 which cannot be represented in target type `u128` @@ -7,7 +7,7 @@ LL | float_to_int_unchecked::(-1.0000000000001f64); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/float_to_int_64_neg.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/float_to_int_64_neg.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big1.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big1.stderr index bcfd394686b1e..9379be3f82faa 100644 --- a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big1.stderr +++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big1.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on 2147483648f64 which cannot be represented in target type `i32` - --> $DIR/float_to_int_64_too_big1.rs:LL:CC + --> tests/fail/intrinsics/float_to_int_64_too_big1.rs:LL:CC | LL | float_to_int_unchecked::(2147483648.0f64); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on 2147483648f64 which cannot be represented in target type `i32` @@ -7,7 +7,7 @@ LL | float_to_int_unchecked::(2147483648.0f64); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/float_to_int_64_too_big1.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/float_to_int_64_too_big1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big2.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big2.stderr index ac6139d7e7dff..1c0a0e0e88bfe 100644 --- a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big2.stderr +++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big2.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on 9.2233720368547758E+18f64 which cannot be represented in target type `i64` - --> $DIR/float_to_int_64_too_big2.rs:LL:CC + --> tests/fail/intrinsics/float_to_int_64_too_big2.rs:LL:CC | LL | float_to_int_unchecked::(9223372036854775808.0f64); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on 9.2233720368547758E+18f64 which cannot be represented in target type `i64` @@ -7,7 +7,7 @@ LL | float_to_int_unchecked::(9223372036854775808.0f64); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/float_to_int_64_too_big2.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/float_to_int_64_too_big2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big3.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big3.stderr index e289b4c0fc070..54ff73d596151 100644 --- a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big3.stderr +++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big3.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on 1.8446744073709552E+19f64 which cannot be represented in target type `u64` - --> $DIR/float_to_int_64_too_big3.rs:LL:CC + --> tests/fail/intrinsics/float_to_int_64_too_big3.rs:LL:CC | LL | float_to_int_unchecked::(18446744073709551616.0f64); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on 1.8446744073709552E+19f64 which cannot be represented in target type `u64` @@ -7,7 +7,7 @@ LL | float_to_int_unchecked::(18446744073709551616.0f64); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/float_to_int_64_too_big3.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/float_to_int_64_too_big3.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big4.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big4.stderr index 657c72daa6f4b..b622867c097e7 100644 --- a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big4.stderr +++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big4.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on 3.4028236692093846E+38f64 which cannot be represented in target type `u128` - --> $DIR/float_to_int_64_too_big4.rs:LL:CC + --> tests/fail/intrinsics/float_to_int_64_too_big4.rs:LL:CC | LL | float_to_int_unchecked::(u128::MAX as f64); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on 3.4028236692093846E+38f64 which cannot be represented in target type `u128` @@ -7,7 +7,7 @@ LL | float_to_int_unchecked::(u128::MAX as f64); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/float_to_int_64_too_big4.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/float_to_int_64_too_big4.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big5.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big5.stderr index 2a61b5fe15fe7..ffb8b0d1743fe 100644 --- a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big5.stderr +++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big5.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on 2.4028236692093845E+38f64 which cannot be represented in target type `i128` - --> $DIR/float_to_int_64_too_big5.rs:LL:CC + --> tests/fail/intrinsics/float_to_int_64_too_big5.rs:LL:CC | LL | float_to_int_unchecked::(240282366920938463463374607431768211455.0f64); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on 2.4028236692093845E+38f64 which cannot be represented in target type `i128` @@ -7,7 +7,7 @@ LL | float_to_int_unchecked::(2402823669209384634633746074317 = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/float_to_int_64_too_big5.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/float_to_int_64_too_big5.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big6.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big6.stderr index 1b4b76ced18bb..8c5d81e01c22d 100644 --- a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big6.stderr +++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big6.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on 1.7976931348623157E+308f64 which cannot be represented in target type `u128` - --> $DIR/float_to_int_64_too_big6.rs:LL:CC + --> tests/fail/intrinsics/float_to_int_64_too_big6.rs:LL:CC | LL | float_to_int_unchecked::(f64::MAX); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on 1.7976931348623157E+308f64 which cannot be represented in target type `u128` @@ -7,7 +7,7 @@ LL | float_to_int_unchecked::(f64::MAX); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/float_to_int_64_too_big6.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/float_to_int_64_too_big6.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big7.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big7.stderr index 47df8d90c062d..237540e2a6459 100644 --- a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big7.stderr +++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big7.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on -1.7976931348623157E+308f64 which cannot be represented in target type `i128` - --> $DIR/float_to_int_64_too_big7.rs:LL:CC + --> tests/fail/intrinsics/float_to_int_64_too_big7.rs:LL:CC | LL | float_to_int_unchecked::(f64::MIN); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on -1.7976931348623157E+308f64 which cannot be represented in target type `i128` @@ -7,7 +7,7 @@ LL | float_to_int_unchecked::(f64::MIN); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/float_to_int_64_too_big7.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/float_to_int_64_too_big7.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_small1.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_small1.stderr index c5eb405ee95c5..d1b9076d14b06 100644 --- a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_small1.stderr +++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_small1.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on -2147483649f64 which cannot be represented in target type `i32` - --> $DIR/float_to_int_64_too_small1.rs:LL:CC + --> tests/fail/intrinsics/float_to_int_64_too_small1.rs:LL:CC | LL | float_to_int_unchecked::(-2147483649.0f64); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on -2147483649f64 which cannot be represented in target type `i32` @@ -7,7 +7,7 @@ LL | float_to_int_unchecked::(-2147483649.0f64); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/float_to_int_64_too_small1.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/float_to_int_64_too_small1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_small2.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_small2.stderr index e7d12a18a2a48..bc167cd06931e 100644 --- a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_small2.stderr +++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_small2.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on -9.2233720368547778E+18f64 which cannot be represented in target type `i64` - --> $DIR/float_to_int_64_too_small2.rs:LL:CC + --> tests/fail/intrinsics/float_to_int_64_too_small2.rs:LL:CC | LL | float_to_int_unchecked::(-9223372036854777856.0f64); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on -9.2233720368547778E+18f64 which cannot be represented in target type `i64` @@ -7,7 +7,7 @@ LL | float_to_int_unchecked::(-9223372036854777856.0f64); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/float_to_int_64_too_small2.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/float_to_int_64_too_small2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_small3.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_small3.stderr index 3d8366c725b2a..60c637b02debe 100644 --- a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_small3.stderr +++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_small3.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on -2.4028236692093845E+38f64 which cannot be represented in target type `i128` - --> $DIR/float_to_int_64_too_small3.rs:LL:CC + --> tests/fail/intrinsics/float_to_int_64_too_small3.rs:LL:CC | LL | float_to_int_unchecked::(-240282366920938463463374607431768211455.0f64); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on -2.4028236692093845E+38f64 which cannot be represented in target type `i128` @@ -7,7 +7,7 @@ LL | float_to_int_unchecked::(-240282366920938463463374607431 = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/float_to_int_64_too_small3.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/float_to_int_64_too_small3.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/intrinsic_target_feature.rs b/src/tools/miri/tests/fail/intrinsics/intrinsic_target_feature.rs index eb5a16360fff8..947af681bb478 100644 --- a/src/tools/miri/tests/fail/intrinsics/intrinsic_target_feature.rs +++ b/src/tools/miri/tests/fail/intrinsics/intrinsic_target_feature.rs @@ -2,12 +2,7 @@ // Any new targets that are added to CI should be ignored here. // We cannot use `cfg`-based tricks here since the output would be // different for non-x86 targets. -//@ignore-target-aarch64 -//@ignore-target-arm -//@ignore-target-avr -//@ignore-target-s390x -//@ignore-target-thumbv7em -//@ignore-target-wasm +//@only-target: x86_64 i686 // Explicitly disable SSE4.1 because it is enabled by default on macOS //@compile-flags: -C target-feature=-sse4.1 diff --git a/src/tools/miri/tests/fail/intrinsics/intrinsic_target_feature.stderr b/src/tools/miri/tests/fail/intrinsics/intrinsic_target_feature.stderr index 8e83d20854faf..a846fc5dec3ba 100644 --- a/src/tools/miri/tests/fail/intrinsics/intrinsic_target_feature.stderr +++ b/src/tools/miri/tests/fail/intrinsics/intrinsic_target_feature.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: attempted to call intrinsic `llvm.x86.sse41.dpps` that requires missing target feature sse4.1 - --> $DIR/intrinsic_target_feature.rs:LL:CC + --> tests/fail/intrinsics/intrinsic_target_feature.rs:LL:CC | LL | dpps(_mm_setzero_ps(), _mm_setzero_ps(), 0); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempted to call intrinsic `llvm.x86.sse41.dpps` that requires missing target feature sse4.1 @@ -7,7 +7,7 @@ LL | dpps(_mm_setzero_ps(), _mm_setzero_ps(), 0); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/intrinsic_target_feature.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/intrinsic_target_feature.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_slice_data.stderr b/src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_slice_data.stderr index 6478dcc2507fa..16708ec275e28 100644 --- a/src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_slice_data.stderr +++ b/src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_slice_data.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory - --> $DIR/ptr_metadata_uninit_slice_data.rs:LL:CC + --> tests/fail/intrinsics/ptr_metadata_uninit_slice_data.rs:LL:CC | LL | RET = PtrMetadata(*p); | ^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory @@ -7,9 +7,9 @@ LL | RET = PtrMetadata(*p); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `deref_meta` at $DIR/ptr_metadata_uninit_slice_data.rs:LL:CC + = note: inside `deref_meta` at tests/fail/intrinsics/ptr_metadata_uninit_slice_data.rs:LL:CC note: inside `main` - --> $DIR/ptr_metadata_uninit_slice_data.rs:LL:CC + --> tests/fail/intrinsics/ptr_metadata_uninit_slice_data.rs:LL:CC | LL | let _meta = deref_meta(p.as_ptr().cast()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_slice_len.stderr b/src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_slice_len.stderr index 84023cf793713..ed7acfaa1e0d4 100644 --- a/src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_slice_len.stderr +++ b/src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_slice_len.stderr @@ -1,5 +1,5 @@ warning: integer-to-pointer cast - --> $DIR/ptr_metadata_uninit_slice_len.rs:LL:CC + --> tests/fail/intrinsics/ptr_metadata_uninit_slice_len.rs:LL:CC | LL | (*p.as_mut_ptr().cast::<[*const i32; 2]>())[0] = 4 as *const i32; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ integer-to-pointer cast @@ -10,10 +10,10 @@ LL | (*p.as_mut_ptr().cast::<[*const i32; 2]>())[0] = 4 as *const i32; = help: you can then set `MIRIFLAGS=-Zmiri-strict-provenance` to ensure you are not relying on `with_exposed_provenance` semantics = help: alternatively, `MIRIFLAGS=-Zmiri-permissive-provenance` disables this warning = note: BACKTRACE: - = note: inside `main` at $DIR/ptr_metadata_uninit_slice_len.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/ptr_metadata_uninit_slice_len.rs:LL:CC error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory - --> $DIR/ptr_metadata_uninit_slice_len.rs:LL:CC + --> tests/fail/intrinsics/ptr_metadata_uninit_slice_len.rs:LL:CC | LL | RET = PtrMetadata(*p); | ^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory @@ -21,9 +21,9 @@ LL | RET = PtrMetadata(*p); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `deref_meta` at $DIR/ptr_metadata_uninit_slice_len.rs:LL:CC + = note: inside `deref_meta` at tests/fail/intrinsics/ptr_metadata_uninit_slice_len.rs:LL:CC note: inside `main` - --> $DIR/ptr_metadata_uninit_slice_len.rs:LL:CC + --> tests/fail/intrinsics/ptr_metadata_uninit_slice_len.rs:LL:CC | LL | let _meta = deref_meta(p.as_ptr().cast()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_thin.stderr b/src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_thin.stderr index 0e218de0eeb5f..4e0b8d9a42991 100644 --- a/src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_thin.stderr +++ b/src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_thin.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory - --> $DIR/ptr_metadata_uninit_thin.rs:LL:CC + --> tests/fail/intrinsics/ptr_metadata_uninit_thin.rs:LL:CC | LL | RET = PtrMetadata(*p); | ^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory @@ -7,9 +7,9 @@ LL | RET = PtrMetadata(*p); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `deref_meta` at $DIR/ptr_metadata_uninit_thin.rs:LL:CC + = note: inside `deref_meta` at tests/fail/intrinsics/ptr_metadata_uninit_thin.rs:LL:CC note: inside `main` - --> $DIR/ptr_metadata_uninit_thin.rs:LL:CC + --> tests/fail/intrinsics/ptr_metadata_uninit_thin.rs:LL:CC | LL | let _meta = deref_meta(p.as_ptr()); | ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/intrinsics/ptr_offset_from_different_ints.stderr b/src/tools/miri/tests/fail/intrinsics/ptr_offset_from_different_ints.stderr index bf36c54ac781c..7ef66390fcda0 100644 --- a/src/tools/miri/tests/fail/intrinsics/ptr_offset_from_different_ints.stderr +++ b/src/tools/miri/tests/fail/intrinsics/ptr_offset_from_different_ints.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: out-of-bounds `offset_from` origin: expected a pointer to the end of 1 byte of memory, but got 0xb[noalloc] which is a dangling pointer (it has no provenance) - --> $DIR/ptr_offset_from_different_ints.rs:LL:CC + --> tests/fail/intrinsics/ptr_offset_from_different_ints.rs:LL:CC | LL | let _ = p1.byte_offset_from(p2); | ^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds `offset_from` origin: expected a pointer to the end of 1 byte of memory, but got 0xb[noalloc] which is a dangling pointer (it has no provenance) @@ -7,7 +7,7 @@ LL | let _ = p1.byte_offset_from(p2); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/ptr_offset_from_different_ints.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/ptr_offset_from_different_ints.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/ptr_offset_from_unsigned_neg.stderr b/src/tools/miri/tests/fail/intrinsics/ptr_offset_from_unsigned_neg.stderr index e436f9029d50e..a0a8e97e7fa95 100644 --- a/src/tools/miri/tests/fail/intrinsics/ptr_offset_from_unsigned_neg.stderr +++ b/src/tools/miri/tests/fail/intrinsics/ptr_offset_from_unsigned_neg.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: `ptr_offset_from_unsigned` called when first pointer has smaller address than second: $ADDR < $ADDR - --> $DIR/ptr_offset_from_unsigned_neg.rs:LL:CC + --> tests/fail/intrinsics/ptr_offset_from_unsigned_neg.rs:LL:CC | LL | let _val = unsafe { ptr1.sub_ptr(ptr2) }; | ^^^^^^^^^^^^^^^^^^ `ptr_offset_from_unsigned` called when first pointer has smaller address than second: $ADDR < $ADDR @@ -7,7 +7,7 @@ LL | let _val = unsafe { ptr1.sub_ptr(ptr2) }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/ptr_offset_from_unsigned_neg.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/ptr_offset_from_unsigned_neg.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/ptr_offset_int_plus_int.stderr b/src/tools/miri/tests/fail/intrinsics/ptr_offset_int_plus_int.stderr index 8d37da6506133..c87ce321784b5 100644 --- a/src/tools/miri/tests/fail/intrinsics/ptr_offset_int_plus_int.stderr +++ b/src/tools/miri/tests/fail/intrinsics/ptr_offset_int_plus_int.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: out-of-bounds pointer arithmetic: expected a pointer to 1 byte of memory, but got 0x1[noalloc] which is a dangling pointer (it has no provenance) - --> $DIR/ptr_offset_int_plus_int.rs:LL:CC + --> tests/fail/intrinsics/ptr_offset_int_plus_int.rs:LL:CC | LL | let _val = (1 as *mut u8).offset(1); | ^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer arithmetic: expected a pointer to 1 byte of memory, but got 0x1[noalloc] which is a dangling pointer (it has no provenance) @@ -7,7 +7,7 @@ LL | let _val = (1 as *mut u8).offset(1); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/ptr_offset_int_plus_int.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/ptr_offset_int_plus_int.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/ptr_offset_int_plus_ptr.stderr b/src/tools/miri/tests/fail/intrinsics/ptr_offset_int_plus_ptr.stderr index 2cd02bee2ca18..78239d501378f 100644 --- a/src/tools/miri/tests/fail/intrinsics/ptr_offset_int_plus_ptr.stderr +++ b/src/tools/miri/tests/fail/intrinsics/ptr_offset_int_plus_ptr.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: out-of-bounds pointer arithmetic: expected a pointer to $BYTES bytes of memory, but got 0x1[noalloc] which is a dangling pointer (it has no provenance) - --> $DIR/ptr_offset_int_plus_ptr.rs:LL:CC + --> tests/fail/intrinsics/ptr_offset_int_plus_ptr.rs:LL:CC | LL | let _val = (1 as *mut u8).offset(ptr as isize); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer arithmetic: expected a pointer to $BYTES bytes of memory, but got 0x1[noalloc] which is a dangling pointer (it has no provenance) @@ -7,7 +7,7 @@ LL | let _val = (1 as *mut u8).offset(ptr as isize); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/ptr_offset_int_plus_ptr.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/ptr_offset_int_plus_ptr.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/ptr_offset_out_of_bounds.stderr b/src/tools/miri/tests/fail/intrinsics/ptr_offset_out_of_bounds.stderr index c4548200f0596..4f6b45b897b45 100644 --- a/src/tools/miri/tests/fail/intrinsics/ptr_offset_out_of_bounds.stderr +++ b/src/tools/miri/tests/fail/intrinsics/ptr_offset_out_of_bounds.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: out-of-bounds pointer arithmetic: expected a pointer to 5 bytes of memory, but got ALLOC which is only 4 bytes from the end of the allocation - --> $DIR/ptr_offset_out_of_bounds.rs:LL:CC + --> tests/fail/intrinsics/ptr_offset_out_of_bounds.rs:LL:CC | LL | let x = unsafe { x.offset(5) }; | ^^^^^^^^^^^ out-of-bounds pointer arithmetic: expected a pointer to 5 bytes of memory, but got ALLOC which is only 4 bytes from the end of the allocation @@ -7,12 +7,12 @@ LL | let x = unsafe { x.offset(5) }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information help: ALLOC was allocated here: - --> $DIR/ptr_offset_out_of_bounds.rs:LL:CC + --> tests/fail/intrinsics/ptr_offset_out_of_bounds.rs:LL:CC | LL | let v = [0i8; 4]; | ^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/ptr_offset_out_of_bounds.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/ptr_offset_out_of_bounds.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/ptr_offset_out_of_bounds_neg.stderr b/src/tools/miri/tests/fail/intrinsics/ptr_offset_out_of_bounds_neg.stderr index 8041e1542c68d..2dd4c943e864d 100644 --- a/src/tools/miri/tests/fail/intrinsics/ptr_offset_out_of_bounds_neg.stderr +++ b/src/tools/miri/tests/fail/intrinsics/ptr_offset_out_of_bounds_neg.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: out-of-bounds pointer arithmetic: expected a pointer to the end of 1 byte of memory, but got ALLOC which is at the beginning of the allocation - --> $DIR/ptr_offset_out_of_bounds_neg.rs:LL:CC + --> tests/fail/intrinsics/ptr_offset_out_of_bounds_neg.rs:LL:CC | LL | let x = unsafe { x.offset(-1) }; | ^^^^^^^^^^^^ out-of-bounds pointer arithmetic: expected a pointer to the end of 1 byte of memory, but got ALLOC which is at the beginning of the allocation @@ -7,12 +7,12 @@ LL | let x = unsafe { x.offset(-1) }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information help: ALLOC was allocated here: - --> $DIR/ptr_offset_out_of_bounds_neg.rs:LL:CC + --> tests/fail/intrinsics/ptr_offset_out_of_bounds_neg.rs:LL:CC | LL | let v = [0i8; 4]; | ^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/ptr_offset_out_of_bounds_neg.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/ptr_offset_out_of_bounds_neg.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/ptr_offset_overflow.stderr b/src/tools/miri/tests/fail/intrinsics/ptr_offset_overflow.stderr index ee5aebc6eaeef..d03c9f870e24a 100644 --- a/src/tools/miri/tests/fail/intrinsics/ptr_offset_overflow.stderr +++ b/src/tools/miri/tests/fail/intrinsics/ptr_offset_overflow.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: out-of-bounds pointer arithmetic: expected a pointer to the end of $BYTES bytes of memory, but got ALLOC which is at the beginning of the allocation - --> $DIR/ptr_offset_overflow.rs:LL:CC + --> tests/fail/intrinsics/ptr_offset_overflow.rs:LL:CC | LL | let x = unsafe { x.offset(isize::MIN) }; | ^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer arithmetic: expected a pointer to the end of $BYTES bytes of memory, but got ALLOC which is at the beginning of the allocation @@ -7,12 +7,12 @@ LL | let x = unsafe { x.offset(isize::MIN) }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information help: ALLOC was allocated here: - --> $DIR/ptr_offset_overflow.rs:LL:CC + --> tests/fail/intrinsics/ptr_offset_overflow.rs:LL:CC | LL | let v = [0i8; 4]; | ^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/ptr_offset_overflow.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/ptr_offset_overflow.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/ptr_offset_unsigned_overflow.stderr b/src/tools/miri/tests/fail/intrinsics/ptr_offset_unsigned_overflow.stderr index 43cd80a6d3e27..a5f046ec4030a 100644 --- a/src/tools/miri/tests/fail/intrinsics/ptr_offset_unsigned_overflow.stderr +++ b/src/tools/miri/tests/fail/intrinsics/ptr_offset_unsigned_overflow.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: overflowing pointer arithmetic: the total offset in bytes does not fit in an `isize` - --> $DIR/ptr_offset_unsigned_overflow.rs:LL:CC + --> tests/fail/intrinsics/ptr_offset_unsigned_overflow.rs:LL:CC | LL | unsafe { x.byte_add(!0).read() }; | ^^^^^^^^^^^^^^ overflowing pointer arithmetic: the total offset in bytes does not fit in an `isize` @@ -7,7 +7,7 @@ LL | unsafe { x.byte_add(!0).read() }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/ptr_offset_unsigned_overflow.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/ptr_offset_unsigned_overflow.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/rem-by-zero.stderr b/src/tools/miri/tests/fail/intrinsics/rem-by-zero.stderr index 9b9fe4da13998..cb5ddc80ddacf 100644 --- a/src/tools/miri/tests/fail/intrinsics/rem-by-zero.stderr +++ b/src/tools/miri/tests/fail/intrinsics/rem-by-zero.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: calculating the remainder with a divisor of zero - --> $DIR/rem-by-zero.rs:LL:CC + --> tests/fail/intrinsics/rem-by-zero.rs:LL:CC | LL | let _n = unchecked_rem(3u32, 0); | ^^^^^^^^^^^^^^^^^^^^^^ calculating the remainder with a divisor of zero @@ -7,7 +7,7 @@ LL | let _n = unchecked_rem(3u32, 0); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/rem-by-zero.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/rem-by-zero.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/simd-div-by-zero.stderr b/src/tools/miri/tests/fail/intrinsics/simd-div-by-zero.stderr index 44d3749d68265..b3579758f8fb9 100644 --- a/src/tools/miri/tests/fail/intrinsics/simd-div-by-zero.stderr +++ b/src/tools/miri/tests/fail/intrinsics/simd-div-by-zero.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: dividing by zero - --> $DIR/simd-div-by-zero.rs:LL:CC + --> tests/fail/intrinsics/simd-div-by-zero.rs:LL:CC | LL | simd_div(x, y); | ^^^^^^^^^^^^^^ dividing by zero @@ -7,7 +7,7 @@ LL | simd_div(x, y); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/simd-div-by-zero.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/simd-div-by-zero.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/simd-div-overflow.stderr b/src/tools/miri/tests/fail/intrinsics/simd-div-overflow.stderr index 85058b008eed4..1144f8cf706e7 100644 --- a/src/tools/miri/tests/fail/intrinsics/simd-div-overflow.stderr +++ b/src/tools/miri/tests/fail/intrinsics/simd-div-overflow.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: overflow in signed division (dividing MIN by -1) - --> $DIR/simd-div-overflow.rs:LL:CC + --> tests/fail/intrinsics/simd-div-overflow.rs:LL:CC | LL | simd_div(x, y); | ^^^^^^^^^^^^^^ overflow in signed division (dividing MIN by -1) @@ -7,7 +7,7 @@ LL | simd_div(x, y); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/simd-div-overflow.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/simd-div-overflow.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/simd-extract.stderr b/src/tools/miri/tests/fail/intrinsics/simd-extract.stderr index dc6b22de4925a..fdf08e8303f0a 100644 --- a/src/tools/miri/tests/fail/intrinsics/simd-extract.stderr +++ b/src/tools/miri/tests/fail/intrinsics/simd-extract.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: `simd_extract` index 4 is out-of-bounds of vector with length 4 - --> $DIR/simd-extract.rs:LL:CC + --> tests/fail/intrinsics/simd-extract.rs:LL:CC | LL | let _x: i32 = unsafe { std::intrinsics::simd::simd_extract(v, 4) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `simd_extract` index 4 is out-of-bounds of vector with length 4 @@ -7,7 +7,7 @@ LL | let _x: i32 = unsafe { std::intrinsics::simd::simd_extract(v, 4) }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/simd-extract.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/simd-extract.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/simd-float-to-int.stderr b/src/tools/miri/tests/fail/intrinsics/simd-float-to-int.stderr index d75fefe1ded24..e34ebd3d7f7a6 100644 --- a/src/tools/miri/tests/fail/intrinsics/simd-float-to-int.stderr +++ b/src/tools/miri/tests/fail/intrinsics/simd-float-to-int.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: `simd_cast` intrinsic called on 3.40282347E+38f32 which cannot be represented in target type `i32` - --> $DIR/simd-float-to-int.rs:LL:CC + --> tests/fail/intrinsics/simd-float-to-int.rs:LL:CC | LL | let _x: i32x2 = f32x2::from_array([f32::MAX, f32::MIN]).to_int_unchecked(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `simd_cast` intrinsic called on 3.40282347E+38f32 which cannot be represented in target type `i32` @@ -7,7 +7,7 @@ LL | let _x: i32x2 = f32x2::from_array([f32::MAX, f32::MIN]).to_int_unch = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/simd-float-to-int.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/simd-float-to-int.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/simd-gather.stderr b/src/tools/miri/tests/fail/intrinsics/simd-gather.stderr index bc8d0b041d321..ee1c900961080 100644 --- a/src/tools/miri/tests/fail/intrinsics/simd-gather.stderr +++ b/src/tools/miri/tests/fail/intrinsics/simd-gather.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: memory access failed: expected a pointer to 1 byte of memory, but got ALLOC+0x9 which is at or beyond the end of the allocation of size 9 bytes - --> $DIR/simd-gather.rs:LL:CC + --> tests/fail/intrinsics/simd-gather.rs:LL:CC | LL | let _result = Simd::gather_select_unchecked(&vec, Mask::splat(true), idxs, Simd::splat(0)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: expected a pointer to 1 byte of memory, but got ALLOC+0x9 which is at or beyond the end of the allocation of size 9 bytes @@ -7,7 +7,7 @@ LL | let _result = Simd::gather_select_unchecked(&vec, Mask::splat(true) = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/simd-gather.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/simd-gather.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/simd-reduce-invalid-bool.stderr b/src/tools/miri/tests/fail/intrinsics/simd-reduce-invalid-bool.stderr index b6c43d34b9de4..db76897faed27 100644 --- a/src/tools/miri/tests/fail/intrinsics/simd-reduce-invalid-bool.stderr +++ b/src/tools/miri/tests/fail/intrinsics/simd-reduce-invalid-bool.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: each element of a SIMD mask must be all-0-bits or all-1-bits - --> $DIR/simd-reduce-invalid-bool.rs:LL:CC + --> tests/fail/intrinsics/simd-reduce-invalid-bool.rs:LL:CC | LL | simd_reduce_any(x); | ^^^^^^^^^^^^^^^^^^ each element of a SIMD mask must be all-0-bits or all-1-bits @@ -7,7 +7,7 @@ LL | simd_reduce_any(x); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/simd-reduce-invalid-bool.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/simd-reduce-invalid-bool.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/simd-rem-by-zero.stderr b/src/tools/miri/tests/fail/intrinsics/simd-rem-by-zero.stderr index d29d22d8aef05..ec136a62ff2c2 100644 --- a/src/tools/miri/tests/fail/intrinsics/simd-rem-by-zero.stderr +++ b/src/tools/miri/tests/fail/intrinsics/simd-rem-by-zero.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: calculating the remainder with a divisor of zero - --> $DIR/simd-rem-by-zero.rs:LL:CC + --> tests/fail/intrinsics/simd-rem-by-zero.rs:LL:CC | LL | simd_rem(x, y); | ^^^^^^^^^^^^^^ calculating the remainder with a divisor of zero @@ -7,7 +7,7 @@ LL | simd_rem(x, y); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/simd-rem-by-zero.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/simd-rem-by-zero.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/simd-scatter.stderr b/src/tools/miri/tests/fail/intrinsics/simd-scatter.stderr index aae77edcb6bd7..aaacb94f458df 100644 --- a/src/tools/miri/tests/fail/intrinsics/simd-scatter.stderr +++ b/src/tools/miri/tests/fail/intrinsics/simd-scatter.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: memory access failed: expected a pointer to 1 byte of memory, but got ALLOC+0x9 which is at or beyond the end of the allocation of size 9 bytes - --> $DIR/simd-scatter.rs:LL:CC + --> tests/fail/intrinsics/simd-scatter.rs:LL:CC | LL | / Simd::from_array([-27, 82, -41, 124]).scatter_select_unchecked( LL | | @@ -12,12 +12,12 @@ LL | | ); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information help: ALLOC was allocated here: - --> $DIR/simd-scatter.rs:LL:CC + --> tests/fail/intrinsics/simd-scatter.rs:LL:CC | LL | let mut vec: Vec = vec![10, 11, 12, 13, 14, 15, 16, 17, 18]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/simd-scatter.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/simd-scatter.rs:LL:CC = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info) note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/simd-select-bitmask-invalid.stderr b/src/tools/miri/tests/fail/intrinsics/simd-select-bitmask-invalid.stderr index 1f978e13bb9b1..9acb51d8c5f36 100644 --- a/src/tools/miri/tests/fail/intrinsics/simd-select-bitmask-invalid.stderr +++ b/src/tools/miri/tests/fail/intrinsics/simd-select-bitmask-invalid.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: a SIMD bitmask less than 8 bits long must be filled with 0s for the remaining bits - --> $DIR/simd-select-bitmask-invalid.rs:LL:CC + --> tests/fail/intrinsics/simd-select-bitmask-invalid.rs:LL:CC | LL | simd_select_bitmask(0b11111111u8, x, x); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ a SIMD bitmask less than 8 bits long must be filled with 0s for the remaining bits @@ -7,7 +7,7 @@ LL | simd_select_bitmask(0b11111111u8, x, x); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/simd-select-bitmask-invalid.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/simd-select-bitmask-invalid.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/simd-select-invalid-bool.stderr b/src/tools/miri/tests/fail/intrinsics/simd-select-invalid-bool.stderr index e0c0547483103..52b497046d0d0 100644 --- a/src/tools/miri/tests/fail/intrinsics/simd-select-invalid-bool.stderr +++ b/src/tools/miri/tests/fail/intrinsics/simd-select-invalid-bool.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: each element of a SIMD mask must be all-0-bits or all-1-bits - --> $DIR/simd-select-invalid-bool.rs:LL:CC + --> tests/fail/intrinsics/simd-select-invalid-bool.rs:LL:CC | LL | simd_select(x, x, x); | ^^^^^^^^^^^^^^^^^^^^ each element of a SIMD mask must be all-0-bits or all-1-bits @@ -7,7 +7,7 @@ LL | simd_select(x, x, x); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/simd-select-invalid-bool.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/simd-select-invalid-bool.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/simd-shl-too-far.stderr b/src/tools/miri/tests/fail/intrinsics/simd-shl-too-far.stderr index 475067db801e2..f7dfd0743f174 100644 --- a/src/tools/miri/tests/fail/intrinsics/simd-shl-too-far.stderr +++ b/src/tools/miri/tests/fail/intrinsics/simd-shl-too-far.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: overflowing shift by 100 in `simd_shl` in lane 0 - --> $DIR/simd-shl-too-far.rs:LL:CC + --> tests/fail/intrinsics/simd-shl-too-far.rs:LL:CC | LL | simd_shl(x, y); | ^^^^^^^^^^^^^^ overflowing shift by 100 in `simd_shl` in lane 0 @@ -7,7 +7,7 @@ LL | simd_shl(x, y); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/simd-shl-too-far.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/simd-shl-too-far.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/simd-shr-too-far.stderr b/src/tools/miri/tests/fail/intrinsics/simd-shr-too-far.stderr index 0d6307837deb5..52259635d2170 100644 --- a/src/tools/miri/tests/fail/intrinsics/simd-shr-too-far.stderr +++ b/src/tools/miri/tests/fail/intrinsics/simd-shr-too-far.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: overflowing shift by 40 in `simd_shr` in lane 1 - --> $DIR/simd-shr-too-far.rs:LL:CC + --> tests/fail/intrinsics/simd-shr-too-far.rs:LL:CC | LL | simd_shr(x, y); | ^^^^^^^^^^^^^^ overflowing shift by 40 in `simd_shr` in lane 1 @@ -7,7 +7,7 @@ LL | simd_shr(x, y); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/simd-shr-too-far.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/simd-shr-too-far.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/typed-swap-invalid-array.stderr b/src/tools/miri/tests/fail/intrinsics/typed-swap-invalid-array.stderr index 15f01c1c095ef..20b20412e75ab 100644 --- a/src/tools/miri/tests/fail/intrinsics/typed-swap-invalid-array.stderr +++ b/src/tools/miri/tests/fail/intrinsics/typed-swap-invalid-array.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value at [0]: encountered 0x02, but expected a boolean - --> $DIR/typed-swap-invalid-array.rs:LL:CC + --> tests/fail/intrinsics/typed-swap-invalid-array.rs:LL:CC | LL | typed_swap(a, b); | ^^^^^^^^^^^^^^^^ constructing invalid value at [0]: encountered 0x02, but expected a boolean @@ -7,9 +7,9 @@ LL | typed_swap(a, b); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `invalid_array` at $DIR/typed-swap-invalid-array.rs:LL:CC + = note: inside `invalid_array` at tests/fail/intrinsics/typed-swap-invalid-array.rs:LL:CC note: inside `main` - --> $DIR/typed-swap-invalid-array.rs:LL:CC + --> tests/fail/intrinsics/typed-swap-invalid-array.rs:LL:CC | LL | invalid_array(); | ^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/intrinsics/typed-swap-invalid-scalar.stderr b/src/tools/miri/tests/fail/intrinsics/typed-swap-invalid-scalar.stderr index 262ca202f9f47..6062465f36a6f 100644 --- a/src/tools/miri/tests/fail/intrinsics/typed-swap-invalid-scalar.stderr +++ b/src/tools/miri/tests/fail/intrinsics/typed-swap-invalid-scalar.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value: encountered 0x02, but expected a boolean - --> $DIR/typed-swap-invalid-scalar.rs:LL:CC + --> tests/fail/intrinsics/typed-swap-invalid-scalar.rs:LL:CC | LL | typed_swap(a, b); | ^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x02, but expected a boolean @@ -7,9 +7,9 @@ LL | typed_swap(a, b); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `invalid_scalar` at $DIR/typed-swap-invalid-scalar.rs:LL:CC + = note: inside `invalid_scalar` at tests/fail/intrinsics/typed-swap-invalid-scalar.rs:LL:CC note: inside `main` - --> $DIR/typed-swap-invalid-scalar.rs:LL:CC + --> tests/fail/intrinsics/typed-swap-invalid-scalar.rs:LL:CC | LL | invalid_scalar(); | ^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/intrinsics/unchecked_add1.stderr b/src/tools/miri/tests/fail/intrinsics/unchecked_add1.stderr index eae9ec7a44dcd..f6fe453587fc5 100644 --- a/src/tools/miri/tests/fail/intrinsics/unchecked_add1.stderr +++ b/src/tools/miri/tests/fail/intrinsics/unchecked_add1.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: arithmetic overflow in `unchecked_add` - --> $DIR/unchecked_add1.rs:LL:CC + --> tests/fail/intrinsics/unchecked_add1.rs:LL:CC | LL | let _val = unsafe { 40000u16.unchecked_add(30000) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ arithmetic overflow in `unchecked_add` @@ -7,7 +7,7 @@ LL | let _val = unsafe { 40000u16.unchecked_add(30000) }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/unchecked_add1.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/unchecked_add1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/unchecked_add2.stderr b/src/tools/miri/tests/fail/intrinsics/unchecked_add2.stderr index 6a0dcfcd227e7..0fd1e8ff91c17 100644 --- a/src/tools/miri/tests/fail/intrinsics/unchecked_add2.stderr +++ b/src/tools/miri/tests/fail/intrinsics/unchecked_add2.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: arithmetic overflow in `unchecked_add` - --> $DIR/unchecked_add2.rs:LL:CC + --> tests/fail/intrinsics/unchecked_add2.rs:LL:CC | LL | let _val = unsafe { (-30000i16).unchecked_add(-8000) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ arithmetic overflow in `unchecked_add` @@ -7,7 +7,7 @@ LL | let _val = unsafe { (-30000i16).unchecked_add(-8000) }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/unchecked_add2.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/unchecked_add2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/unchecked_div1.stderr b/src/tools/miri/tests/fail/intrinsics/unchecked_div1.stderr index 9dc4bcaee2f9f..f7aef4914e294 100644 --- a/src/tools/miri/tests/fail/intrinsics/unchecked_div1.stderr +++ b/src/tools/miri/tests/fail/intrinsics/unchecked_div1.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: overflow in signed division (dividing MIN by -1) - --> $DIR/unchecked_div1.rs:LL:CC + --> tests/fail/intrinsics/unchecked_div1.rs:LL:CC | LL | std::intrinsics::unchecked_div(i16::MIN, -1); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflow in signed division (dividing MIN by -1) @@ -7,7 +7,7 @@ LL | std::intrinsics::unchecked_div(i16::MIN, -1); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/unchecked_div1.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/unchecked_div1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/unchecked_mul1.stderr b/src/tools/miri/tests/fail/intrinsics/unchecked_mul1.stderr index e37d9827c8cf6..ad7bbaebeecae 100644 --- a/src/tools/miri/tests/fail/intrinsics/unchecked_mul1.stderr +++ b/src/tools/miri/tests/fail/intrinsics/unchecked_mul1.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: arithmetic overflow in `unchecked_mul` - --> $DIR/unchecked_mul1.rs:LL:CC + --> tests/fail/intrinsics/unchecked_mul1.rs:LL:CC | LL | let _val = unsafe { 300u16.unchecked_mul(250u16) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ arithmetic overflow in `unchecked_mul` @@ -7,7 +7,7 @@ LL | let _val = unsafe { 300u16.unchecked_mul(250u16) }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/unchecked_mul1.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/unchecked_mul1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/unchecked_mul2.stderr b/src/tools/miri/tests/fail/intrinsics/unchecked_mul2.stderr index 949077ce61d8c..75de5d2338dc7 100644 --- a/src/tools/miri/tests/fail/intrinsics/unchecked_mul2.stderr +++ b/src/tools/miri/tests/fail/intrinsics/unchecked_mul2.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: arithmetic overflow in `unchecked_mul` - --> $DIR/unchecked_mul2.rs:LL:CC + --> tests/fail/intrinsics/unchecked_mul2.rs:LL:CC | LL | let _val = unsafe { 1_000_000_000i32.unchecked_mul(-4) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ arithmetic overflow in `unchecked_mul` @@ -7,7 +7,7 @@ LL | let _val = unsafe { 1_000_000_000i32.unchecked_mul(-4) }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/unchecked_mul2.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/unchecked_mul2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/unchecked_shl.stderr b/src/tools/miri/tests/fail/intrinsics/unchecked_shl.stderr index f30cf4479e6be..fcf6e1aea0cd2 100644 --- a/src/tools/miri/tests/fail/intrinsics/unchecked_shl.stderr +++ b/src/tools/miri/tests/fail/intrinsics/unchecked_shl.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: overflowing shift by 8 in `unchecked_shl` - --> $DIR/unchecked_shl.rs:LL:CC + --> tests/fail/intrinsics/unchecked_shl.rs:LL:CC | LL | let _n = 1i8.unchecked_shl(8); | ^^^^^^^^^^^^^^^^^^^^ overflowing shift by 8 in `unchecked_shl` @@ -7,7 +7,7 @@ LL | let _n = 1i8.unchecked_shl(8); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/unchecked_shl.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/unchecked_shl.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/unchecked_shl2.stderr b/src/tools/miri/tests/fail/intrinsics/unchecked_shl2.stderr index a572f34b92cdb..c38139e4c2947 100644 --- a/src/tools/miri/tests/fail/intrinsics/unchecked_shl2.stderr +++ b/src/tools/miri/tests/fail/intrinsics/unchecked_shl2.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: overflowing shift by -1 in `unchecked_shl` - --> $DIR/unchecked_shl2.rs:LL:CC + --> tests/fail/intrinsics/unchecked_shl2.rs:LL:CC | LL | let _n = intrinsics::unchecked_shl(1i8, -1); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by -1 in `unchecked_shl` @@ -7,7 +7,7 @@ LL | let _n = intrinsics::unchecked_shl(1i8, -1); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/unchecked_shl2.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/unchecked_shl2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/unchecked_shr.stderr b/src/tools/miri/tests/fail/intrinsics/unchecked_shr.stderr index 22e0b1a0d9e32..e95227fe89fd1 100644 --- a/src/tools/miri/tests/fail/intrinsics/unchecked_shr.stderr +++ b/src/tools/miri/tests/fail/intrinsics/unchecked_shr.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: overflowing shift by 64 in `unchecked_shr` - --> $DIR/unchecked_shr.rs:LL:CC + --> tests/fail/intrinsics/unchecked_shr.rs:LL:CC | LL | let _n = 1i64.unchecked_shr(64); | ^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 64 in `unchecked_shr` @@ -7,7 +7,7 @@ LL | let _n = 1i64.unchecked_shr(64); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/unchecked_shr.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/unchecked_shr.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/unchecked_sub1.stderr b/src/tools/miri/tests/fail/intrinsics/unchecked_sub1.stderr index 39bfd8a238404..fdd30186c3c8b 100644 --- a/src/tools/miri/tests/fail/intrinsics/unchecked_sub1.stderr +++ b/src/tools/miri/tests/fail/intrinsics/unchecked_sub1.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: arithmetic overflow in `unchecked_sub` - --> $DIR/unchecked_sub1.rs:LL:CC + --> tests/fail/intrinsics/unchecked_sub1.rs:LL:CC | LL | let _val = unsafe { 14u32.unchecked_sub(22) }; | ^^^^^^^^^^^^^^^^^^^^^^^ arithmetic overflow in `unchecked_sub` @@ -7,7 +7,7 @@ LL | let _val = unsafe { 14u32.unchecked_sub(22) }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/unchecked_sub1.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/unchecked_sub1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/unchecked_sub2.stderr b/src/tools/miri/tests/fail/intrinsics/unchecked_sub2.stderr index 604eba99e0147..c27bb32c9da64 100644 --- a/src/tools/miri/tests/fail/intrinsics/unchecked_sub2.stderr +++ b/src/tools/miri/tests/fail/intrinsics/unchecked_sub2.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: arithmetic overflow in `unchecked_sub` - --> $DIR/unchecked_sub2.rs:LL:CC + --> tests/fail/intrinsics/unchecked_sub2.rs:LL:CC | LL | let _val = unsafe { 30000i16.unchecked_sub(-7000) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ arithmetic overflow in `unchecked_sub` @@ -7,7 +7,7 @@ LL | let _val = unsafe { 30000i16.unchecked_sub(-7000) }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/unchecked_sub2.rs:LL:CC + = note: inside `main` at tests/fail/intrinsics/unchecked_sub2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/uninit_uninhabited_type.stderr b/src/tools/miri/tests/fail/intrinsics/uninit_uninhabited_type.stderr index 67fd60e572ede..ffc3a3eae9605 100644 --- a/src/tools/miri/tests/fail/intrinsics/uninit_uninhabited_type.stderr +++ b/src/tools/miri/tests/fail/intrinsics/uninit_uninhabited_type.stderr @@ -17,7 +17,7 @@ LL | ABORT(); = note: inside `std::panicking::begin_panic_handler` at RUSTLIB/std/src/panicking.rs:LL:CC = note: inside `core::panicking::panic_nounwind` at RUSTLIB/core/src/panicking.rs:LL:CC note: inside `main` - --> $DIR/uninit_uninhabited_type.rs:LL:CC + --> tests/fail/intrinsics/uninit_uninhabited_type.rs:LL:CC | LL | let _ = unsafe { std::mem::uninitialized::() }; | ^ diff --git a/src/tools/miri/tests/fail/intrinsics/write_bytes_overflow.stderr b/src/tools/miri/tests/fail/intrinsics/write_bytes_overflow.stderr index 326c180fadbac..71f53a319920b 100644 --- a/src/tools/miri/tests/fail/intrinsics/write_bytes_overflow.stderr +++ b/src/tools/miri/tests/fail/intrinsics/write_bytes_overflow.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: overflow computing total size of `write_bytes` - --> $DIR/write_bytes_overflow.rs:LL:CC + --> tests/fail/intrinsics/write_bytes_overflow.rs:LL:CC | LL | (&mut y as *mut i32).write_bytes(0u8, 1usize << (mem::size_of::() * 8 - 1)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflow computing total size of `write_bytes` @@ -7,7 +7,7 @@ LL | (&mut y as *mut i32).write_bytes(0u8, 1usize << (mem::size_of:: $DIR/zero_fn_ptr.rs:LL:CC + --> tests/fail/intrinsics/zero_fn_ptr.rs:LL:CC | LL | let _ = unsafe { std::mem::zeroed::() }; | ^ diff --git a/src/tools/miri/tests/fail/issue-miri-1112.stderr b/src/tools/miri/tests/fail/issue-miri-1112.stderr index 7ac65c152e952..ffbbd269216e8 100644 --- a/src/tools/miri/tests/fail/issue-miri-1112.stderr +++ b/src/tools/miri/tests/fail/issue-miri-1112.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value: encountered $HEX[ALLOC], but expected a vtable pointer - --> $DIR/issue-miri-1112.rs:LL:CC + --> tests/fail/issue-miri-1112.rs:LL:CC | LL | let obj = std::mem::transmute::(obj); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered $HEX[ALLOC], but expected a vtable pointer @@ -7,9 +7,9 @@ LL | let obj = std::mem::transmute::(obj) = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `FunnyPointer::from_data_ptr` at $DIR/issue-miri-1112.rs:LL:CC + = note: inside `FunnyPointer::from_data_ptr` at tests/fail/issue-miri-1112.rs:LL:CC note: inside `main` - --> $DIR/issue-miri-1112.rs:LL:CC + --> tests/fail/issue-miri-1112.rs:LL:CC | LL | let _raw: &FunnyPointer = FunnyPointer::from_data_ptr(&hello, &meta as *const _); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/issue-miri-3288-ice-symbolic-alignment-extern-static.stderr b/src/tools/miri/tests/fail/issue-miri-3288-ice-symbolic-alignment-extern-static.stderr index 4064d7fe4e953..91f9095955087 100644 --- a/src/tools/miri/tests/fail/issue-miri-3288-ice-symbolic-alignment-extern-static.stderr +++ b/src/tools/miri/tests/fail/issue-miri-3288-ice-symbolic-alignment-extern-static.stderr @@ -1,12 +1,12 @@ error: unsupported operation: extern static `_dispatch_queue_attr_concurrent` is not supported by Miri - --> $DIR/issue-miri-3288-ice-symbolic-alignment-extern-static.rs:LL:CC + --> tests/fail/issue-miri-3288-ice-symbolic-alignment-extern-static.rs:LL:CC | LL | let _val = *DISPATCH_QUEUE_CONCURRENT; | ^^^^^^^^^^^^^^^^^^^^^^^^^ extern static `_dispatch_queue_attr_concurrent` is not supported by Miri | = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support = note: BACKTRACE: - = note: inside `main` at $DIR/issue-miri-3288-ice-symbolic-alignment-extern-static.rs:LL:CC + = note: inside `main` at tests/fail/issue-miri-3288-ice-symbolic-alignment-extern-static.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/layout_cycle.stderr b/src/tools/miri/tests/fail/layout_cycle.stderr index cc343d6431fc6..9f53de3523988 100644 --- a/src/tools/miri/tests/fail/layout_cycle.stderr +++ b/src/tools/miri/tests/fail/layout_cycle.stderr @@ -13,12 +13,12 @@ LL | intrinsics::size_of::() = note: BACKTRACE: = note: inside `std::mem::size_of::>>` at RUSTLIB/core/src/mem/mod.rs:LL:CC note: inside `foo::>` - --> $DIR/layout_cycle.rs:LL:CC + --> tests/fail/layout_cycle.rs:LL:CC | LL | mem::size_of::>() | ^^^^^^^^^^^^^^^^^^^^^^ note: inside `main` - --> $DIR/layout_cycle.rs:LL:CC + --> tests/fail/layout_cycle.rs:LL:CC | LL | println!("{}", foo::>()); | ^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/memleak.stderr b/src/tools/miri/tests/fail/memleak.stderr index d30322551660b..89db0f1eb1628 100644 --- a/src/tools/miri/tests/fail/memleak.stderr +++ b/src/tools/miri/tests/fail/memleak.stderr @@ -1,11 +1,11 @@ error: memory leaked: ALLOC (Rust heap, size: 4, align: 4), allocated here: - --> $DIR/memleak.rs:LL:CC + --> tests/fail/memleak.rs:LL:CC | LL | std::mem::forget(Box::new(42)); | ^^^^^^^^^^^^ | = note: BACKTRACE: - = note: inside `main` at $DIR/memleak.rs:LL:CC + = note: inside `main` at tests/fail/memleak.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/memleak_rc.stderr b/src/tools/miri/tests/fail/memleak_rc.stderr index 91166384adcaa..820e10743bc51 100644 --- a/src/tools/miri/tests/fail/memleak_rc.stderr +++ b/src/tools/miri/tests/fail/memleak_rc.stderr @@ -7,7 +7,7 @@ LL | Box::leak(Box::new(RcBox { strong: Cell::new(1), weak: Cell = note: BACKTRACE: = note: inside `std::rc::Rc::>>::new` at RUSTLIB/alloc/src/rc.rs:LL:CC note: inside `main` - --> $DIR/memleak_rc.rs:LL:CC + --> tests/fail/memleak_rc.rs:LL:CC | LL | let x = Dummy(Rc::new(RefCell::new(None))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/miri_start_wrong_sig.stderr b/src/tools/miri/tests/fail/miri_start_wrong_sig.stderr index 6217191711658..4c60f3be0d246 100644 --- a/src/tools/miri/tests/fail/miri_start_wrong_sig.stderr +++ b/src/tools/miri/tests/fail/miri_start_wrong_sig.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/miri_start_wrong_sig.rs:LL:CC + --> tests/fail/miri_start_wrong_sig.rs:LL:CC | LL | fn miri_start() -> isize { | ^^^^^^^^^^^^^^^^^^^^^^^^ incorrect number of function parameters diff --git a/src/tools/miri/tests/fail/modifying_constants.stderr b/src/tools/miri/tests/fail/modifying_constants.stderr index c1eca7866ad13..2d8e4dfd8a5df 100644 --- a/src/tools/miri/tests/fail/modifying_constants.stderr +++ b/src/tools/miri/tests/fail/modifying_constants.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: writing to ALLOC which is read-only - --> $DIR/modifying_constants.rs:LL:CC + --> tests/fail/modifying_constants.rs:LL:CC | LL | *y = 42; | ^^^^^^^ writing to ALLOC which is read-only @@ -7,7 +7,7 @@ LL | *y = 42; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/modifying_constants.rs:LL:CC + = note: inside `main` at tests/fail/modifying_constants.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/never_match_never.stderr b/src/tools/miri/tests/fail/never_match_never.stderr index 751894f19859a..e59a028b15b6a 100644 --- a/src/tools/miri/tests/fail/never_match_never.stderr +++ b/src/tools/miri/tests/fail/never_match_never.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: entering unreachable code - --> $DIR/never_match_never.rs:LL:CC + --> tests/fail/never_match_never.rs:LL:CC | LL | unsafe { match (*ptr).1 {} } | ^^^^^^^^ entering unreachable code @@ -7,7 +7,7 @@ LL | unsafe { match (*ptr).1 {} } = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/never_match_never.rs:LL:CC + = note: inside `main` at tests/fail/never_match_never.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/never_say_never.stderr b/src/tools/miri/tests/fail/never_say_never.stderr index 1720cc893ab45..7d2952003b217 100644 --- a/src/tools/miri/tests/fail/never_say_never.stderr +++ b/src/tools/miri/tests/fail/never_say_never.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: entering unreachable code - --> $DIR/never_say_never.rs:LL:CC + --> tests/fail/never_say_never.rs:LL:CC | LL | f(x) | ^^^^ entering unreachable code @@ -7,7 +7,7 @@ LL | f(x) = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/never_say_never.rs:LL:CC + = note: inside `main` at tests/fail/never_say_never.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/never_transmute_humans.stderr b/src/tools/miri/tests/fail/never_transmute_humans.stderr index 6916c93599506..a00c244841eef 100644 --- a/src/tools/miri/tests/fail/never_transmute_humans.stderr +++ b/src/tools/miri/tests/fail/never_transmute_humans.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: entering unreachable code - --> $DIR/never_transmute_humans.rs:LL:CC + --> tests/fail/never_transmute_humans.rs:LL:CC | LL | std::mem::transmute::(Human) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ entering unreachable code @@ -7,7 +7,7 @@ LL | std::mem::transmute::(Human) = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/never_transmute_humans.rs:LL:CC + = note: inside `main` at tests/fail/never_transmute_humans.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/never_transmute_void.stderr b/src/tools/miri/tests/fail/never_transmute_void.stderr index 4ca306373a1e1..1906a68bffee3 100644 --- a/src/tools/miri/tests/fail/never_transmute_void.stderr +++ b/src/tools/miri/tests/fail/never_transmute_void.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: entering unreachable code - --> $DIR/never_transmute_void.rs:LL:CC + --> tests/fail/never_transmute_void.rs:LL:CC | LL | match v.0 {} | ^^^ entering unreachable code @@ -7,9 +7,9 @@ LL | match v.0 {} = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `m::f` at $DIR/never_transmute_void.rs:LL:CC + = note: inside `m::f` at tests/fail/never_transmute_void.rs:LL:CC note: inside `main` - --> $DIR/never_transmute_void.rs:LL:CC + --> tests/fail/never_transmute_void.rs:LL:CC | LL | m::f(v); | ^^^^^^^ diff --git a/src/tools/miri/tests/fail/overlapping_assignment.stderr b/src/tools/miri/tests/fail/overlapping_assignment.stderr index 54e104e351370..0ce2e4a098195 100644 --- a/src/tools/miri/tests/fail/overlapping_assignment.stderr +++ b/src/tools/miri/tests/fail/overlapping_assignment.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: `copy_nonoverlapping` called on overlapping ranges - --> $DIR/overlapping_assignment.rs:LL:CC + --> tests/fail/overlapping_assignment.rs:LL:CC | LL | *ptr1 = *ptr2; | ^^^^^^^^^^^^^ `copy_nonoverlapping` called on overlapping ranges @@ -7,9 +7,9 @@ LL | *ptr1 = *ptr2; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `self_copy` at $DIR/overlapping_assignment.rs:LL:CC + = note: inside `self_copy` at tests/fail/overlapping_assignment.rs:LL:CC note: inside `main` - --> $DIR/overlapping_assignment.rs:LL:CC + --> tests/fail/overlapping_assignment.rs:LL:CC | LL | self_copy(ptr, ptr); | ^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/panic/bad_unwind.stderr b/src/tools/miri/tests/fail/panic/bad_unwind.stderr index c08fe5153b1fc..c152d1a96058d 100644 --- a/src/tools/miri/tests/fail/panic/bad_unwind.stderr +++ b/src/tools/miri/tests/fail/panic/bad_unwind.stderr @@ -1,9 +1,9 @@ -thread 'main' panicked at $DIR/bad_unwind.rs:LL:CC: +thread 'main' panicked at tests/fail/panic/bad_unwind.rs:LL:CC: explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect error: Undefined Behavior: unwinding past a stack frame that does not allow unwinding - --> $DIR/bad_unwind.rs:LL:CC + --> tests/fail/panic/bad_unwind.rs:LL:CC | LL | std::panic::catch_unwind(|| unwind()).unwrap_err(); | ^^^^^^^^ unwinding past a stack frame that does not allow unwinding @@ -11,12 +11,12 @@ LL | std::panic::catch_unwind(|| unwind()).unwrap_err(); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside closure at $DIR/bad_unwind.rs:LL:CC - = note: inside `std::panicking::r#try::do_call::<{closure@$DIR/bad_unwind.rs:LL:CC}, ()>` at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside `std::panicking::r#try::<(), {closure@$DIR/bad_unwind.rs:LL:CC}>` at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside `std::panic::catch_unwind::<{closure@$DIR/bad_unwind.rs:LL:CC}, ()>` at RUSTLIB/std/src/panic.rs:LL:CC + = note: inside closure at tests/fail/panic/bad_unwind.rs:LL:CC + = note: inside `std::panicking::r#try::do_call::<{closure@tests/fail/panic/bad_unwind.rs:LL:CC}, ()>` at RUSTLIB/std/src/panicking.rs:LL:CC + = note: inside `std::panicking::r#try::<(), {closure@tests/fail/panic/bad_unwind.rs:LL:CC}>` at RUSTLIB/std/src/panicking.rs:LL:CC + = note: inside `std::panic::catch_unwind::<{closure@tests/fail/panic/bad_unwind.rs:LL:CC}, ()>` at RUSTLIB/std/src/panic.rs:LL:CC note: inside `main` - --> $DIR/bad_unwind.rs:LL:CC + --> tests/fail/panic/bad_unwind.rs:LL:CC | LL | std::panic::catch_unwind(|| unwind()).unwrap_err(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/panic/double_panic.stderr b/src/tools/miri/tests/fail/panic/double_panic.stderr index 0395fe418d93c..3e00821796eff 100644 --- a/src/tools/miri/tests/fail/panic/double_panic.stderr +++ b/src/tools/miri/tests/fail/panic/double_panic.stderr @@ -1,8 +1,8 @@ -thread 'main' panicked at $DIR/double_panic.rs:LL:CC: +thread 'main' panicked at tests/fail/panic/double_panic.rs:LL:CC: first note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect -thread 'main' panicked at $DIR/double_panic.rs:LL:CC: +thread 'main' panicked at tests/fail/panic/double_panic.rs:LL:CC: second stack backtrace: thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC: @@ -23,7 +23,7 @@ LL | ABORT(); = note: inside `core::panicking::panic_nounwind_nobacktrace` at RUSTLIB/core/src/panicking.rs:LL:CC = note: inside `core::panicking::panic_in_cleanup` at RUSTLIB/core/src/panicking.rs:LL:CC note: inside `main` - --> $DIR/double_panic.rs:LL:CC + --> tests/fail/panic/double_panic.rs:LL:CC | LL | / fn main() { LL | | let _foo = Foo; diff --git a/src/tools/miri/tests/fail/panic/no_std.stderr b/src/tools/miri/tests/fail/panic/no_std.stderr index 40f6cf1fc0b24..c1cd53e310f9a 100644 --- a/src/tools/miri/tests/fail/panic/no_std.stderr +++ b/src/tools/miri/tests/fail/panic/no_std.stderr @@ -1,15 +1,15 @@ -panicked at $DIR/no_std.rs:LL:CC: +panicked at tests/fail/panic/no_std.rs:LL:CC: blarg I am dead error: abnormal termination: the program aborted execution - --> $DIR/no_std.rs:LL:CC + --> tests/fail/panic/no_std.rs:LL:CC | LL | core::intrinsics::abort(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ the program aborted execution | = note: BACKTRACE: - = note: inside `panic_handler` at $DIR/no_std.rs:LL:CC + = note: inside `panic_handler` at tests/fail/panic/no_std.rs:LL:CC note: inside `start` - --> $DIR/no_std.rs:LL:CC + --> tests/fail/panic/no_std.rs:LL:CC | LL | panic!("blarg I am dead") | ^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/panic/panic_abort1.stderr b/src/tools/miri/tests/fail/panic/panic_abort1.stderr index 6c7cac23beccb..c5f04d581ca36 100644 --- a/src/tools/miri/tests/fail/panic/panic_abort1.stderr +++ b/src/tools/miri/tests/fail/panic/panic_abort1.stderr @@ -1,4 +1,4 @@ -thread 'main' panicked at $DIR/panic_abort1.rs:LL:CC: +thread 'main' panicked at tests/fail/panic/panic_abort1.rs:LL:CC: panicking from libstd note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect @@ -17,7 +17,7 @@ LL | ABORT(); = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC = note: inside `std::panicking::begin_panic_handler` at RUSTLIB/std/src/panicking.rs:LL:CC note: inside `main` - --> $DIR/panic_abort1.rs:LL:CC + --> tests/fail/panic/panic_abort1.rs:LL:CC | LL | std::panic!("panicking from libstd"); | ^ diff --git a/src/tools/miri/tests/fail/panic/panic_abort2.stderr b/src/tools/miri/tests/fail/panic/panic_abort2.stderr index 1eda5449d1b65..535cddfd4d41d 100644 --- a/src/tools/miri/tests/fail/panic/panic_abort2.stderr +++ b/src/tools/miri/tests/fail/panic/panic_abort2.stderr @@ -1,4 +1,4 @@ -thread 'main' panicked at $DIR/panic_abort2.rs:LL:CC: +thread 'main' panicked at tests/fail/panic/panic_abort2.rs:LL:CC: 42-panicking from libstd note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect @@ -17,7 +17,7 @@ LL | ABORT(); = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC = note: inside `std::panicking::begin_panic_handler` at RUSTLIB/std/src/panicking.rs:LL:CC note: inside `main` - --> $DIR/panic_abort2.rs:LL:CC + --> tests/fail/panic/panic_abort2.rs:LL:CC | LL | std::panic!("{}-panicking from libstd", 42); | ^ diff --git a/src/tools/miri/tests/fail/panic/panic_abort3.stderr b/src/tools/miri/tests/fail/panic/panic_abort3.stderr index 5c7c5e17beebb..e74cf342e3f4e 100644 --- a/src/tools/miri/tests/fail/panic/panic_abort3.stderr +++ b/src/tools/miri/tests/fail/panic/panic_abort3.stderr @@ -1,4 +1,4 @@ -thread 'main' panicked at $DIR/panic_abort3.rs:LL:CC: +thread 'main' panicked at tests/fail/panic/panic_abort3.rs:LL:CC: panicking from libcore note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect @@ -17,7 +17,7 @@ LL | ABORT(); = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC = note: inside `std::panicking::begin_panic_handler` at RUSTLIB/std/src/panicking.rs:LL:CC note: inside `main` - --> $DIR/panic_abort3.rs:LL:CC + --> tests/fail/panic/panic_abort3.rs:LL:CC | LL | core::panic!("panicking from libcore"); | ^ diff --git a/src/tools/miri/tests/fail/panic/panic_abort4.stderr b/src/tools/miri/tests/fail/panic/panic_abort4.stderr index c8104f570f633..3983d169bdd8d 100644 --- a/src/tools/miri/tests/fail/panic/panic_abort4.stderr +++ b/src/tools/miri/tests/fail/panic/panic_abort4.stderr @@ -1,4 +1,4 @@ -thread 'main' panicked at $DIR/panic_abort4.rs:LL:CC: +thread 'main' panicked at tests/fail/panic/panic_abort4.rs:LL:CC: 42-panicking from libcore note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect @@ -17,7 +17,7 @@ LL | ABORT(); = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC = note: inside `std::panicking::begin_panic_handler` at RUSTLIB/std/src/panicking.rs:LL:CC note: inside `main` - --> $DIR/panic_abort4.rs:LL:CC + --> tests/fail/panic/panic_abort4.rs:LL:CC | LL | core::panic!("{}-panicking from libcore", 42); | ^ diff --git a/src/tools/miri/tests/fail/panic/tls_macro_const_drop_panic.stderr b/src/tools/miri/tests/fail/panic/tls_macro_const_drop_panic.stderr index 778061490f04a..d93062b4bdce7 100644 --- a/src/tools/miri/tests/fail/panic/tls_macro_const_drop_panic.stderr +++ b/src/tools/miri/tests/fail/panic/tls_macro_const_drop_panic.stderr @@ -1,4 +1,4 @@ -thread $NAME panicked at $DIR/tls_macro_const_drop_panic.rs:LL:CC: +thread $NAME panicked at tests/fail/panic/tls_macro_const_drop_panic.rs:LL:CC: ow fatal runtime error: thread local panicked on drop error: abnormal termination: the program aborted execution diff --git a/src/tools/miri/tests/fail/panic/tls_macro_drop_panic.stderr b/src/tools/miri/tests/fail/panic/tls_macro_drop_panic.stderr index 367e2ee1f0bc6..c0a2a30dbe139 100644 --- a/src/tools/miri/tests/fail/panic/tls_macro_drop_panic.stderr +++ b/src/tools/miri/tests/fail/panic/tls_macro_drop_panic.stderr @@ -1,4 +1,4 @@ -thread $NAME panicked at $DIR/tls_macro_drop_panic.rs:LL:CC: +thread $NAME panicked at tests/fail/panic/tls_macro_drop_panic.rs:LL:CC: ow fatal runtime error: thread local panicked on drop error: abnormal termination: the program aborted execution diff --git a/src/tools/miri/tests/fail/panic/unwind_panic_abort.stderr b/src/tools/miri/tests/fail/panic/unwind_panic_abort.stderr index 26afe8830cfc5..7291f5bce8d6d 100644 --- a/src/tools/miri/tests/fail/panic/unwind_panic_abort.stderr +++ b/src/tools/miri/tests/fail/panic/unwind_panic_abort.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: unwinding past a stack frame that does not allow unwinding - --> $DIR/unwind_panic_abort.rs:LL:CC + --> tests/fail/panic/unwind_panic_abort.rs:LL:CC | LL | miri_start_unwind(&mut 0); | ^^^^^^^^^^^^^^^^^^^^^^^^^ unwinding past a stack frame that does not allow unwinding @@ -7,7 +7,7 @@ LL | miri_start_unwind(&mut 0); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/unwind_panic_abort.rs:LL:CC + = note: inside `main` at tests/fail/panic/unwind_panic_abort.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/provenance/int_copy_looses_provenance0.stderr b/src/tools/miri/tests/fail/provenance/int_copy_looses_provenance0.stderr index fc012af3ad877..24a8d7874077e 100644 --- a/src/tools/miri/tests/fail/provenance/int_copy_looses_provenance0.stderr +++ b/src/tools/miri/tests/fail/provenance/int_copy_looses_provenance0.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value: encountered a dangling reference ($HEX[noalloc] has no provenance) - --> $DIR/int_copy_looses_provenance0.rs:LL:CC + --> tests/fail/provenance/int_copy_looses_provenance0.rs:LL:CC | LL | let _val = unsafe { *ptr.read() }; | ^^^^^^^^^^ constructing invalid value: encountered a dangling reference ($HEX[noalloc] has no provenance) @@ -7,7 +7,7 @@ LL | let _val = unsafe { *ptr.read() }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/int_copy_looses_provenance0.rs:LL:CC + = note: inside `main` at tests/fail/provenance/int_copy_looses_provenance0.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/provenance/int_copy_looses_provenance1.stderr b/src/tools/miri/tests/fail/provenance/int_copy_looses_provenance1.stderr index 375262655d0cf..14855a723b448 100644 --- a/src/tools/miri/tests/fail/provenance/int_copy_looses_provenance1.stderr +++ b/src/tools/miri/tests/fail/provenance/int_copy_looses_provenance1.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value: encountered a dangling reference ($HEX[noalloc] has no provenance) - --> $DIR/int_copy_looses_provenance1.rs:LL:CC + --> tests/fail/provenance/int_copy_looses_provenance1.rs:LL:CC | LL | let _val = unsafe { *ptr.read() }; | ^^^^^^^^^^ constructing invalid value: encountered a dangling reference ($HEX[noalloc] has no provenance) @@ -7,7 +7,7 @@ LL | let _val = unsafe { *ptr.read() }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/int_copy_looses_provenance1.rs:LL:CC + = note: inside `main` at tests/fail/provenance/int_copy_looses_provenance1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/provenance/int_copy_looses_provenance2.stderr b/src/tools/miri/tests/fail/provenance/int_copy_looses_provenance2.stderr index 8402c7b5e130f..2d5b97830987b 100644 --- a/src/tools/miri/tests/fail/provenance/int_copy_looses_provenance2.stderr +++ b/src/tools/miri/tests/fail/provenance/int_copy_looses_provenance2.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value: encountered a dangling reference ($HEX[noalloc] has no provenance) - --> $DIR/int_copy_looses_provenance2.rs:LL:CC + --> tests/fail/provenance/int_copy_looses_provenance2.rs:LL:CC | LL | let _val = unsafe { *ptr.read() }; | ^^^^^^^^^^ constructing invalid value: encountered a dangling reference ($HEX[noalloc] has no provenance) @@ -7,7 +7,7 @@ LL | let _val = unsafe { *ptr.read() }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/int_copy_looses_provenance2.rs:LL:CC + = note: inside `main` at tests/fail/provenance/int_copy_looses_provenance2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/provenance/int_copy_looses_provenance3.rs b/src/tools/miri/tests/fail/provenance/int_copy_looses_provenance3.rs index 48a48ce4587ee..d6bbfd7d94c76 100644 --- a/src/tools/miri/tests/fail/provenance/int_copy_looses_provenance3.rs +++ b/src/tools/miri/tests/fail/provenance/int_copy_looses_provenance3.rs @@ -11,7 +11,7 @@ enum E { // Doing a copy at integer type should lose provenance. // This tests the case where provenacne is hiding in the discriminant of an enum. fn main() { - assert_eq!(mem::size_of::(), 2*mem::size_of::()); + assert_eq!(mem::size_of::(), 2 * mem::size_of::()); // We want to store provenance in the enum discriminant, but the value still needs to // be valid atfor the type. So we split provenance and data. diff --git a/src/tools/miri/tests/fail/provenance/int_copy_looses_provenance3.stderr b/src/tools/miri/tests/fail/provenance/int_copy_looses_provenance3.stderr index b50e23da96a7e..62e3bd2e954cf 100644 --- a/src/tools/miri/tests/fail/provenance/int_copy_looses_provenance3.stderr +++ b/src/tools/miri/tests/fail/provenance/int_copy_looses_provenance3.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: memory access failed: expected a pointer to 4 bytes of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance) - --> $DIR/int_copy_looses_provenance3.rs:LL:CC + --> tests/fail/provenance/int_copy_looses_provenance3.rs:LL:CC | LL | let _val = unsafe { *ptr }; | ^^^^ memory access failed: expected a pointer to 4 bytes of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance) @@ -7,7 +7,7 @@ LL | let _val = unsafe { *ptr }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/int_copy_looses_provenance3.rs:LL:CC + = note: inside `main` at tests/fail/provenance/int_copy_looses_provenance3.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/provenance/pointer_partial_overwrite.stderr b/src/tools/miri/tests/fail/provenance/pointer_partial_overwrite.stderr index 1ca35be8cb2bd..6bc92fffd5afb 100644 --- a/src/tools/miri/tests/fail/provenance/pointer_partial_overwrite.stderr +++ b/src/tools/miri/tests/fail/provenance/pointer_partial_overwrite.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: memory access failed: expected a pointer to 4 bytes of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance) - --> $DIR/pointer_partial_overwrite.rs:LL:CC + --> tests/fail/provenance/pointer_partial_overwrite.rs:LL:CC | LL | let x = *p; | ^^ memory access failed: expected a pointer to 4 bytes of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance) @@ -7,7 +7,7 @@ LL | let x = *p; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/pointer_partial_overwrite.rs:LL:CC + = note: inside `main` at tests/fail/provenance/pointer_partial_overwrite.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/provenance/provenance_transmute.stderr b/src/tools/miri/tests/fail/provenance/provenance_transmute.stderr index 8a1d39effbd19..7403f4382de21 100644 --- a/src/tools/miri/tests/fail/provenance/provenance_transmute.stderr +++ b/src/tools/miri/tests/fail/provenance/provenance_transmute.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: memory access failed: expected a pointer to 1 byte of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance) - --> $DIR/provenance_transmute.rs:LL:CC + --> tests/fail/provenance/provenance_transmute.rs:LL:CC | LL | let _val = *left_ptr; | ^^^^^^^^^ memory access failed: expected a pointer to 1 byte of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance) @@ -7,9 +7,9 @@ LL | let _val = *left_ptr; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `deref` at $DIR/provenance_transmute.rs:LL:CC + = note: inside `deref` at tests/fail/provenance/provenance_transmute.rs:LL:CC note: inside `main` - --> $DIR/provenance_transmute.rs:LL:CC + --> tests/fail/provenance/provenance_transmute.rs:LL:CC | LL | deref(ptr1, ptr2.with_addr(ptr1.addr())); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/provenance/ptr_copy_loses_partial_provenance0.stderr b/src/tools/miri/tests/fail/provenance/ptr_copy_loses_partial_provenance0.stderr index ed38572a5f398..5ed83951c60a9 100644 --- a/src/tools/miri/tests/fail/provenance/ptr_copy_loses_partial_provenance0.stderr +++ b/src/tools/miri/tests/fail/provenance/ptr_copy_loses_partial_provenance0.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: memory access failed: expected a pointer to 4 bytes of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance) - --> $DIR/ptr_copy_loses_partial_provenance0.rs:LL:CC + --> tests/fail/provenance/ptr_copy_loses_partial_provenance0.rs:LL:CC | LL | let _val = *ptr; | ^^^^ memory access failed: expected a pointer to 4 bytes of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance) @@ -7,7 +7,7 @@ LL | let _val = *ptr; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/ptr_copy_loses_partial_provenance0.rs:LL:CC + = note: inside `main` at tests/fail/provenance/ptr_copy_loses_partial_provenance0.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/provenance/ptr_copy_loses_partial_provenance1.stderr b/src/tools/miri/tests/fail/provenance/ptr_copy_loses_partial_provenance1.stderr index 2e11687175afe..3675653cbe79a 100644 --- a/src/tools/miri/tests/fail/provenance/ptr_copy_loses_partial_provenance1.stderr +++ b/src/tools/miri/tests/fail/provenance/ptr_copy_loses_partial_provenance1.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: memory access failed: expected a pointer to 4 bytes of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance) - --> $DIR/ptr_copy_loses_partial_provenance1.rs:LL:CC + --> tests/fail/provenance/ptr_copy_loses_partial_provenance1.rs:LL:CC | LL | let _val = *ptr; | ^^^^ memory access failed: expected a pointer to 4 bytes of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance) @@ -7,7 +7,7 @@ LL | let _val = *ptr; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/ptr_copy_loses_partial_provenance1.rs:LL:CC + = note: inside `main` at tests/fail/provenance/ptr_copy_loses_partial_provenance1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/provenance/ptr_int_unexposed.stderr b/src/tools/miri/tests/fail/provenance/ptr_int_unexposed.stderr index e21872244f60c..1b6518612efcc 100644 --- a/src/tools/miri/tests/fail/provenance/ptr_int_unexposed.stderr +++ b/src/tools/miri/tests/fail/provenance/ptr_int_unexposed.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: memory access failed: expected a pointer to 4 bytes of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance) - --> $DIR/ptr_int_unexposed.rs:LL:CC + --> tests/fail/provenance/ptr_int_unexposed.rs:LL:CC | LL | assert_eq!(unsafe { *ptr }, 3); | ^^^^ memory access failed: expected a pointer to 4 bytes of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance) @@ -7,7 +7,7 @@ LL | assert_eq!(unsafe { *ptr }, 3); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/ptr_int_unexposed.rs:LL:CC + = note: inside `main` at tests/fail/provenance/ptr_int_unexposed.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/provenance/ptr_invalid.stderr b/src/tools/miri/tests/fail/provenance/ptr_invalid.stderr index bd0a9eb0d2910..84347ec7a11d3 100644 --- a/src/tools/miri/tests/fail/provenance/ptr_invalid.stderr +++ b/src/tools/miri/tests/fail/provenance/ptr_invalid.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: memory access failed: expected a pointer to 4 bytes of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance) - --> $DIR/ptr_invalid.rs:LL:CC + --> tests/fail/provenance/ptr_invalid.rs:LL:CC | LL | let _val = unsafe { *xptr_invalid }; | ^^^^^^^^^^^^^ memory access failed: expected a pointer to 4 bytes of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance) @@ -7,7 +7,7 @@ LL | let _val = unsafe { *xptr_invalid }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/ptr_invalid.rs:LL:CC + = note: inside `main` at tests/fail/provenance/ptr_invalid.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/provenance/ptr_invalid_offset.stderr b/src/tools/miri/tests/fail/provenance/ptr_invalid_offset.stderr index 35e5c08300f98..3910bc4df4b08 100644 --- a/src/tools/miri/tests/fail/provenance/ptr_invalid_offset.stderr +++ b/src/tools/miri/tests/fail/provenance/ptr_invalid_offset.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: out-of-bounds pointer arithmetic: expected a pointer to 1 byte of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance) - --> $DIR/ptr_invalid_offset.rs:LL:CC + --> tests/fail/provenance/ptr_invalid_offset.rs:LL:CC | LL | let _ = unsafe { roundtrip.offset(1) }; | ^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer arithmetic: expected a pointer to 1 byte of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance) @@ -7,7 +7,7 @@ LL | let _ = unsafe { roundtrip.offset(1) }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/ptr_invalid_offset.rs:LL:CC + = note: inside `main` at tests/fail/provenance/ptr_invalid_offset.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/provenance/strict_provenance_cast.stderr b/src/tools/miri/tests/fail/provenance/strict_provenance_cast.stderr index 8c61b66ac4693..ab7d8db1a3155 100644 --- a/src/tools/miri/tests/fail/provenance/strict_provenance_cast.stderr +++ b/src/tools/miri/tests/fail/provenance/strict_provenance_cast.stderr @@ -1,12 +1,12 @@ error: unsupported operation: integer-to-pointer casts and `ptr::with_exposed_provenance` are not supported with `-Zmiri-strict-provenance` - --> $DIR/strict_provenance_cast.rs:LL:CC + --> tests/fail/provenance/strict_provenance_cast.rs:LL:CC | LL | let _ptr = std::ptr::with_exposed_provenance::(addr); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ integer-to-pointer casts and `ptr::with_exposed_provenance` are not supported with `-Zmiri-strict-provenance` | = help: use Strict Provenance APIs (https://doc.rust-lang.org/nightly/std/ptr/index.html#strict-provenance, https://crates.io/crates/sptr) instead = note: BACKTRACE: - = note: inside `main` at $DIR/strict_provenance_cast.rs:LL:CC + = note: inside `main` at tests/fail/provenance/strict_provenance_cast.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/rc_as_ptr.stderr b/src/tools/miri/tests/fail/rc_as_ptr.stderr index 83d85f8adffa2..0fcb0faf49718 100644 --- a/src/tools/miri/tests/fail/rc_as_ptr.stderr +++ b/src/tools/miri/tests/fail/rc_as_ptr.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: out-of-bounds pointer use: ALLOC has been freed, so this pointer is dangling - --> $DIR/rc_as_ptr.rs:LL:CC + --> tests/fail/rc_as_ptr.rs:LL:CC | LL | assert_eq!(42, **unsafe { &*Weak::as_ptr(&weak) }); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer use: ALLOC has been freed, so this pointer is dangling @@ -7,12 +7,12 @@ LL | assert_eq!(42, **unsafe { &*Weak::as_ptr(&weak) }); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information help: ALLOC was allocated here: - --> $DIR/rc_as_ptr.rs:LL:CC + --> tests/fail/rc_as_ptr.rs:LL:CC | LL | let strong = Rc::new(Box::new(42)); | ^^^^^^^^^^^^ help: ALLOC was deallocated here: - --> $DIR/rc_as_ptr.rs:LL:CC + --> tests/fail/rc_as_ptr.rs:LL:CC | LL | drop(strong); | ^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/reading_half_a_pointer.stderr b/src/tools/miri/tests/fail/reading_half_a_pointer.stderr index cba8a9f84396e..921796441694a 100644 --- a/src/tools/miri/tests/fail/reading_half_a_pointer.stderr +++ b/src/tools/miri/tests/fail/reading_half_a_pointer.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: memory access failed: expected a pointer to 1 byte of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance) - --> $DIR/reading_half_a_pointer.rs:LL:CC + --> tests/fail/reading_half_a_pointer.rs:LL:CC | LL | let _val = *x; | ^^ memory access failed: expected a pointer to 1 byte of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance) @@ -7,7 +7,7 @@ LL | let _val = *x; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/reading_half_a_pointer.rs:LL:CC + = note: inside `main` at tests/fail/reading_half_a_pointer.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/rustc-error.stderr b/src/tools/miri/tests/fail/rustc-error.stderr index 3f911c172d4ef..31d9946c411f5 100644 --- a/src/tools/miri/tests/fail/rustc-error.stderr +++ b/src/tools/miri/tests/fail/rustc-error.stderr @@ -1,5 +1,5 @@ error[E0423]: expected function, found macro `println` - --> $DIR/rustc-error.rs:LL:CC + --> tests/fail/rustc-error.rs:LL:CC | LL | println("Hello, world!"); | ^^^^^^^ not a function diff --git a/src/tools/miri/tests/fail/rustc-error2.stderr b/src/tools/miri/tests/fail/rustc-error2.stderr index de2861a019c69..cfbf305d3bbfe 100644 --- a/src/tools/miri/tests/fail/rustc-error2.stderr +++ b/src/tools/miri/tests/fail/rustc-error2.stderr @@ -1,5 +1,5 @@ error[E0433]: failed to resolve: use of undeclared crate or module `assert_mem_uninitialized_valid` - --> $DIR/rustc-error2.rs:LL:CC + --> tests/fail/rustc-error2.rs:LL:CC | LL | fn deref(&self) -> &assert_mem_uninitialized_valid::Target { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared crate or module `assert_mem_uninitialized_valid` diff --git a/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-decl.stderr b/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-decl.stderr index 159a02f2c0355..346cc77df1bf3 100644 --- a/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-decl.stderr +++ b/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-decl.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: bad declaration of miri_resolve_frame - should return a struct with 5 fields - --> $DIR/bad-backtrace-decl.rs:LL:CC + --> tests/fail/shims/backtrace/bad-backtrace-decl.rs:LL:CC | LL | ... miri_resolve_frame(*frame, 0); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bad declaration of miri_resolve_frame - should return a struct with 5 fields @@ -7,7 +7,7 @@ LL | ... miri_resolve_frame(*frame, 0); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/bad-backtrace-decl.rs:LL:CC + = note: inside `main` at tests/fail/shims/backtrace/bad-backtrace-decl.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-flags.stderr b/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-flags.stderr index 504485e3b3a41..a8d531c51234b 100644 --- a/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-flags.stderr +++ b/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-flags.stderr @@ -1,12 +1,12 @@ error: unsupported operation: unknown `miri_get_backtrace` flags 2 - --> $DIR/bad-backtrace-flags.rs:LL:CC + --> tests/fail/shims/backtrace/bad-backtrace-flags.rs:LL:CC | LL | miri_get_backtrace(2, std::ptr::null_mut()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unknown `miri_get_backtrace` flags 2 | = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support = note: BACKTRACE: - = note: inside `main` at $DIR/bad-backtrace-flags.rs:LL:CC + = note: inside `main` at tests/fail/shims/backtrace/bad-backtrace-flags.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-ptr.stderr b/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-ptr.stderr index 523c935762ffd..7ae9558fad70a 100644 --- a/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-ptr.stderr +++ b/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-ptr.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: out-of-bounds pointer use: expected a pointer to some allocation, but got a null pointer - --> $DIR/bad-backtrace-ptr.rs:LL:CC + --> tests/fail/shims/backtrace/bad-backtrace-ptr.rs:LL:CC | LL | miri_resolve_frame(std::ptr::null_mut(), 0); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer use: expected a pointer to some allocation, but got a null pointer @@ -7,7 +7,7 @@ LL | miri_resolve_frame(std::ptr::null_mut(), 0); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/bad-backtrace-ptr.rs:LL:CC + = note: inside `main` at tests/fail/shims/backtrace/bad-backtrace-ptr.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-resolve-flags.stderr b/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-resolve-flags.stderr index c1f0ce3d1a8c1..d79ae1ec41495 100644 --- a/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-resolve-flags.stderr +++ b/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-resolve-flags.stderr @@ -1,12 +1,12 @@ error: unsupported operation: unknown `miri_resolve_frame` flags 2 - --> $DIR/bad-backtrace-resolve-flags.rs:LL:CC + --> tests/fail/shims/backtrace/bad-backtrace-resolve-flags.rs:LL:CC | LL | miri_resolve_frame(buf[0], 2); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unknown `miri_resolve_frame` flags 2 | = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support = note: BACKTRACE: - = note: inside `main` at $DIR/bad-backtrace-resolve-flags.rs:LL:CC + = note: inside `main` at tests/fail/shims/backtrace/bad-backtrace-resolve-flags.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-resolve-names-flags.stderr b/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-resolve-names-flags.stderr index fc270593e6369..ff3176a789ba8 100644 --- a/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-resolve-names-flags.stderr +++ b/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-resolve-names-flags.stderr @@ -1,12 +1,12 @@ error: unsupported operation: unknown `miri_resolve_frame_names` flags 2 - --> $DIR/bad-backtrace-resolve-names-flags.rs:LL:CC + --> tests/fail/shims/backtrace/bad-backtrace-resolve-names-flags.rs:LL:CC | LL | ... miri_resolve_frame_names(buf[0], 2, std::ptr::null_mut(), std::ptr::null_mut()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unknown `miri_resolve_frame_names` flags 2 | = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support = note: BACKTRACE: - = note: inside `main` at $DIR/bad-backtrace-resolve-names-flags.rs:LL:CC + = note: inside `main` at tests/fail/shims/backtrace/bad-backtrace-resolve-names-flags.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-size-flags.stderr b/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-size-flags.stderr index 2d70733334d85..da287e564e379 100644 --- a/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-size-flags.stderr +++ b/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-size-flags.stderr @@ -1,12 +1,12 @@ error: unsupported operation: unknown `miri_backtrace_size` flags 2 - --> $DIR/bad-backtrace-size-flags.rs:LL:CC + --> tests/fail/shims/backtrace/bad-backtrace-size-flags.rs:LL:CC | LL | miri_backtrace_size(2); | ^^^^^^^^^^^^^^^^^^^^^^ unknown `miri_backtrace_size` flags 2 | = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support = note: BACKTRACE: - = note: inside `main` at $DIR/bad-backtrace-size-flags.rs:LL:CC + = note: inside `main` at tests/fail/shims/backtrace/bad-backtrace-size-flags.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/shims/fs/isolated_file.rs b/src/tools/miri/tests/fail/shims/fs/isolated_file.rs index 2f27e95297b25..e81f0ff426023 100644 --- a/src/tools/miri/tests/fail/shims/fs/isolated_file.rs +++ b/src/tools/miri/tests/fail/shims/fs/isolated_file.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: File handling is not implemented yet +//@ignore-target: windows # File handling is not implemented yet //@error-in-other-file: `open` not available when isolation is enabled fn main() { diff --git a/src/tools/miri/tests/fail/shims/fs/isolated_file.stderr b/src/tools/miri/tests/fail/shims/fs/isolated_file.stderr index ec956f83348e3..e611d6e28f857 100644 --- a/src/tools/miri/tests/fail/shims/fs/isolated_file.stderr +++ b/src/tools/miri/tests/fail/shims/fs/isolated_file.stderr @@ -19,7 +19,7 @@ LL | let fd = cvt_r(|| unsafe { open64(path.as_ptr(), flags, opts.mode a = note: inside `std::fs::OpenOptions::open::<&std::path::Path>` at RUSTLIB/std/src/fs.rs:LL:CC = note: inside `std::fs::File::open::<&str>` at RUSTLIB/std/src/fs.rs:LL:CC note: inside `main` - --> $DIR/isolated_file.rs:LL:CC + --> tests/fail/shims/fs/isolated_file.rs:LL:CC | LL | let _file = std::fs::File::open("file.txt").unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/shims/shim_arg_size.stderr b/src/tools/miri/tests/fail/shims/shim_arg_size.stderr index b40d02ac34577..e17fe9019ff5f 100644 --- a/src/tools/miri/tests/fail/shims/shim_arg_size.stderr +++ b/src/tools/miri/tests/fail/shims/shim_arg_size.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: scalar size mismatch: expected 4 bytes but got 1 bytes instead - --> $DIR/shim_arg_size.rs:LL:CC + --> tests/fail/shims/shim_arg_size.rs:LL:CC | LL | memchr(std::ptr::null(), 0, 0); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ scalar size mismatch: expected 4 bytes but got 1 bytes instead @@ -7,7 +7,7 @@ LL | memchr(std::ptr::null(), 0, 0); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/shim_arg_size.rs:LL:CC + = note: inside `main` at tests/fail/shims/shim_arg_size.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/should-pass/cpp20_rwc_syncs.stderr b/src/tools/miri/tests/fail/should-pass/cpp20_rwc_syncs.stderr index 966279723c495..5185845568e7c 100644 --- a/src/tools/miri/tests/fail/should-pass/cpp20_rwc_syncs.stderr +++ b/src/tools/miri/tests/fail/should-pass/cpp20_rwc_syncs.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: entering unreachable code - --> $DIR/cpp20_rwc_syncs.rs:LL:CC + --> tests/fail/should-pass/cpp20_rwc_syncs.rs:LL:CC | LL | std::hint::unreachable_unchecked(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ entering unreachable code @@ -7,9 +7,9 @@ LL | std::hint::unreachable_unchecked(); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `test_cpp20_rwc_syncs` at $DIR/cpp20_rwc_syncs.rs:LL:CC + = note: inside `test_cpp20_rwc_syncs` at tests/fail/should-pass/cpp20_rwc_syncs.rs:LL:CC note: inside `main` - --> $DIR/cpp20_rwc_syncs.rs:LL:CC + --> tests/fail/should-pass/cpp20_rwc_syncs.rs:LL:CC | LL | test_cpp20_rwc_syncs(); | ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/stacked_borrows/deallocate_against_protector1.stderr b/src/tools/miri/tests/fail/stacked_borrows/deallocate_against_protector1.stderr index 31a6722ea0c2c..f4cfa49c1564e 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/deallocate_against_protector1.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/deallocate_against_protector1.stderr @@ -11,18 +11,18 @@ LL | self.1.deallocate(From::from(ptr.cast()), layout); = note: inside `std::ptr::drop_in_place::> - shim(Some(std::boxed::Box))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC = note: inside `std::mem::drop::>` at RUSTLIB/core/src/mem/mod.rs:LL:CC note: inside closure - --> $DIR/deallocate_against_protector1.rs:LL:CC + --> tests/fail/stacked_borrows/deallocate_against_protector1.rs:LL:CC | LL | drop(unsafe { Box::from_raw(raw) }); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: inside `<{closure@$DIR/deallocate_against_protector1.rs:LL:CC} as std::ops::FnOnce<(&mut i32,)>>::call_once - shim` at RUSTLIB/core/src/ops/function.rs:LL:CC + = note: inside `<{closure@tests/fail/stacked_borrows/deallocate_against_protector1.rs:LL:CC} as std::ops::FnOnce<(&mut i32,)>>::call_once - shim` at RUSTLIB/core/src/ops/function.rs:LL:CC note: inside `inner` - --> $DIR/deallocate_against_protector1.rs:LL:CC + --> tests/fail/stacked_borrows/deallocate_against_protector1.rs:LL:CC | LL | f(x) | ^^^^ note: inside `main` - --> $DIR/deallocate_against_protector1.rs:LL:CC + --> tests/fail/stacked_borrows/deallocate_against_protector1.rs:LL:CC | LL | / inner(Box::leak(Box::new(0)), |x| { LL | | let raw = x as *mut _; diff --git a/src/tools/miri/tests/fail/stacked_borrows/disable_mut_does_not_merge_srw.stderr b/src/tools/miri/tests/fail/stacked_borrows/disable_mut_does_not_merge_srw.stderr index aa26a003f22f2..2d0209d1a2a2b 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/disable_mut_does_not_merge_srw.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/disable_mut_does_not_merge_srw.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: attempting a read access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/disable_mut_does_not_merge_srw.rs:LL:CC + --> tests/fail/stacked_borrows/disable_mut_does_not_merge_srw.rs:LL:CC | LL | let _val = *raw; | ^^^^ @@ -10,17 +10,17 @@ LL | let _val = *raw; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadWrite retag at offsets [0x0..0x4] - --> $DIR/disable_mut_does_not_merge_srw.rs:LL:CC + --> tests/fail/stacked_borrows/disable_mut_does_not_merge_srw.rs:LL:CC | LL | mutref as *mut i32 | ^^^^^^ help: was later invalidated at offsets [0x0..0x4] by a write access - --> $DIR/disable_mut_does_not_merge_srw.rs:LL:CC + --> tests/fail/stacked_borrows/disable_mut_does_not_merge_srw.rs:LL:CC | LL | *base = 1; | ^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/disable_mut_does_not_merge_srw.rs:LL:CC + = note: inside `main` at tests/fail/stacked_borrows/disable_mut_does_not_merge_srw.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/drop_in_place_protector.stderr b/src/tools/miri/tests/fail/stacked_borrows/drop_in_place_protector.stderr index 5147bcd458c6f..f107ea2023dce 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/drop_in_place_protector.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/drop_in_place_protector.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: not granting access to tag because that would remove [Unique for ] which is strongly protected - --> $DIR/drop_in_place_protector.rs:LL:CC + --> tests/fail/stacked_borrows/drop_in_place_protector.rs:LL:CC | LL | let _val = *P; | ^^ not granting access to tag because that would remove [Unique for ] which is strongly protected @@ -7,21 +7,21 @@ LL | let _val = *P; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadWrite retag at offsets [0x0..0x1] - --> $DIR/drop_in_place_protector.rs:LL:CC + --> tests/fail/stacked_borrows/drop_in_place_protector.rs:LL:CC | LL | let x = core::ptr::addr_of_mut!(x); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: is this argument - --> $DIR/drop_in_place_protector.rs:LL:CC + --> tests/fail/stacked_borrows/drop_in_place_protector.rs:LL:CC | LL | core::ptr::drop_in_place(x); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `::drop` at $DIR/drop_in_place_protector.rs:LL:CC + = note: inside `::drop` at tests/fail/stacked_borrows/drop_in_place_protector.rs:LL:CC = note: inside `std::ptr::drop_in_place:: - shim(Some(HasDrop))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC = note: inside `std::ptr::drop_in_place::<(HasDrop, u8)> - shim(Some((HasDrop, u8)))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC note: inside `main` - --> $DIR/drop_in_place_protector.rs:LL:CC + --> tests/fail/stacked_borrows/drop_in_place_protector.rs:LL:CC | LL | core::ptr::drop_in_place(x); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/stacked_borrows/drop_in_place_retag.stderr b/src/tools/miri/tests/fail/stacked_borrows/drop_in_place_retag.stderr index 6b8465804a58f..eebedf842ef5e 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/drop_in_place_retag.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/drop_in_place_retag.stderr @@ -10,14 +10,14 @@ LL | pub unsafe fn drop_in_place(to_drop: *mut T) { = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadOnly retag at offsets [0x0..0x1] - --> $DIR/drop_in_place_retag.rs:LL:CC + --> tests/fail/stacked_borrows/drop_in_place_retag.rs:LL:CC | LL | let x = core::ptr::addr_of!(x); | ^^^^^^^^^^^^^^^^^^^^^^ = note: BACKTRACE (of the first span): = note: inside `std::ptr::drop_in_place:: - shim(None)` at RUSTLIB/core/src/ptr/mod.rs:LL:CC note: inside `main` - --> $DIR/drop_in_place_retag.rs:LL:CC + --> tests/fail/stacked_borrows/drop_in_place_retag.rs:LL:CC | LL | core::ptr::drop_in_place(x.cast_mut()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/stacked_borrows/exposed_only_ro.stderr b/src/tools/miri/tests/fail/stacked_borrows/exposed_only_ro.stderr index 201bdcdeb9731..861dd75bb2265 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/exposed_only_ro.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/exposed_only_ro.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: attempting a write access using at ALLOC[0x0], but no exposed tags have suitable permission in the borrow stack for this location - --> $DIR/exposed_only_ro.rs:LL:CC + --> tests/fail/stacked_borrows/exposed_only_ro.rs:LL:CC | LL | unsafe { *ptr = 0 }; | ^^^^^^^^ @@ -10,7 +10,7 @@ LL | unsafe { *ptr = 0 }; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information = note: BACKTRACE: - = note: inside `main` at $DIR/exposed_only_ro.rs:LL:CC + = note: inside `main` at tests/fail/stacked_borrows/exposed_only_ro.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/fnentry_invalidation.stderr b/src/tools/miri/tests/fail/stacked_borrows/fnentry_invalidation.stderr index 2a841aa0a8d3c..1a71feee7a182 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/fnentry_invalidation.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/fnentry_invalidation.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: attempting a read access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/fnentry_invalidation.rs:LL:CC + --> tests/fail/stacked_borrows/fnentry_invalidation.rs:LL:CC | LL | let _oof = *z; | ^^ @@ -10,17 +10,17 @@ LL | let _oof = *z; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadWrite retag at offsets [0x0..0x4] - --> $DIR/fnentry_invalidation.rs:LL:CC + --> tests/fail/stacked_borrows/fnentry_invalidation.rs:LL:CC | LL | let z = &mut x as *mut i32; | ^^^^^^ help: was later invalidated at offsets [0x0..0x4] by a Unique function-entry retag inside this call - --> $DIR/fnentry_invalidation.rs:LL:CC + --> tests/fail/stacked_borrows/fnentry_invalidation.rs:LL:CC | LL | x.do_bad(); | ^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/fnentry_invalidation.rs:LL:CC + = note: inside `main` at tests/fail/stacked_borrows/fnentry_invalidation.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/fnentry_invalidation2.stderr b/src/tools/miri/tests/fail/stacked_borrows/fnentry_invalidation2.stderr index 42f042bfad2f1..0b5b005881ec5 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/fnentry_invalidation2.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/fnentry_invalidation2.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: attempting a read access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/fnentry_invalidation2.rs:LL:CC + --> tests/fail/stacked_borrows/fnentry_invalidation2.rs:LL:CC | LL | let _oof = *ptr; | ^^^^ @@ -10,17 +10,17 @@ LL | let _oof = *ptr; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadOnly retag at offsets [0x0..0xc] - --> $DIR/fnentry_invalidation2.rs:LL:CC + --> tests/fail/stacked_borrows/fnentry_invalidation2.rs:LL:CC | LL | let ptr = t.sli.as_ptr(); | ^^^^^^^^^^^^^^ help: was later invalidated at offsets [0x0..0xc] by a Unique function-entry retag inside this call - --> $DIR/fnentry_invalidation2.rs:LL:CC + --> tests/fail/stacked_borrows/fnentry_invalidation2.rs:LL:CC | LL | let _ = t.sli.as_mut_ptr(); | ^^^^^^^^^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/fnentry_invalidation2.rs:LL:CC + = note: inside `main` at tests/fail/stacked_borrows/fnentry_invalidation2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/illegal_dealloc1.stderr b/src/tools/miri/tests/fail/stacked_borrows/illegal_dealloc1.stderr index d06584d19d77b..ddf8dbea31f59 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/illegal_dealloc1.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/illegal_dealloc1.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: attempting deallocation using at ALLOC, but that tag does not exist in the borrow stack for this location - --> $DIR/illegal_deALLOC.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_deALLOC.rs:LL:CC | LL | dealloc(ptr2, Layout::from_size_align_unchecked(1, 1)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempting deallocation using at ALLOC, but that tag does not exist in the borrow stack for this location @@ -7,17 +7,17 @@ LL | dealloc(ptr2, Layout::from_size_align_unchecked(1, 1)); = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadWrite retag at offsets [0x0..0x1] - --> $DIR/illegal_deALLOC.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_deALLOC.rs:LL:CC | LL | let ptr2 = (&mut *ptr1) as *mut u8; | ^^^^^^^^^^^^ help: was later invalidated at offsets [0x0..0x1] by a write access - --> $DIR/illegal_deALLOC.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_deALLOC.rs:LL:CC | LL | ptr1.write(0); | ^^^^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/illegal_deALLOC.rs:LL:CC + = note: inside `main` at tests/fail/stacked_borrows/illegal_deALLOC.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/illegal_read1.stderr b/src/tools/miri/tests/fail/stacked_borrows/illegal_read1.stderr index 2dfb660c53c69..bc719f9f205d0 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/illegal_read1.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/illegal_read1.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: attempting a read access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/illegal_read1.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_read1.rs:LL:CC | LL | let _val = *xref; // ...but any use of raw will invalidate our ref. | ^^^^^ @@ -10,17 +10,17 @@ LL | let _val = *xref; // ...but any use of raw will invalidate our ref. = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a Unique retag at offsets [0x0..0x4] - --> $DIR/illegal_read1.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_read1.rs:LL:CC | LL | let xref = unsafe { &mut *xraw }; // derived from raw, so using raw is still ok... | ^^^^^^^^^^ help: was later invalidated at offsets [0x0..0x4] by a read access - --> $DIR/illegal_read1.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_read1.rs:LL:CC | LL | let _val = unsafe { *xraw }; | ^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/illegal_read1.rs:LL:CC + = note: inside `main` at tests/fail/stacked_borrows/illegal_read1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/illegal_read2.stderr b/src/tools/miri/tests/fail/stacked_borrows/illegal_read2.stderr index ce3b920c1dcbb..d1bca88d05bc0 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/illegal_read2.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/illegal_read2.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: attempting a read access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/illegal_read2.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_read2.rs:LL:CC | LL | let _val = *xref; // ...but any use of raw will invalidate our ref. | ^^^^^ @@ -10,17 +10,17 @@ LL | let _val = *xref; // ...but any use of raw will invalidate our ref. = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a Unique retag at offsets [0x0..0x4] - --> $DIR/illegal_read2.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_read2.rs:LL:CC | LL | let xref = unsafe { &mut *xraw }; // derived from raw, so using raw is still ok... | ^^^^^^^^^^ help: was later invalidated at offsets [0x0..0x4] by a SharedReadOnly retag - --> $DIR/illegal_read2.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_read2.rs:LL:CC | LL | let shr = unsafe { &*xraw }; | ^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/illegal_read2.rs:LL:CC + = note: inside `main` at tests/fail/stacked_borrows/illegal_read2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/illegal_read3.stderr b/src/tools/miri/tests/fail/stacked_borrows/illegal_read3.stderr index 2c81fda1411e1..6a6701aae1945 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/illegal_read3.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/illegal_read3.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: attempting a read access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/illegal_read3.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_read3.rs:LL:CC | LL | let _val = *xref2; | ^^^^^^ @@ -10,17 +10,17 @@ LL | let _val = *xref2; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a Unique retag at offsets [0x0..0x4] - --> $DIR/illegal_read3.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_read3.rs:LL:CC | LL | let xref2 = &mut *xref1; | ^^^^^^^^^^^ help: was later invalidated at offsets [0x0..0x4] by a read access - --> $DIR/illegal_read3.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_read3.rs:LL:CC | LL | let _val = unsafe { *xref1.r }; | ^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/illegal_read3.rs:LL:CC + = note: inside `main` at tests/fail/stacked_borrows/illegal_read3.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/illegal_read4.stderr b/src/tools/miri/tests/fail/stacked_borrows/illegal_read4.stderr index 98bfd56cd3ce3..0d460df3929a5 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/illegal_read4.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/illegal_read4.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: attempting a read access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/illegal_read4.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_read4.rs:LL:CC | LL | let _illegal = *xref2; | ^^^^^^ @@ -10,17 +10,17 @@ LL | let _illegal = *xref2; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a Unique retag at offsets [0x0..0x4] - --> $DIR/illegal_read4.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_read4.rs:LL:CC | LL | let xref2 = unsafe { &mut *xraw }; | ^^^^^^^^^^ help: was later invalidated at offsets [0x0..0x4] by a read access - --> $DIR/illegal_read4.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_read4.rs:LL:CC | LL | let _val = unsafe { *xraw }; // use the raw again, this invalidates xref2 *even* with the special read except for uniq refs | ^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/illegal_read4.rs:LL:CC + = note: inside `main` at tests/fail/stacked_borrows/illegal_read4.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/illegal_read5.stderr b/src/tools/miri/tests/fail/stacked_borrows/illegal_read5.stderr index e3b18e7d4f81f..9862d8a1a34fe 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/illegal_read5.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/illegal_read5.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: attempting a read access using at ALLOC[$HEX], but that tag does not exist in the borrow stack for this location - --> $DIR/illegal_read5.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_read5.rs:LL:CC | LL | let _val = *xref; // the mutable one is dead and gone | ^^^^^ @@ -10,17 +10,17 @@ LL | let _val = *xref; // the mutable one is dead and gone = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a Unique retag at offsets [$HEX..$HEX] - --> $DIR/illegal_read5.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_read5.rs:LL:CC | LL | let xref: &mut i32 = &mut *refmut; | ^^^^^^^^^^^^ help: was later invalidated at offsets [$HEX..$HEX] by a read access - --> $DIR/illegal_read5.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_read5.rs:LL:CC | LL | mem::forget(unsafe { ptr::read(xshr) }); // but after reading through the shared ref | ^^^^^^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/illegal_read5.rs:LL:CC + = note: inside `main` at tests/fail/stacked_borrows/illegal_read5.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/illegal_read6.stderr b/src/tools/miri/tests/fail/stacked_borrows/illegal_read6.stderr index 415a85bd68c51..31c5ad160a9d6 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/illegal_read6.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/illegal_read6.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: attempting a read access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/illegal_read6.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_read6.rs:LL:CC | LL | let _val = *raw; | ^^^^ @@ -10,17 +10,17 @@ LL | let _val = *raw; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadWrite retag at offsets [0x0..0x4] - --> $DIR/illegal_read6.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_read6.rs:LL:CC | LL | let raw = x as *mut _; | ^ help: was later invalidated at offsets [0x0..0x4] by a Unique retag - --> $DIR/illegal_read6.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_read6.rs:LL:CC | LL | let x = &mut *x; // kill `raw` | ^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/illegal_read6.rs:LL:CC + = note: inside `main` at tests/fail/stacked_borrows/illegal_read6.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/illegal_read7.stderr b/src/tools/miri/tests/fail/stacked_borrows/illegal_read7.stderr index 248ae62d5ebe2..4ae41dd8ee637 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/illegal_read7.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/illegal_read7.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: trying to retag from for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/illegal_read7.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_read7.rs:LL:CC | LL | let _val = *x.get_mut(); | ^ @@ -10,17 +10,17 @@ LL | let _val = *x.get_mut(); = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a Unique retag at offsets [0x0..0x4] - --> $DIR/illegal_read7.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_read7.rs:LL:CC | LL | let x = &mut *raw; | ^^^^^^^^^ help: was later invalidated at offsets [0x0..0x4] by a read access - --> $DIR/illegal_read7.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_read7.rs:LL:CC | LL | let _val = ptr::read(raw); | ^^^^^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/illegal_read7.rs:LL:CC + = note: inside `main` at tests/fail/stacked_borrows/illegal_read7.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/illegal_read8.stderr b/src/tools/miri/tests/fail/stacked_borrows/illegal_read8.stderr index fd5ed383f1a6b..fc07c3174ba00 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/illegal_read8.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/illegal_read8.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: attempting a read access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/illegal_read8.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_read8.rs:LL:CC | LL | let _fail = *y1; | ^^^ @@ -10,17 +10,17 @@ LL | let _fail = *y1; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadOnly retag at offsets [0x0..0x4] - --> $DIR/illegal_read8.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_read8.rs:LL:CC | LL | let y1: &i32 = mem::transmute(&*x); // launder lifetimes | ^^^^^^^^^^^^^^^^^^^ help: was later invalidated at offsets [0x0..0x4] by a write access - --> $DIR/illegal_read8.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_read8.rs:LL:CC | LL | *y2 += 1; | ^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/illegal_read8.rs:LL:CC + = note: inside `main` at tests/fail/stacked_borrows/illegal_read8.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/illegal_read_despite_exposed1.stderr b/src/tools/miri/tests/fail/stacked_borrows/illegal_read_despite_exposed1.stderr index 33fcd11ff7a5f..18a47bb34621f 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/illegal_read_despite_exposed1.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/illegal_read_despite_exposed1.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: attempting a read access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/illegal_read_despite_exposed1.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_read_despite_exposed1.rs:LL:CC | LL | let _val = *root2; | ^^^^^^ @@ -10,17 +10,17 @@ LL | let _val = *root2; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a Unique retag at offsets [0x0..0x4] - --> $DIR/illegal_read_despite_exposed1.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_read_despite_exposed1.rs:LL:CC | LL | let root2 = &mut *exposed_ptr; | ^^^^^^^^^^^^^^^^^ help: was later invalidated at offsets [0x0..0x4] by a write access - --> $DIR/illegal_read_despite_exposed1.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_read_despite_exposed1.rs:LL:CC | LL | *exposed_ptr = 0; | ^^^^^^^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/illegal_read_despite_exposed1.rs:LL:CC + = note: inside `main` at tests/fail/stacked_borrows/illegal_read_despite_exposed1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/illegal_read_despite_exposed2.stderr b/src/tools/miri/tests/fail/stacked_borrows/illegal_read_despite_exposed2.stderr index a948c5df1661e..245bce199389e 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/illegal_read_despite_exposed2.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/illegal_read_despite_exposed2.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: attempting a read access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/illegal_read_despite_exposed2.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_read_despite_exposed2.rs:LL:CC | LL | let _val = *root2; | ^^^^^^ @@ -10,17 +10,17 @@ LL | let _val = *root2; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a Unique retag at offsets [0x0..0x4] - --> $DIR/illegal_read_despite_exposed2.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_read_despite_exposed2.rs:LL:CC | LL | let root2 = &mut *exposed_ptr; | ^^^^^^^^^^^^^^^^^ help: was later invalidated at offsets [0x0..0x4] by a read access - --> $DIR/illegal_read_despite_exposed2.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_read_despite_exposed2.rs:LL:CC | LL | let _val = *exposed_ptr; | ^^^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/illegal_read_despite_exposed2.rs:LL:CC + = note: inside `main` at tests/fail/stacked_borrows/illegal_read_despite_exposed2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/illegal_write2.stderr b/src/tools/miri/tests/fail/stacked_borrows/illegal_write2.stderr index 65b4fc5f3fa06..595d0ca758800 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/illegal_write2.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/illegal_write2.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: attempting a write access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/illegal_write2.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_write2.rs:LL:CC | LL | unsafe { *target2 = 13 }; | ^^^^^^^^^^^^^ @@ -10,17 +10,17 @@ LL | unsafe { *target2 = 13 }; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadWrite retag at offsets [0x0..0x4] - --> $DIR/illegal_write2.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_write2.rs:LL:CC | LL | let target2 = target as *mut _; | ^^^^^^ help: was later invalidated at offsets [0x0..0x4] by a Unique retag - --> $DIR/illegal_write2.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_write2.rs:LL:CC | LL | drop(&mut *target); // reborrow | ^^^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/illegal_write2.rs:LL:CC + = note: inside `main` at tests/fail/stacked_borrows/illegal_write2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/illegal_write3.stderr b/src/tools/miri/tests/fail/stacked_borrows/illegal_write3.stderr index 08d9f33a1699d..6805b359367e1 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/illegal_write3.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/illegal_write3.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: attempting a write access using at ALLOC[0x0], but that tag only grants SharedReadOnly permission for this location - --> $DIR/illegal_write3.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_write3.rs:LL:CC | LL | unsafe { *ptr = 42 }; | ^^^^^^^^^ @@ -10,12 +10,12 @@ LL | unsafe { *ptr = 42 }; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadOnly retag at offsets [0x0..0x4] - --> $DIR/illegal_write3.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_write3.rs:LL:CC | LL | let ptr = r#ref as *const _ as *mut _; // raw ptr, with raw tag | ^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/illegal_write3.rs:LL:CC + = note: inside `main` at tests/fail/stacked_borrows/illegal_write3.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/illegal_write4.stderr b/src/tools/miri/tests/fail/stacked_borrows/illegal_write4.stderr index 4ee5ec3853958..0134987caf3a9 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/illegal_write4.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/illegal_write4.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: attempting a read access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/illegal_write4.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_write4.rs:LL:CC | LL | let _val = *reference; | ^^^^^^^^^^ @@ -10,17 +10,17 @@ LL | let _val = *reference; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadOnly retag at offsets [0x0..0x4] - --> $DIR/illegal_write4.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_write4.rs:LL:CC | LL | let reference = unsafe { &*raw }; // freeze | ^^^^^ help: was later invalidated at offsets [0x0..0x4] by a Unique retag - --> $DIR/illegal_write4.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_write4.rs:LL:CC | LL | let _mut_ref: &mut i32 = unsafe { mem::transmute(raw) }; // &mut, with raw tag | ^^^^^^^^^^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/illegal_write4.rs:LL:CC + = note: inside `main` at tests/fail/stacked_borrows/illegal_write4.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/illegal_write_despite_exposed1.stderr b/src/tools/miri/tests/fail/stacked_borrows/illegal_write_despite_exposed1.stderr index 70e9038bab3fb..42e088dc075e2 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/illegal_write_despite_exposed1.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/illegal_write_despite_exposed1.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: attempting a read access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/illegal_write_despite_exposed1.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_write_despite_exposed1.rs:LL:CC | LL | let _val = *root2; | ^^^^^^ @@ -10,17 +10,17 @@ LL | let _val = *root2; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadOnly retag at offsets [0x0..0x4] - --> $DIR/illegal_write_despite_exposed1.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_write_despite_exposed1.rs:LL:CC | LL | let root2 = &*exposed_ptr; | ^^^^^^^^^^^^^ help: was later invalidated at offsets [0x0..0x4] by a write access - --> $DIR/illegal_write_despite_exposed1.rs:LL:CC + --> tests/fail/stacked_borrows/illegal_write_despite_exposed1.rs:LL:CC | LL | *exposed_ptr = 0; | ^^^^^^^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/illegal_write_despite_exposed1.rs:LL:CC + = note: inside `main` at tests/fail/stacked_borrows/illegal_write_despite_exposed1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/interior_mut1.stderr b/src/tools/miri/tests/fail/stacked_borrows/interior_mut1.stderr index f8bc1667ddb15..3d43bf7e6bf31 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/interior_mut1.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/interior_mut1.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: trying to retag from for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/interior_mut1.rs:LL:CC + --> tests/fail/stacked_borrows/interior_mut1.rs:LL:CC | LL | let _val = *inner_shr.get(); | ^^^^^^^^^ @@ -10,17 +10,17 @@ LL | let _val = *inner_shr.get(); = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadWrite retag at offsets [0x0..0x4] - --> $DIR/interior_mut1.rs:LL:CC + --> tests/fail/stacked_borrows/interior_mut1.rs:LL:CC | LL | let inner_shr = &*inner_uniq; // adds a SharedReadWrite | ^^^^^^^^^^^^ help: was later invalidated at offsets [0x0..0x4] by a write access - --> $DIR/interior_mut1.rs:LL:CC + --> tests/fail/stacked_borrows/interior_mut1.rs:LL:CC | LL | *c.get() = UnsafeCell::new(1); // invalidates inner_shr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/interior_mut1.rs:LL:CC + = note: inside `main` at tests/fail/stacked_borrows/interior_mut1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/interior_mut2.stderr b/src/tools/miri/tests/fail/stacked_borrows/interior_mut2.stderr index a69fc6ff8bab1..a7a1521bd63ad 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/interior_mut2.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/interior_mut2.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: trying to retag from for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/interior_mut2.rs:LL:CC + --> tests/fail/stacked_borrows/interior_mut2.rs:LL:CC | LL | let _val = *inner_shr.get(); | ^^^^^^^^^ @@ -10,17 +10,17 @@ LL | let _val = *inner_shr.get(); = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadWrite retag at offsets [0x0..0x4] - --> $DIR/interior_mut2.rs:LL:CC + --> tests/fail/stacked_borrows/interior_mut2.rs:LL:CC | LL | let inner_shr = &*inner_uniq; | ^^^^^^^^^^^^ help: was later invalidated at offsets [0x0..0x4] by a write access - --> $DIR/interior_mut2.rs:LL:CC + --> tests/fail/stacked_borrows/interior_mut2.rs:LL:CC | LL | *c.get() = UnsafeCell::new(0); // now inner_shr gets invalidated | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/interior_mut2.rs:LL:CC + = note: inside `main` at tests/fail/stacked_borrows/interior_mut2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/invalidate_against_protector1.stderr b/src/tools/miri/tests/fail/stacked_borrows/invalidate_against_protector1.stderr index 96cdce5a778b4..5956a3f675314 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/invalidate_against_protector1.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/invalidate_against_protector1.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: not granting access to tag because that would remove [Unique for ] which is strongly protected - --> $DIR/invalidate_against_protector1.rs:LL:CC + --> tests/fail/stacked_borrows/invalidate_against_protector1.rs:LL:CC | LL | let _val = unsafe { *x }; | ^^ not granting access to tag because that would remove [Unique for ] which is strongly protected @@ -7,19 +7,19 @@ LL | let _val = unsafe { *x }; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadWrite retag at offsets [0x0..0x4] - --> $DIR/invalidate_against_protector1.rs:LL:CC + --> tests/fail/stacked_borrows/invalidate_against_protector1.rs:LL:CC | LL | let xraw = &mut x as *mut _; | ^^^^^^ help: is this argument - --> $DIR/invalidate_against_protector1.rs:LL:CC + --> tests/fail/stacked_borrows/invalidate_against_protector1.rs:LL:CC | LL | fn inner(x: *mut i32, _y: &mut i32) { | ^^ = note: BACKTRACE (of the first span): - = note: inside `inner` at $DIR/invalidate_against_protector1.rs:LL:CC + = note: inside `inner` at tests/fail/stacked_borrows/invalidate_against_protector1.rs:LL:CC note: inside `main` - --> $DIR/invalidate_against_protector1.rs:LL:CC + --> tests/fail/stacked_borrows/invalidate_against_protector1.rs:LL:CC | LL | inner(xraw, xref); | ^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/stacked_borrows/load_invalid_mut.stderr b/src/tools/miri/tests/fail/stacked_borrows/load_invalid_mut.stderr index 9d707c3f85d58..733162acff793 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/load_invalid_mut.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/load_invalid_mut.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: trying to retag from for Unique permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/load_invalid_mut.rs:LL:CC + --> tests/fail/stacked_borrows/load_invalid_mut.rs:LL:CC | LL | let _val = *xref_in_mem; | ^^^^^^^^^^^^ @@ -10,17 +10,17 @@ LL | let _val = *xref_in_mem; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a Unique retag at offsets [0x0..0x4] - --> $DIR/load_invalid_mut.rs:LL:CC + --> tests/fail/stacked_borrows/load_invalid_mut.rs:LL:CC | LL | let xref_in_mem = Box::new(xref); | ^^^^^^^^^^^^^^ help: was later invalidated at offsets [0x0..0x4] by a read access - --> $DIR/load_invalid_mut.rs:LL:CC + --> tests/fail/stacked_borrows/load_invalid_mut.rs:LL:CC | LL | let _val = unsafe { *xraw }; // invalidate xref | ^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/load_invalid_mut.rs:LL:CC + = note: inside `main` at tests/fail/stacked_borrows/load_invalid_mut.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/pass_invalid_mut.stderr b/src/tools/miri/tests/fail/stacked_borrows/pass_invalid_mut.stderr index 0a017e182644f..c910a05de1c5e 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/pass_invalid_mut.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/pass_invalid_mut.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: trying to retag from for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/pass_invalid_mut.rs:LL:CC + --> tests/fail/stacked_borrows/pass_invalid_mut.rs:LL:CC | LL | foo(xref); | ^^^^ @@ -10,17 +10,17 @@ LL | foo(xref); = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a Unique retag at offsets [0x0..0x4] - --> $DIR/pass_invalid_mut.rs:LL:CC + --> tests/fail/stacked_borrows/pass_invalid_mut.rs:LL:CC | LL | let xref = unsafe { &mut *xraw }; | ^^^^^^^^^^ help: was later invalidated at offsets [0x0..0x4] by a read access - --> $DIR/pass_invalid_mut.rs:LL:CC + --> tests/fail/stacked_borrows/pass_invalid_mut.rs:LL:CC | LL | let _val = unsafe { *xraw }; // invalidate xref | ^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/pass_invalid_mut.rs:LL:CC + = note: inside `main` at tests/fail/stacked_borrows/pass_invalid_mut.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/pointer_smuggling.stderr b/src/tools/miri/tests/fail/stacked_borrows/pointer_smuggling.stderr index 1fddcaf3dad0b..58c6cd4c31811 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/pointer_smuggling.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/pointer_smuggling.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: attempting a read access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/pointer_smuggling.rs:LL:CC + --> tests/fail/stacked_borrows/pointer_smuggling.rs:LL:CC | LL | let _x = unsafe { *PTR }; | ^^^^ @@ -10,19 +10,19 @@ LL | let _x = unsafe { *PTR }; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadWrite retag at offsets [0x0..0x1] - --> $DIR/pointer_smuggling.rs:LL:CC + --> tests/fail/stacked_borrows/pointer_smuggling.rs:LL:CC | LL | PTR = x; | ^ help: was later invalidated at offsets [0x0..0x1] by a write access - --> $DIR/pointer_smuggling.rs:LL:CC + --> tests/fail/stacked_borrows/pointer_smuggling.rs:LL:CC | LL | *val = 2; // this invalidates any raw ptrs `fun1` might have created. | ^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `fun2` at $DIR/pointer_smuggling.rs:LL:CC + = note: inside `fun2` at tests/fail/stacked_borrows/pointer_smuggling.rs:LL:CC note: inside `main` - --> $DIR/pointer_smuggling.rs:LL:CC + --> tests/fail/stacked_borrows/pointer_smuggling.rs:LL:CC | LL | fun2(); // if they now use a raw ptr they break our reference | ^^^^^^ diff --git a/src/tools/miri/tests/fail/stacked_borrows/raw_tracking.stderr b/src/tools/miri/tests/fail/stacked_borrows/raw_tracking.stderr index 0d07d154ba5b2..aa320ea908c01 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/raw_tracking.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/raw_tracking.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: attempting a write access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/raw_tracking.rs:LL:CC + --> tests/fail/stacked_borrows/raw_tracking.rs:LL:CC | LL | unsafe { *raw1 = 13 }; | ^^^^^^^^^^ @@ -10,17 +10,17 @@ LL | unsafe { *raw1 = 13 }; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadWrite retag at offsets [0x0..0x4] - --> $DIR/raw_tracking.rs:LL:CC + --> tests/fail/stacked_borrows/raw_tracking.rs:LL:CC | LL | let raw1 = &mut l as *mut _; | ^^^^^^ help: was later invalidated at offsets [0x0..0x4] by a Unique retag - --> $DIR/raw_tracking.rs:LL:CC + --> tests/fail/stacked_borrows/raw_tracking.rs:LL:CC | LL | let raw2 = &mut l as *mut _; // invalidates raw1 | ^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/raw_tracking.rs:LL:CC + = note: inside `main` at tests/fail/stacked_borrows/raw_tracking.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/retag_data_race_protected_read.stderr b/src/tools/miri/tests/fail/stacked_borrows/retag_data_race_protected_read.stderr index 47ae4b5d46d6f..fd5d83211db81 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/retag_data_race_protected_read.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/retag_data_race_protected_read.stderr @@ -1,11 +1,11 @@ error: Undefined Behavior: Data race detected between (1) non-atomic read on thread `main` and (2) retag write of type `i32` on thread `unnamed-ID` at ALLOC. (2) just happened here - --> $DIR/retag_data_race_protected_read.rs:LL:CC + --> tests/fail/stacked_borrows/retag_data_race_protected_read.rs:LL:CC | LL | retag(unsafe { &mut *ptr.0 }); | ^^^^^^^^^^^ Data race detected between (1) non-atomic read on thread `main` and (2) retag write of type `i32` on thread `unnamed-ID` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/retag_data_race_protected_read.rs:LL:CC + --> tests/fail/stacked_borrows/retag_data_race_protected_read.rs:LL:CC | LL | unsafe { ptr.0.read() }; | ^^^^^^^^^^^^ @@ -15,7 +15,7 @@ LL | unsafe { ptr.0.read() }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at $DIR/retag_data_race_protected_read.rs:LL:CC + = note: inside closure at tests/fail/stacked_borrows/retag_data_race_protected_read.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/retag_data_race_read.stderr b/src/tools/miri/tests/fail/stacked_borrows/retag_data_race_read.stderr index 9fe9fbeda449a..87155ebc51827 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/retag_data_race_read.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/retag_data_race_read.stderr @@ -1,11 +1,11 @@ error: Undefined Behavior: Data race detected between (1) retag read on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here - --> $DIR/retag_data_race_read.rs:LL:CC + --> tests/fail/stacked_borrows/retag_data_race_read.rs:LL:CC | LL | *p = 5; | ^^^^^^ Data race detected between (1) retag read on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/retag_data_race_read.rs:LL:CC + --> tests/fail/stacked_borrows/retag_data_race_read.rs:LL:CC | LL | let _r = &*p; | ^^^ @@ -15,9 +15,9 @@ LL | let _r = &*p; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside `thread_2` at $DIR/retag_data_race_read.rs:LL:CC + = note: inside `thread_2` at tests/fail/stacked_borrows/retag_data_race_read.rs:LL:CC note: inside closure - --> $DIR/retag_data_race_read.rs:LL:CC + --> tests/fail/stacked_borrows/retag_data_race_read.rs:LL:CC | LL | let t2 = std::thread::spawn(move || thread_2(p)); | ^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut.stderr b/src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut.stderr index 78008e92642cd..760ed783175f8 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: trying to retag from for Unique permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location - --> $DIR/return_invalid_mut.rs:LL:CC + --> tests/fail/stacked_borrows/return_invalid_mut.rs:LL:CC | LL | ret | ^^^ @@ -10,19 +10,19 @@ LL | ret = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a Unique retag at offsets [0x4..0x8] - --> $DIR/return_invalid_mut.rs:LL:CC + --> tests/fail/stacked_borrows/return_invalid_mut.rs:LL:CC | LL | let ret = unsafe { &mut (*xraw).1 }; | ^^^^^^^^^^^^^^ help: was later invalidated at offsets [0x0..0x8] by a read access - --> $DIR/return_invalid_mut.rs:LL:CC + --> tests/fail/stacked_borrows/return_invalid_mut.rs:LL:CC | LL | let _val = unsafe { *xraw }; // invalidate xref | ^^^^^ = note: BACKTRACE (of the first span): - = note: inside `foo` at $DIR/return_invalid_mut.rs:LL:CC + = note: inside `foo` at tests/fail/stacked_borrows/return_invalid_mut.rs:LL:CC note: inside `main` - --> $DIR/return_invalid_mut.rs:LL:CC + --> tests/fail/stacked_borrows/return_invalid_mut.rs:LL:CC | LL | foo(&mut (1, 2)); | ^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut_option.stderr b/src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut_option.stderr index b9ae34df0775c..3175e09962062 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut_option.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut_option.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: trying to retag from for Unique permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location - --> $DIR/return_invalid_mut_option.rs:LL:CC + --> tests/fail/stacked_borrows/return_invalid_mut_option.rs:LL:CC | LL | ret | ^^^ @@ -11,19 +11,19 @@ LL | ret = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a Unique retag at offsets [0x4..0x8] - --> $DIR/return_invalid_mut_option.rs:LL:CC + --> tests/fail/stacked_borrows/return_invalid_mut_option.rs:LL:CC | LL | let ret = Some(ret); | ^^^^^^^^^ help: was later invalidated at offsets [0x0..0x8] by a read access - --> $DIR/return_invalid_mut_option.rs:LL:CC + --> tests/fail/stacked_borrows/return_invalid_mut_option.rs:LL:CC | LL | let _val = unsafe { *xraw }; // invalidate xref | ^^^^^ = note: BACKTRACE (of the first span): - = note: inside `foo` at $DIR/return_invalid_mut_option.rs:LL:CC + = note: inside `foo` at tests/fail/stacked_borrows/return_invalid_mut_option.rs:LL:CC note: inside `main` - --> $DIR/return_invalid_mut_option.rs:LL:CC + --> tests/fail/stacked_borrows/return_invalid_mut_option.rs:LL:CC | LL | match foo(&mut (1, 2)) { | ^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut_tuple.stderr b/src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut_tuple.stderr index 7522115c5166b..2cc3ba2c9a94b 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut_tuple.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut_tuple.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: trying to retag from for Unique permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location - --> $DIR/return_invalid_mut_tuple.rs:LL:CC + --> tests/fail/stacked_borrows/return_invalid_mut_tuple.rs:LL:CC | LL | ret | ^^^ @@ -11,19 +11,19 @@ LL | ret = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a Unique retag at offsets [0x4..0x8] - --> $DIR/return_invalid_mut_tuple.rs:LL:CC + --> tests/fail/stacked_borrows/return_invalid_mut_tuple.rs:LL:CC | LL | let ret = (unsafe { &mut (*xraw).1 },); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: was later invalidated at offsets [0x0..0x8] by a read access - --> $DIR/return_invalid_mut_tuple.rs:LL:CC + --> tests/fail/stacked_borrows/return_invalid_mut_tuple.rs:LL:CC | LL | let _val = unsafe { *xraw }; // invalidate xref | ^^^^^ = note: BACKTRACE (of the first span): - = note: inside `foo` at $DIR/return_invalid_mut_tuple.rs:LL:CC + = note: inside `foo` at tests/fail/stacked_borrows/return_invalid_mut_tuple.rs:LL:CC note: inside `main` - --> $DIR/return_invalid_mut_tuple.rs:LL:CC + --> tests/fail/stacked_borrows/return_invalid_mut_tuple.rs:LL:CC | LL | foo(&mut (1, 2)).0; | ^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/stacked_borrows/shared_rw_borrows_are_weak1.stderr b/src/tools/miri/tests/fail/stacked_borrows/shared_rw_borrows_are_weak1.stderr index b5106c9d94047..56d9783367bad 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/shared_rw_borrows_are_weak1.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/shared_rw_borrows_are_weak1.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: trying to retag from for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/shared_rw_borrows_are_weak1.rs:LL:CC + --> tests/fail/stacked_borrows/shared_rw_borrows_are_weak1.rs:LL:CC | LL | y.get_mut(); | ^ @@ -10,17 +10,17 @@ LL | y.get_mut(); = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a Unique retag at offsets [0x0..0x4] - --> $DIR/shared_rw_borrows_are_weak1.rs:LL:CC + --> tests/fail/stacked_borrows/shared_rw_borrows_are_weak1.rs:LL:CC | LL | let y: &mut Cell = mem::transmute(&mut *x); // launder lifetime | ^^^^^^^^^^^^^^^^^^^^^^^ help: was later invalidated at offsets [0x0..0x4] by a Unique retag - --> $DIR/shared_rw_borrows_are_weak1.rs:LL:CC + --> tests/fail/stacked_borrows/shared_rw_borrows_are_weak1.rs:LL:CC | LL | shr_rw.set(1); | ^^^^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/shared_rw_borrows_are_weak1.rs:LL:CC + = note: inside `main` at tests/fail/stacked_borrows/shared_rw_borrows_are_weak1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/shared_rw_borrows_are_weak2.stderr b/src/tools/miri/tests/fail/stacked_borrows/shared_rw_borrows_are_weak2.stderr index ccea83db8574e..8ca56afc12194 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/shared_rw_borrows_are_weak2.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/shared_rw_borrows_are_weak2.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: attempting a read access using at ALLOC[$HEX], but that tag does not exist in the borrow stack for this location - --> $DIR/shared_rw_borrows_are_weak2.rs:LL:CC + --> tests/fail/stacked_borrows/shared_rw_borrows_are_weak2.rs:LL:CC | LL | let _val = *y; | ^^ @@ -10,17 +10,17 @@ LL | let _val = *y; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadOnly retag at offsets [$HEX..$HEX] - --> $DIR/shared_rw_borrows_are_weak2.rs:LL:CC + --> tests/fail/stacked_borrows/shared_rw_borrows_are_weak2.rs:LL:CC | LL | let y: &i32 = mem::transmute(&*x.borrow()); // launder lifetime | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: was later invalidated at offsets [$HEX..$HEX] by a Unique retag - --> $DIR/shared_rw_borrows_are_weak2.rs:LL:CC + --> tests/fail/stacked_borrows/shared_rw_borrows_are_weak2.rs:LL:CC | LL | shr_rw.replace(1); | ^^^^^^^^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/shared_rw_borrows_are_weak2.rs:LL:CC + = note: inside `main` at tests/fail/stacked_borrows/shared_rw_borrows_are_weak2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/static_memory_modification.stderr b/src/tools/miri/tests/fail/stacked_borrows/static_memory_modification.stderr index f605fa9d3b962..b86a64623ba75 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/static_memory_modification.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/static_memory_modification.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: writing to ALLOC which is read-only - --> $DIR/static_memory_modification.rs:LL:CC + --> tests/fail/stacked_borrows/static_memory_modification.rs:LL:CC | LL | std::mem::transmute::<&usize, &mut usize>(&X) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ writing to ALLOC which is read-only @@ -7,7 +7,7 @@ LL | std::mem::transmute::<&usize, &mut usize>(&X) = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/static_memory_modification.rs:LL:CC + = note: inside `main` at tests/fail/stacked_borrows/static_memory_modification.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/track_caller.stderr b/src/tools/miri/tests/fail/stacked_borrows/track_caller.stderr index f341222a664c3..163ec84281df0 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/track_caller.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/track_caller.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: attempting a read access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/track_caller.rs:LL:CC + --> tests/fail/stacked_borrows/track_caller.rs:LL:CC | LL | let _val = *xref; // ...but any use of raw will invalidate our ref. | ^^^^^ @@ -10,17 +10,17 @@ LL | let _val = *xref; // ...but any use of raw will invalidate our ref. = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a Unique retag at offsets [0x0..0x4] - --> $DIR/track_caller.rs:LL:CC + --> tests/fail/stacked_borrows/track_caller.rs:LL:CC | LL | let xref = unsafe { &mut *xraw }; // derived from raw, so using raw is still ok... | ^^^^^^^^^^ help: was later invalidated at offsets [0x0..0x4] by a read access - --> $DIR/track_caller.rs:LL:CC + --> tests/fail/stacked_borrows/track_caller.rs:LL:CC | LL | callee(xraw); | ^^^^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/track_caller.rs:LL:CC + = note: inside `main` at tests/fail/stacked_borrows/track_caller.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/transmute-is-no-escape.stderr b/src/tools/miri/tests/fail/stacked_borrows/transmute-is-no-escape.stderr index 7d8132b85c89e..becd6681eca4b 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/transmute-is-no-escape.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/transmute-is-no-escape.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: attempting a write access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location - --> $DIR/transmute-is-no-escape.rs:LL:CC + --> tests/fail/stacked_borrows/transmute-is-no-escape.rs:LL:CC | LL | unsafe { *raw = 13 }; | ^^^^^^^^^ @@ -10,12 +10,12 @@ LL | unsafe { *raw = 13 }; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadWrite retag at offsets [0x4..0x8] - --> $DIR/transmute-is-no-escape.rs:LL:CC + --> tests/fail/stacked_borrows/transmute-is-no-escape.rs:LL:CC | LL | let raw = (&mut x[1] as *mut i32).wrapping_offset(-1); | ^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/transmute-is-no-escape.rs:LL:CC + = note: inside `main` at tests/fail/stacked_borrows/transmute-is-no-escape.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/unescaped_local.stderr b/src/tools/miri/tests/fail/stacked_borrows/unescaped_local.stderr index 50c02b3455e4f..08c2cf2099b55 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/unescaped_local.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/unescaped_local.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: attempting a write access using at ALLOC[0x0], but no exposed tags have suitable permission in the borrow stack for this location - --> $DIR/unescaped_local.rs:LL:CC + --> tests/fail/stacked_borrows/unescaped_local.rs:LL:CC | LL | *raw = 13; | ^^^^^^^^^ @@ -10,7 +10,7 @@ LL | *raw = 13; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information = note: BACKTRACE: - = note: inside `main` at $DIR/unescaped_local.rs:LL:CC + = note: inside `main` at tests/fail/stacked_borrows/unescaped_local.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/unescaped_static.stderr b/src/tools/miri/tests/fail/stacked_borrows/unescaped_static.stderr index 7578b89708a82..fb48edc5dddf5 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/unescaped_static.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/unescaped_static.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: attempting a read access using at ALLOC[0x1], but that tag does not exist in the borrow stack for this location - --> $DIR/unescaped_static.rs:LL:CC + --> tests/fail/stacked_borrows/unescaped_static.rs:LL:CC | LL | let _val = unsafe { *ptr_to_first.add(1) }; | ^^^^^^^^^^^^^^^^^^^^ @@ -10,12 +10,12 @@ LL | let _val = unsafe { *ptr_to_first.add(1) }; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: was created by a SharedReadOnly retag at offsets [0x0..0x1] - --> $DIR/unescaped_static.rs:LL:CC + --> tests/fail/stacked_borrows/unescaped_static.rs:LL:CC | LL | let ptr_to_first = &ARRAY[0] as *const u8; | ^^^^^^^^^ = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/unescaped_static.rs:LL:CC + = note: inside `main` at tests/fail/stacked_borrows/unescaped_static.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/zst_slice.stderr b/src/tools/miri/tests/fail/stacked_borrows/zst_slice.stderr index acae479ced28e..01e3c60f0fe38 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/zst_slice.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/zst_slice.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: trying to retag from for SharedReadOnly permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location - --> $DIR/zst_slice.rs:LL:CC + --> tests/fail/stacked_borrows/zst_slice.rs:LL:CC | LL | assert_eq!(*s.as_ptr().add(1), 2); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -10,7 +10,7 @@ LL | assert_eq!(*s.as_ptr().add(1), 2); = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information help: would have been created here, but this is a zero-size retag ([0x0..0x0]) so the tag in question does not exist anywhere - --> $DIR/zst_slice.rs:LL:CC + --> tests/fail/stacked_borrows/zst_slice.rs:LL:CC | LL | assert_eq!(*s.as_ptr().add(1), 2); | ^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/static_memory_modification1.stderr b/src/tools/miri/tests/fail/static_memory_modification1.stderr index 877cf1d6e4739..2b2cd4af3da05 100644 --- a/src/tools/miri/tests/fail/static_memory_modification1.stderr +++ b/src/tools/miri/tests/fail/static_memory_modification1.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: writing to ALLOC which is read-only - --> $DIR/static_memory_modification1.rs:LL:CC + --> tests/fail/static_memory_modification1.rs:LL:CC | LL | *std::mem::transmute::<&usize, &mut usize>(&X) = 6; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ writing to ALLOC which is read-only @@ -7,7 +7,7 @@ LL | *std::mem::transmute::<&usize, &mut usize>(&X) = 6; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/static_memory_modification1.rs:LL:CC + = note: inside `main` at tests/fail/static_memory_modification1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/static_memory_modification2.stderr b/src/tools/miri/tests/fail/static_memory_modification2.stderr index 77bbace4696b1..99c7f15d9ffcf 100644 --- a/src/tools/miri/tests/fail/static_memory_modification2.stderr +++ b/src/tools/miri/tests/fail/static_memory_modification2.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: writing to ALLOC which is read-only - --> $DIR/static_memory_modification2.rs:LL:CC + --> tests/fail/static_memory_modification2.rs:LL:CC | LL | transmute::<&[u8], &mut [u8]>(s.as_bytes())[4] = 42; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ writing to ALLOC which is read-only @@ -7,7 +7,7 @@ LL | transmute::<&[u8], &mut [u8]>(s.as_bytes())[4] = 42; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/static_memory_modification2.rs:LL:CC + = note: inside `main` at tests/fail/static_memory_modification2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/static_memory_modification3.stderr b/src/tools/miri/tests/fail/static_memory_modification3.stderr index a04609805cb84..cb37a2a2dab9a 100644 --- a/src/tools/miri/tests/fail/static_memory_modification3.stderr +++ b/src/tools/miri/tests/fail/static_memory_modification3.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: writing to ALLOC which is read-only - --> $DIR/static_memory_modification3.rs:LL:CC + --> tests/fail/static_memory_modification3.rs:LL:CC | LL | transmute::<&[u8], &mut [u8]>(bs)[4] = 42; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ writing to ALLOC which is read-only @@ -7,7 +7,7 @@ LL | transmute::<&[u8], &mut [u8]>(bs)[4] = 42; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/static_memory_modification3.rs:LL:CC + = note: inside `main` at tests/fail/static_memory_modification3.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/storage-live-dead-var.stderr b/src/tools/miri/tests/fail/storage-live-dead-var.stderr index ccc77b1c978dc..f370c28483137 100644 --- a/src/tools/miri/tests/fail/storage-live-dead-var.stderr +++ b/src/tools/miri/tests/fail/storage-live-dead-var.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: accessing a dead local variable - --> $DIR/storage-live-dead-var.rs:LL:CC + --> tests/fail/storage-live-dead-var.rs:LL:CC | LL | val = 42; | ^^^^^^^^ accessing a dead local variable @@ -7,7 +7,7 @@ LL | val = 42; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/storage-live-dead-var.rs:LL:CC + = note: inside `main` at tests/fail/storage-live-dead-var.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/storage-live-resets-var.stderr b/src/tools/miri/tests/fail/storage-live-resets-var.stderr index 07d39cc9d6b3f..099dd3a1f7e7b 100644 --- a/src/tools/miri/tests/fail/storage-live-resets-var.stderr +++ b/src/tools/miri/tests/fail/storage-live-resets-var.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value: encountered uninitialized memory, but expected an integer - --> $DIR/storage-live-resets-var.rs:LL:CC + --> tests/fail/storage-live-resets-var.rs:LL:CC | LL | _val2 = val; | ^^^^^^^^^^^ constructing invalid value: encountered uninitialized memory, but expected an integer @@ -7,7 +7,7 @@ LL | _val2 = val; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/storage-live-resets-var.rs:LL:CC + = note: inside `main` at tests/fail/storage-live-resets-var.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/tail_calls/signature-mismatch-arg.stderr b/src/tools/miri/tests/fail/tail_calls/signature-mismatch-arg.stderr index 8823ab9b97059..db8ab7cb46022 100644 --- a/src/tools/miri/tests/fail/tail_calls/signature-mismatch-arg.stderr +++ b/src/tools/miri/tests/fail/tail_calls/signature-mismatch-arg.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: calling a function with argument of type i32 passing data of type u32 - --> $DIR/signature-mismatch-arg.rs:LL:CC + --> tests/fail/tail_calls/signature-mismatch-arg.rs:LL:CC | LL | f(0); | ^^^^ calling a function with argument of type i32 passing data of type u32 @@ -9,7 +9,7 @@ LL | f(0); = help: this means these two types are not *guaranteed* to be ABI-compatible across all targets = help: if you think this code should be accepted anyway, please report an issue with Miri = note: BACKTRACE: - = note: inside `main` at $DIR/signature-mismatch-arg.rs:LL:CC + = note: inside `main` at tests/fail/tail_calls/signature-mismatch-arg.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/terminate-terminator.stderr b/src/tools/miri/tests/fail/terminate-terminator.stderr index 6384689c56357..e1c0fabd03d38 100644 --- a/src/tools/miri/tests/fail/terminate-terminator.stderr +++ b/src/tools/miri/tests/fail/terminate-terminator.stderr @@ -1,6 +1,6 @@ warning: You have explicitly enabled MIR optimizations, overriding Miri's default which is to completely disable them. Any optimizations may hide UB that Miri would otherwise detect, and it is not necessarily possible to predict what kind of UB will be missed. If you are enabling optimizations to make Miri run faster, we advise using cfg(miri) to shrink your workload instead. The performance benefit of enabling MIR optimizations is usually marginal at best. -thread 'main' panicked at $DIR/terminate-terminator.rs:LL:CC: +thread 'main' panicked at tests/fail/terminate-terminator.rs:LL:CC: explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect @@ -23,7 +23,7 @@ LL | ABORT(); = note: inside `core::panicking::panic_nounwind` at RUSTLIB/core/src/panicking.rs:LL:CC = note: inside `core::panicking::panic_cannot_unwind` at RUSTLIB/core/src/panicking.rs:LL:CC note: inside `has_cleanup` - --> $DIR/terminate-terminator.rs:LL:CC + --> tests/fail/terminate-terminator.rs:LL:CC | LL | / fn has_cleanup() { LL | | let _f = Foo; @@ -31,12 +31,12 @@ LL | | panic!(); LL | | } | |_^ note: inside `panic_abort` - --> $DIR/terminate-terminator.rs:LL:CC + --> tests/fail/terminate-terminator.rs:LL:CC | LL | has_cleanup(); | ^ note: inside `main` - --> $DIR/terminate-terminator.rs:LL:CC + --> tests/fail/terminate-terminator.rs:LL:CC | LL | panic_abort(); | ^ diff --git a/src/tools/miri/tests/fail/tls/tls_static_dealloc.stderr b/src/tools/miri/tests/fail/tls/tls_static_dealloc.stderr index a49933b7d0574..3a45dbfb58331 100644 --- a/src/tools/miri/tests/fail/tls/tls_static_dealloc.stderr +++ b/src/tools/miri/tests/fail/tls/tls_static_dealloc.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: memory access failed: ALLOC has been freed, so this pointer is dangling - --> $DIR/tls_static_dealloc.rs:LL:CC + --> tests/fail/tls/tls_static_dealloc.rs:LL:CC | LL | let _val = *dangling_ptr.0; | ^^^^^^^^^^^^^^^ memory access failed: ALLOC has been freed, so this pointer is dangling @@ -7,7 +7,7 @@ LL | let _val = *dangling_ptr.0; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/tls_static_dealloc.rs:LL:CC + = note: inside `main` at tests/fail/tls/tls_static_dealloc.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/tls_macro_leak.stderr b/src/tools/miri/tests/fail/tls_macro_leak.stderr index e485432815554..512932b3cb8a6 100644 --- a/src/tools/miri/tests/fail/tls_macro_leak.stderr +++ b/src/tools/miri/tests/fail/tls_macro_leak.stderr @@ -1,15 +1,15 @@ error: memory leaked: ALLOC (Rust heap, size: 4, align: 4), allocated here: - --> $DIR/tls_macro_leak.rs:LL:CC + --> tests/fail/tls_macro_leak.rs:LL:CC | LL | cell.set(Some(Box::leak(Box::new(123)))); | ^^^^^^^^^^^^^ | = note: BACKTRACE: - = note: inside closure at $DIR/tls_macro_leak.rs:LL:CC - = note: inside `std::thread::LocalKey::>>::try_with::<{closure@$DIR/tls_macro_leak.rs:LL:CC}, ()>` at RUSTLIB/std/src/thread/local.rs:LL:CC - = note: inside `std::thread::LocalKey::>>::with::<{closure@$DIR/tls_macro_leak.rs:LL:CC}, ()>` at RUSTLIB/std/src/thread/local.rs:LL:CC + = note: inside closure at tests/fail/tls_macro_leak.rs:LL:CC + = note: inside `std::thread::LocalKey::>>::try_with::<{closure@tests/fail/tls_macro_leak.rs:LL:CC}, ()>` at RUSTLIB/std/src/thread/local.rs:LL:CC + = note: inside `std::thread::LocalKey::>>::with::<{closure@tests/fail/tls_macro_leak.rs:LL:CC}, ()>` at RUSTLIB/std/src/thread/local.rs:LL:CC note: inside closure - --> $DIR/tls_macro_leak.rs:LL:CC + --> tests/fail/tls_macro_leak.rs:LL:CC | LL | / TLS.with(|cell| { LL | | cell.set(Some(Box::leak(Box::new(123)))); diff --git a/src/tools/miri/tests/fail/tls_static_leak.stderr b/src/tools/miri/tests/fail/tls_static_leak.stderr index 06d71fb456881..24306cca7ffdd 100644 --- a/src/tools/miri/tests/fail/tls_static_leak.stderr +++ b/src/tools/miri/tests/fail/tls_static_leak.stderr @@ -1,11 +1,11 @@ error: memory leaked: ALLOC (Rust heap, size: 4, align: 4), allocated here: - --> $DIR/tls_static_leak.rs:LL:CC + --> tests/fail/tls_static_leak.rs:LL:CC | LL | TLS.set(Some(Box::leak(Box::new(123)))); | ^^^^^^^^^^^^^ | = note: BACKTRACE: - = note: inside closure at $DIR/tls_static_leak.rs:LL:CC + = note: inside closure at tests/fail/tls_static_leak.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/tree_borrows/alternate-read-write.rs b/src/tools/miri/tests/fail/tree_borrows/alternate-read-write.rs index 122a8ff8752c5..fee88cf3486af 100644 --- a/src/tools/miri/tests/fail/tree_borrows/alternate-read-write.rs +++ b/src/tools/miri/tests/fail/tree_borrows/alternate-read-write.rs @@ -13,7 +13,8 @@ pub fn main() { // This time y gets Frozen... let _val = *x; // ... and the next Write attempt fails. - *y += 1; // Failure //~ ERROR: /write access through .* is forbidden/ + //~v ERROR: /write access through .* is forbidden/ + *y += 1; // Failure let _val = *x; *y += 1; // Unreachable } diff --git a/src/tools/miri/tests/fail/tree_borrows/alternate-read-write.stderr b/src/tools/miri/tests/fail/tree_borrows/alternate-read-write.stderr index bd969d089c37a..1294b52c05189 100644 --- a/src/tools/miri/tests/fail/tree_borrows/alternate-read-write.stderr +++ b/src/tools/miri/tests/fail/tree_borrows/alternate-read-write.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: write access through at ALLOC[0x0] is forbidden - --> $DIR/alternate-read-write.rs:LL:CC + --> tests/fail/tree_borrows/alternate-read-write.rs:LL:CC | LL | *y += 1; // Failure | ^^^^^^^ write access through at ALLOC[0x0] is forbidden @@ -7,24 +7,24 @@ LL | *y += 1; // Failure = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental = help: the accessed tag has state Frozen which forbids this child write access help: the accessed tag was created here, in the initial state Reserved - --> $DIR/alternate-read-write.rs:LL:CC + --> tests/fail/tree_borrows/alternate-read-write.rs:LL:CC | LL | let y = unsafe { &mut *(x as *mut u8) }; | ^^^^^^^^^^^^^^^^^^^^ help: the accessed tag later transitioned to Active due to a child write access at offsets [0x0..0x1] - --> $DIR/alternate-read-write.rs:LL:CC + --> tests/fail/tree_borrows/alternate-read-write.rs:LL:CC | LL | *y += 1; // Success | ^^^^^^^ = help: this transition corresponds to the first write to a 2-phase borrowed mutable reference help: the accessed tag later transitioned to Frozen due to a foreign read access at offsets [0x0..0x1] - --> $DIR/alternate-read-write.rs:LL:CC + --> tests/fail/tree_borrows/alternate-read-write.rs:LL:CC | LL | let _val = *x; | ^^ = help: this transition corresponds to a loss of write permissions = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/alternate-read-write.rs:LL:CC + = note: inside `main` at tests/fail/tree_borrows/alternate-read-write.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/tree_borrows/children-can-alias.default.stderr b/src/tools/miri/tests/fail/tree_borrows/children-can-alias.default.stderr index 87286f1a1a62a..b9651e21ecece 100644 --- a/src/tools/miri/tests/fail/tree_borrows/children-can-alias.default.stderr +++ b/src/tools/miri/tests/fail/tree_borrows/children-can-alias.default.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: entering unreachable code - --> $DIR/children-can-alias.rs:LL:CC + --> tests/fail/tree_borrows/children-can-alias.rs:LL:CC | LL | std::hint::unreachable_unchecked(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ entering unreachable code @@ -7,7 +7,7 @@ LL | std::hint::unreachable_unchecked(); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/children-can-alias.rs:LL:CC + = note: inside `main` at tests/fail/tree_borrows/children-can-alias.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/tree_borrows/children-can-alias.uniq.stderr b/src/tools/miri/tests/fail/tree_borrows/children-can-alias.uniq.stderr index cdfa8a74238a4..83c506abb2d73 100644 --- a/src/tools/miri/tests/fail/tree_borrows/children-can-alias.uniq.stderr +++ b/src/tools/miri/tests/fail/tree_borrows/children-can-alias.uniq.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: write access through at ALLOC[0x0] is forbidden - --> $DIR/children-can-alias.rs:LL:CC + --> tests/fail/tree_borrows/children-can-alias.rs:LL:CC | LL | child2.write(2); | ^^^^^^^^^^^^^^^ write access through at ALLOC[0x0] is forbidden @@ -7,20 +7,20 @@ LL | child2.write(2); = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental = help: the accessed tag has state Disabled which forbids this child write access help: the accessed tag was created here, in the initial state Reserved - --> $DIR/children-can-alias.rs:LL:CC + --> tests/fail/tree_borrows/children-can-alias.rs:LL:CC | LL | let child2 = x.as_ptr(); | ^^^^^^^^^^ help: the accessed tag later transitioned to Disabled due to a foreign write access at offsets [0x0..0x1] - --> $DIR/children-can-alias.rs:LL:CC + --> tests/fail/tree_borrows/children-can-alias.rs:LL:CC | LL | child1.write(1); | ^^^^^^^^^^^^^^^ = help: this transition corresponds to a loss of read and write permissions = note: BACKTRACE (of the first span): - = note: inside `raw_children_of_unique_can_alias` at $DIR/children-can-alias.rs:LL:CC + = note: inside `raw_children_of_unique_can_alias` at tests/fail/tree_borrows/children-can-alias.rs:LL:CC note: inside `main` - --> $DIR/children-can-alias.rs:LL:CC + --> tests/fail/tree_borrows/children-can-alias.rs:LL:CC | LL | raw_children_of_unique_can_alias(Unique::new_unchecked(raw)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/tree_borrows/error-range.stderr b/src/tools/miri/tests/fail/tree_borrows/error-range.stderr index 090ae4507bd75..dc4d7c1f7fffe 100644 --- a/src/tools/miri/tests/fail/tree_borrows/error-range.stderr +++ b/src/tools/miri/tests/fail/tree_borrows/error-range.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: read access through at ALLOC[0x5] is forbidden - --> $DIR/error-range.rs:LL:CC + --> tests/fail/tree_borrows/error-range.rs:LL:CC | LL | rmut[5] += 1; | ^^^^^^^^^^^^ read access through at ALLOC[0x5] is forbidden @@ -7,18 +7,18 @@ LL | rmut[5] += 1; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental = help: the accessed tag has state Disabled which forbids this child read access help: the accessed tag was created here, in the initial state Reserved - --> $DIR/error-range.rs:LL:CC + --> tests/fail/tree_borrows/error-range.rs:LL:CC | LL | let rmut = &mut *addr_of_mut!(data[0..6]); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: the accessed tag later transitioned to Disabled due to a foreign write access at offsets [0x5..0x6] - --> $DIR/error-range.rs:LL:CC + --> tests/fail/tree_borrows/error-range.rs:LL:CC | LL | data[5] = 1; | ^^^^^^^^^^^ = help: this transition corresponds to a loss of read permissions = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/error-range.rs:LL:CC + = note: inside `main` at tests/fail/tree_borrows/error-range.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/tree_borrows/fnentry_invalidation.stderr b/src/tools/miri/tests/fail/tree_borrows/fnentry_invalidation.stderr index dd5d27107fe8e..6b8e8fc1147d2 100644 --- a/src/tools/miri/tests/fail/tree_borrows/fnentry_invalidation.stderr +++ b/src/tools/miri/tests/fail/tree_borrows/fnentry_invalidation.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: write access through at ALLOC[0x0] is forbidden - --> $DIR/fnentry_invalidation.rs:LL:CC + --> tests/fail/tree_borrows/fnentry_invalidation.rs:LL:CC | LL | *z = 2; | ^^^^^^ write access through at ALLOC[0x0] is forbidden @@ -7,24 +7,24 @@ LL | *z = 2; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental = help: the accessed tag has state Frozen which forbids this child write access help: the accessed tag was created here, in the initial state Reserved - --> $DIR/fnentry_invalidation.rs:LL:CC + --> tests/fail/tree_borrows/fnentry_invalidation.rs:LL:CC | LL | let z = &mut x as *mut i32; | ^^^^^^ help: the accessed tag later transitioned to Active due to a child write access at offsets [0x0..0x4] - --> $DIR/fnentry_invalidation.rs:LL:CC + --> tests/fail/tree_borrows/fnentry_invalidation.rs:LL:CC | LL | *z = 1; | ^^^^^^ = help: this transition corresponds to the first write to a 2-phase borrowed mutable reference help: the accessed tag later transitioned to Frozen due to a reborrow (acting as a foreign read access) at offsets [0x0..0x4] - --> $DIR/fnentry_invalidation.rs:LL:CC + --> tests/fail/tree_borrows/fnentry_invalidation.rs:LL:CC | LL | x.do_bad(); | ^ = help: this transition corresponds to a loss of write permissions = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/fnentry_invalidation.rs:LL:CC + = note: inside `main` at tests/fail/tree_borrows/fnentry_invalidation.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/tree_borrows/outside-range.stderr b/src/tools/miri/tests/fail/tree_borrows/outside-range.stderr index 715228028bc4b..39fb956f7396b 100644 --- a/src/tools/miri/tests/fail/tree_borrows/outside-range.stderr +++ b/src/tools/miri/tests/fail/tree_borrows/outside-range.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: write access through at ALLOC[0x3] is forbidden - --> $DIR/outside-range.rs:LL:CC + --> tests/fail/tree_borrows/outside-range.rs:LL:CC | LL | *y.add(3) = 42; | ^^^^^^^^^^^^^^ write access through at ALLOC[0x3] is forbidden @@ -9,19 +9,19 @@ LL | *y.add(3) = 42; = help: this foreign write access would cause the protected tag (currently Reserved) to become Disabled = help: protected tags must never be Disabled help: the accessed tag was created here - --> $DIR/outside-range.rs:LL:CC + --> tests/fail/tree_borrows/outside-range.rs:LL:CC | LL | let raw = data.as_mut_ptr(); | ^^^^^^^^^^^^^^^^^ help: the protected tag was created here, in the initial state Reserved - --> $DIR/outside-range.rs:LL:CC + --> tests/fail/tree_borrows/outside-range.rs:LL:CC | LL | unsafe fn stuff(x: &mut u8, y: *mut u8) { | ^ = note: BACKTRACE (of the first span): - = note: inside `stuff` at $DIR/outside-range.rs:LL:CC + = note: inside `stuff` at tests/fail/tree_borrows/outside-range.rs:LL:CC note: inside `main` - --> $DIR/outside-range.rs:LL:CC + --> tests/fail/tree_borrows/outside-range.rs:LL:CC | LL | stuff(&mut *raw, raw); | ^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/tree_borrows/parent_read_freezes_raw_mut.stderr b/src/tools/miri/tests/fail/tree_borrows/parent_read_freezes_raw_mut.stderr index 87844ff401123..15f257c3d957b 100644 --- a/src/tools/miri/tests/fail/tree_borrows/parent_read_freezes_raw_mut.stderr +++ b/src/tools/miri/tests/fail/tree_borrows/parent_read_freezes_raw_mut.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: write access through at ALLOC[0x0] is forbidden - --> $DIR/parent_read_freezes_raw_mut.rs:LL:CC + --> tests/fail/tree_borrows/parent_read_freezes_raw_mut.rs:LL:CC | LL | *ptr = 0; | ^^^^^^^^ write access through at ALLOC[0x0] is forbidden @@ -7,24 +7,24 @@ LL | *ptr = 0; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental = help: the accessed tag has state Frozen which forbids this child write access help: the accessed tag was created here, in the initial state Reserved - --> $DIR/parent_read_freezes_raw_mut.rs:LL:CC + --> tests/fail/tree_borrows/parent_read_freezes_raw_mut.rs:LL:CC | LL | let mref = &mut root; | ^^^^^^^^^ help: the accessed tag later transitioned to Active due to a child write access at offsets [0x0..0x1] - --> $DIR/parent_read_freezes_raw_mut.rs:LL:CC + --> tests/fail/tree_borrows/parent_read_freezes_raw_mut.rs:LL:CC | LL | *ptr = 0; // Write | ^^^^^^^^ = help: this transition corresponds to the first write to a 2-phase borrowed mutable reference help: the accessed tag later transitioned to Frozen due to a reborrow (acting as a foreign read access) at offsets [0x0..0x1] - --> $DIR/parent_read_freezes_raw_mut.rs:LL:CC + --> tests/fail/tree_borrows/parent_read_freezes_raw_mut.rs:LL:CC | LL | assert_eq!(root, 0); // Parent Read | ^^^^^^^^^^^^^^^^^^^ = help: this transition corresponds to a loss of write permissions = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/parent_read_freezes_raw_mut.rs:LL:CC + = note: inside `main` at tests/fail/tree_borrows/parent_read_freezes_raw_mut.rs:LL:CC = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info) note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/tree_borrows/pass_invalid_mut.stderr b/src/tools/miri/tests/fail/tree_borrows/pass_invalid_mut.stderr index 84fbc91e686cf..f6da0b8ec5219 100644 --- a/src/tools/miri/tests/fail/tree_borrows/pass_invalid_mut.stderr +++ b/src/tools/miri/tests/fail/tree_borrows/pass_invalid_mut.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: write access through at ALLOC[0x0] is forbidden - --> $DIR/pass_invalid_mut.rs:LL:CC + --> tests/fail/tree_borrows/pass_invalid_mut.rs:LL:CC | LL | *nope = 31; | ^^^^^^^^^^ write access through at ALLOC[0x0] is forbidden @@ -8,31 +8,31 @@ LL | *nope = 31; = help: the accessed tag is a child of the conflicting tag = help: the conflicting tag has state Frozen which forbids this child write access help: the accessed tag was created here - --> $DIR/pass_invalid_mut.rs:LL:CC + --> tests/fail/tree_borrows/pass_invalid_mut.rs:LL:CC | LL | fn foo(nope: &mut i32) { | ^^^^ help: the conflicting tag was created here, in the initial state Reserved - --> $DIR/pass_invalid_mut.rs:LL:CC + --> tests/fail/tree_borrows/pass_invalid_mut.rs:LL:CC | LL | let xref = unsafe { &mut *xraw }; | ^^^^^^^^^^ help: the conflicting tag later transitioned to Active due to a child write access at offsets [0x0..0x4] - --> $DIR/pass_invalid_mut.rs:LL:CC + --> tests/fail/tree_borrows/pass_invalid_mut.rs:LL:CC | LL | *xref = 18; // activate xref | ^^^^^^^^^^ = help: this transition corresponds to the first write to a 2-phase borrowed mutable reference help: the conflicting tag later transitioned to Frozen due to a foreign read access at offsets [0x0..0x4] - --> $DIR/pass_invalid_mut.rs:LL:CC + --> tests/fail/tree_borrows/pass_invalid_mut.rs:LL:CC | LL | let _val = unsafe { *xraw }; // invalidate xref for writing | ^^^^^ = help: this transition corresponds to a loss of write permissions = note: BACKTRACE (of the first span): - = note: inside `foo` at $DIR/pass_invalid_mut.rs:LL:CC + = note: inside `foo` at tests/fail/tree_borrows/pass_invalid_mut.rs:LL:CC note: inside `main` - --> $DIR/pass_invalid_mut.rs:LL:CC + --> tests/fail/tree_borrows/pass_invalid_mut.rs:LL:CC | LL | foo(xref); | ^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/tree_borrows/protector-write-lazy.stderr b/src/tools/miri/tests/fail/tree_borrows/protector-write-lazy.stderr index 955abd144c7c3..bb07776da61e4 100644 --- a/src/tools/miri/tests/fail/tree_borrows/protector-write-lazy.stderr +++ b/src/tools/miri/tests/fail/tree_borrows/protector-write-lazy.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: reborrow through at ALLOC[0x0] is forbidden - --> $DIR/protector-write-lazy.rs:LL:CC + --> tests/fail/tree_borrows/protector-write-lazy.rs:LL:CC | LL | unsafe { println!("Value of funky: {}", *funky_ptr_lazy_on_fst_elem) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ reborrow through at ALLOC[0x0] is forbidden @@ -7,18 +7,18 @@ LL | unsafe { println!("Value of funky: {}", *funky_ptr_lazy_on_fst_elem) } = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental = help: the accessed tag has state Disabled which forbids this reborrow (acting as a child read access) help: the accessed tag was created here, in the initial state Reserved - --> $DIR/protector-write-lazy.rs:LL:CC + --> tests/fail/tree_borrows/protector-write-lazy.rs:LL:CC | LL | unsafe { (&mut *(ptr_to_vec.wrapping_add(1))) as *mut i32 }.wrapping_sub(1); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: the accessed tag later transitioned to Disabled due to a protector release (acting as a foreign write access) on every location previously accessed by this tag - --> $DIR/protector-write-lazy.rs:LL:CC + --> tests/fail/tree_borrows/protector-write-lazy.rs:LL:CC | LL | } | ^ = help: this transition corresponds to a loss of read and write permissions = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/protector-write-lazy.rs:LL:CC + = note: inside `main` at tests/fail/tree_borrows/protector-write-lazy.rs:LL:CC = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info) note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/tree_borrows/repeated_foreign_read_lazy_conflicted.stderr b/src/tools/miri/tests/fail/tree_borrows/repeated_foreign_read_lazy_conflicted.stderr index 963e8e5eca9f6..d81ecff6cccb8 100644 --- a/src/tools/miri/tests/fail/tree_borrows/repeated_foreign_read_lazy_conflicted.stderr +++ b/src/tools/miri/tests/fail/tree_borrows/repeated_foreign_read_lazy_conflicted.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: write access through at ALLOC[0x0] is forbidden - --> $DIR/repeated_foreign_read_lazy_conflicted.rs:LL:CC + --> tests/fail/tree_borrows/repeated_foreign_read_lazy_conflicted.rs:LL:CC | LL | *(x as *mut u8).byte_sub(1) = 42; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ write access through at ALLOC[0x0] is forbidden @@ -7,20 +7,20 @@ LL | *(x as *mut u8).byte_sub(1) = 42; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental = help: the accessed tag has state Reserved (conflicted) which forbids this child write access help: the accessed tag was created here, in the initial state Reserved - --> $DIR/repeated_foreign_read_lazy_conflicted.rs:LL:CC + --> tests/fail/tree_borrows/repeated_foreign_read_lazy_conflicted.rs:LL:CC | LL | unsafe fn access_after_sub_1(x: &mut u8, orig_ptr: *mut u8) { | ^ help: the accessed tag later transitioned to Reserved (conflicted) due to a foreign read access at offsets [0x0..0x1] - --> $DIR/repeated_foreign_read_lazy_conflicted.rs:LL:CC + --> tests/fail/tree_borrows/repeated_foreign_read_lazy_conflicted.rs:LL:CC | LL | do_something(*orig_ptr); | ^^^^^^^^^ = help: this transition corresponds to a temporary loss of write permissions until function exit = note: BACKTRACE (of the first span): - = note: inside `access_after_sub_1` at $DIR/repeated_foreign_read_lazy_conflicted.rs:LL:CC + = note: inside `access_after_sub_1` at tests/fail/tree_borrows/repeated_foreign_read_lazy_conflicted.rs:LL:CC note: inside `main` - --> $DIR/repeated_foreign_read_lazy_conflicted.rs:LL:CC + --> tests/fail/tree_borrows/repeated_foreign_read_lazy_conflicted.rs:LL:CC | LL | access_after_sub_1(&mut *(foo as *mut u8).byte_add(1), orig_ptr); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/tree_borrows/reserved/cell-protected-write.stderr b/src/tools/miri/tests/fail/tree_borrows/reserved/cell-protected-write.stderr index 133a50938f281..03f79fe0a5d74 100644 --- a/src/tools/miri/tests/fail/tree_borrows/reserved/cell-protected-write.stderr +++ b/src/tools/miri/tests/fail/tree_borrows/reserved/cell-protected-write.stderr @@ -9,7 +9,7 @@ Warning: this tree is indicative only. Some tags may have been hidden. | ReIM| └──── ────────────────────────────────────────────────── error: Undefined Behavior: write access through (y, callee:y, caller:y) at ALLOC[0x0] is forbidden - --> $DIR/cell-protected-write.rs:LL:CC + --> tests/fail/tree_borrows/reserved/cell-protected-write.rs:LL:CC | LL | *y = 1; | ^^^^^^ write access through (y, callee:y, caller:y) at ALLOC[0x0] is forbidden @@ -19,19 +19,19 @@ LL | *y = 1; = help: this foreign write access would cause the protected tag (callee:x) (currently Reserved) to become Disabled = help: protected tags must never be Disabled help: the accessed tag was created here - --> $DIR/cell-protected-write.rs:LL:CC + --> tests/fail/tree_borrows/reserved/cell-protected-write.rs:LL:CC | LL | let y = (&mut *n).get(); | ^^^^^^^^^ help: the protected tag was created here, in the initial state Reserved - --> $DIR/cell-protected-write.rs:LL:CC + --> tests/fail/tree_borrows/reserved/cell-protected-write.rs:LL:CC | LL | unsafe fn write_second(x: &mut UnsafeCell, y: *mut u8) { | ^ = note: BACKTRACE (of the first span): - = note: inside `main::write_second` at $DIR/cell-protected-write.rs:LL:CC + = note: inside `main::write_second` at tests/fail/tree_borrows/reserved/cell-protected-write.rs:LL:CC note: inside `main` - --> $DIR/cell-protected-write.rs:LL:CC + --> tests/fail/tree_borrows/reserved/cell-protected-write.rs:LL:CC | LL | write_second(x, y); | ^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/tree_borrows/reserved/int-protected-write.stderr b/src/tools/miri/tests/fail/tree_borrows/reserved/int-protected-write.stderr index a4dc123979edf..a9683c9e6147f 100644 --- a/src/tools/miri/tests/fail/tree_borrows/reserved/int-protected-write.stderr +++ b/src/tools/miri/tests/fail/tree_borrows/reserved/int-protected-write.stderr @@ -9,7 +9,7 @@ Warning: this tree is indicative only. Some tags may have been hidden. | Res | └──── ────────────────────────────────────────────────── error: Undefined Behavior: write access through (y, callee:y, caller:y) at ALLOC[0x0] is forbidden - --> $DIR/int-protected-write.rs:LL:CC + --> tests/fail/tree_borrows/reserved/int-protected-write.rs:LL:CC | LL | *y = 0; | ^^^^^^ write access through (y, callee:y, caller:y) at ALLOC[0x0] is forbidden @@ -19,19 +19,19 @@ LL | *y = 0; = help: this foreign write access would cause the protected tag (callee:x) (currently Reserved) to become Disabled = help: protected tags must never be Disabled help: the accessed tag was created here - --> $DIR/int-protected-write.rs:LL:CC + --> tests/fail/tree_borrows/reserved/int-protected-write.rs:LL:CC | LL | let y = (&mut *n) as *mut _; | ^^^^^^^^^ help: the protected tag was created here, in the initial state Reserved - --> $DIR/int-protected-write.rs:LL:CC + --> tests/fail/tree_borrows/reserved/int-protected-write.rs:LL:CC | LL | unsafe fn write_second(x: &mut u8, y: *mut u8) { | ^ = note: BACKTRACE (of the first span): - = note: inside `main::write_second` at $DIR/int-protected-write.rs:LL:CC + = note: inside `main::write_second` at tests/fail/tree_borrows/reserved/int-protected-write.rs:LL:CC note: inside `main` - --> $DIR/int-protected-write.rs:LL:CC + --> tests/fail/tree_borrows/reserved/int-protected-write.rs:LL:CC | LL | write_second(x, y); | ^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/tree_borrows/reservedim_spurious_write.with.stderr b/src/tools/miri/tests/fail/tree_borrows/reservedim_spurious_write.with.stderr index 0e4517e90105c..47341e027d7a1 100644 --- a/src/tools/miri/tests/fail/tree_borrows/reservedim_spurious_write.with.stderr +++ b/src/tools/miri/tests/fail/tree_borrows/reservedim_spurious_write.with.stderr @@ -13,7 +13,7 @@ Thread 1 executing: ret x Thread 1 executing: write y Thread 2 executing: write y error: Undefined Behavior: write access through at ALLOC[0x0] is forbidden - --> $DIR/reservedim_spurious_write.rs:LL:CC + --> tests/fail/tree_borrows/reservedim_spurious_write.rs:LL:CC | LL | unsafe { *y = 13 } | ^^^^^^^ write access through at ALLOC[0x0] is forbidden @@ -21,18 +21,18 @@ LL | unsafe { *y = 13 } = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental = help: the accessed tag has state Disabled which forbids this child write access help: the accessed tag was created here, in the initial state Reserved - --> $DIR/reservedim_spurious_write.rs:LL:CC + --> tests/fail/tree_borrows/reservedim_spurious_write.rs:LL:CC | LL | fn inner(y: &mut Cell<()>, b: IdxBarrier) -> *mut u8 { | ^ help: the accessed tag later transitioned to Disabled due to a foreign write access at offsets [0x0..0x1] - --> $DIR/reservedim_spurious_write.rs:LL:CC + --> tests/fail/tree_borrows/reservedim_spurious_write.rs:LL:CC | LL | *x = 64; | ^^^^^^^ = help: this transition corresponds to a loss of read and write permissions = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at $DIR/reservedim_spurious_write.rs:LL:CC + = note: inside closure at tests/fail/tree_borrows/reservedim_spurious_write.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/tree_borrows/reservedim_spurious_write.without.stderr b/src/tools/miri/tests/fail/tree_borrows/reservedim_spurious_write.without.stderr index cbeef90243bfb..504b8cc0ac769 100644 --- a/src/tools/miri/tests/fail/tree_borrows/reservedim_spurious_write.without.stderr +++ b/src/tools/miri/tests/fail/tree_borrows/reservedim_spurious_write.without.stderr @@ -13,7 +13,7 @@ Thread 1 executing: ret x Thread 1 executing: write y Thread 2 executing: write y error: Undefined Behavior: write access through at ALLOC[0x0] is forbidden - --> $DIR/reservedim_spurious_write.rs:LL:CC + --> tests/fail/tree_borrows/reservedim_spurious_write.rs:LL:CC | LL | unsafe { *y = 13 } | ^^^^^^^ write access through at ALLOC[0x0] is forbidden @@ -21,18 +21,18 @@ LL | unsafe { *y = 13 } = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental = help: the accessed tag has state Disabled which forbids this child write access help: the accessed tag was created here, in the initial state Reserved - --> $DIR/reservedim_spurious_write.rs:LL:CC + --> tests/fail/tree_borrows/reservedim_spurious_write.rs:LL:CC | LL | fn inner(y: &mut Cell<()>, b: IdxBarrier) -> *mut u8 { | ^ help: the accessed tag later transitioned to Disabled due to a protector release (acting as a foreign write access) on every location previously accessed by this tag - --> $DIR/reservedim_spurious_write.rs:LL:CC + --> tests/fail/tree_borrows/reservedim_spurious_write.rs:LL:CC | LL | } | ^ = help: this transition corresponds to a loss of read and write permissions = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at $DIR/reservedim_spurious_write.rs:LL:CC + = note: inside closure at tests/fail/tree_borrows/reservedim_spurious_write.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/tree_borrows/return_invalid_mut.stderr b/src/tools/miri/tests/fail/tree_borrows/return_invalid_mut.stderr index ca8c45d36f9db..81fa3262877d7 100644 --- a/src/tools/miri/tests/fail/tree_borrows/return_invalid_mut.stderr +++ b/src/tools/miri/tests/fail/tree_borrows/return_invalid_mut.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: write access through at ALLOC[0x4] is forbidden - --> $DIR/return_invalid_mut.rs:LL:CC + --> tests/fail/tree_borrows/return_invalid_mut.rs:LL:CC | LL | *ret = 3; | ^^^^^^^^ write access through at ALLOC[0x4] is forbidden @@ -8,29 +8,29 @@ LL | *ret = 3; = help: the accessed tag is a child of the conflicting tag = help: the conflicting tag has state Frozen which forbids this child write access help: the accessed tag was created here - --> $DIR/return_invalid_mut.rs:LL:CC + --> tests/fail/tree_borrows/return_invalid_mut.rs:LL:CC | LL | let ret = foo(arg); | ^^^^^^^^ help: the conflicting tag was created here, in the initial state Reserved - --> $DIR/return_invalid_mut.rs:LL:CC + --> tests/fail/tree_borrows/return_invalid_mut.rs:LL:CC | LL | let ret = unsafe { &mut (*xraw).1 }; | ^^^^^^^^^^^^^^ help: the conflicting tag later transitioned to Active due to a child write access at offsets [0x4..0x8] - --> $DIR/return_invalid_mut.rs:LL:CC + --> tests/fail/tree_borrows/return_invalid_mut.rs:LL:CC | LL | *ret = *ret; // activate | ^^^^^^^^^^^ = help: this transition corresponds to the first write to a 2-phase borrowed mutable reference help: the conflicting tag later transitioned to Frozen due to a foreign read access at offsets [0x0..0x8] - --> $DIR/return_invalid_mut.rs:LL:CC + --> tests/fail/tree_borrows/return_invalid_mut.rs:LL:CC | LL | let _val = unsafe { *xraw }; // invalidate xref for writing | ^^^^^ = help: this transition corresponds to a loss of write permissions = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/return_invalid_mut.rs:LL:CC + = note: inside `main` at tests/fail/tree_borrows/return_invalid_mut.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/tree_borrows/spurious_read.stderr b/src/tools/miri/tests/fail/tree_borrows/spurious_read.stderr index f3934d4cbe579..bd26b4e36df01 100644 --- a/src/tools/miri/tests/fail/tree_borrows/spurious_read.stderr +++ b/src/tools/miri/tests/fail/tree_borrows/spurious_read.stderr @@ -12,7 +12,7 @@ Thread 2 executing: write y Thread 1 executing: write y Thread 1 executing: ret y error: Undefined Behavior: write access through at ALLOC[0x0] is forbidden - --> $DIR/spurious_read.rs:LL:CC + --> tests/fail/tree_borrows/spurious_read.rs:LL:CC | LL | *y = 2; | ^^^^^^ write access through at ALLOC[0x0] is forbidden @@ -20,20 +20,20 @@ LL | *y = 2; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental = help: the accessed tag has state Reserved (conflicted) which forbids this child write access help: the accessed tag was created here, in the initial state Reserved - --> $DIR/spurious_read.rs:LL:CC + --> tests/fail/tree_borrows/spurious_read.rs:LL:CC | LL | fn as_mut(y: &mut u8, b: (usize, Arc)) -> *mut u8 { | ^ help: the accessed tag later transitioned to Reserved (conflicted) due to a protector release (acting as a foreign read access) on every location previously accessed by this tag - --> $DIR/spurious_read.rs:LL:CC + --> tests/fail/tree_borrows/spurious_read.rs:LL:CC | LL | } | ^ = help: this transition corresponds to a temporary loss of write permissions until function exit = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside `retagx_retagy_retx_writey_rety::{closure#1}::as_mut` at $DIR/spurious_read.rs:LL:CC + = note: inside `retagx_retagy_retx_writey_rety::{closure#1}::as_mut` at tests/fail/tree_borrows/spurious_read.rs:LL:CC note: inside closure - --> $DIR/spurious_read.rs:LL:CC + --> tests/fail/tree_borrows/spurious_read.rs:LL:CC | LL | let _y = as_mut(unsafe { &mut *ptr.0 }, b.clone()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/tree_borrows/strongly-protected.stderr b/src/tools/miri/tests/fail/tree_borrows/strongly-protected.stderr index 2a7f69ff202fe..f6197a2acb391 100644 --- a/src/tools/miri/tests/fail/tree_borrows/strongly-protected.stderr +++ b/src/tools/miri/tests/fail/tree_borrows/strongly-protected.stderr @@ -8,12 +8,12 @@ LL | self.1.deallocate(From::from(ptr.cast()), layout); = help: the allocation of the accessed tag also contains the strongly protected tag = help: the strongly protected tag disallows deallocations help: the accessed tag was created here - --> $DIR/strongly-protected.rs:LL:CC + --> tests/fail/tree_borrows/strongly-protected.rs:LL:CC | LL | drop(unsafe { Box::from_raw(raw) }); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: the strongly protected tag was created here, in the initial state Reserved - --> $DIR/strongly-protected.rs:LL:CC + --> tests/fail/tree_borrows/strongly-protected.rs:LL:CC | LL | fn inner(x: &mut i32, f: fn(*mut i32)) { | ^ @@ -22,18 +22,18 @@ LL | fn inner(x: &mut i32, f: fn(*mut i32)) { = note: inside `std::ptr::drop_in_place::> - shim(Some(std::boxed::Box))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC = note: inside `std::mem::drop::>` at RUSTLIB/core/src/mem/mod.rs:LL:CC note: inside closure - --> $DIR/strongly-protected.rs:LL:CC + --> tests/fail/tree_borrows/strongly-protected.rs:LL:CC | LL | drop(unsafe { Box::from_raw(raw) }); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: inside `<{closure@$DIR/strongly-protected.rs:LL:CC} as std::ops::FnOnce<(*mut i32,)>>::call_once - shim` at RUSTLIB/core/src/ops/function.rs:LL:CC + = note: inside `<{closure@tests/fail/tree_borrows/strongly-protected.rs:LL:CC} as std::ops::FnOnce<(*mut i32,)>>::call_once - shim` at RUSTLIB/core/src/ops/function.rs:LL:CC note: inside `inner` - --> $DIR/strongly-protected.rs:LL:CC + --> tests/fail/tree_borrows/strongly-protected.rs:LL:CC | LL | f(x) | ^^^^ note: inside `main` - --> $DIR/strongly-protected.rs:LL:CC + --> tests/fail/tree_borrows/strongly-protected.rs:LL:CC | LL | / inner(Box::leak(Box::new(0)), |raw| { LL | | drop(unsafe { Box::from_raw(raw) }); diff --git a/src/tools/miri/tests/fail/tree_borrows/unique.default.stderr b/src/tools/miri/tests/fail/tree_borrows/unique.default.stderr index bce8cb011f64b..c7d72f70f40cf 100644 --- a/src/tools/miri/tests/fail/tree_borrows/unique.default.stderr +++ b/src/tools/miri/tests/fail/tree_borrows/unique.default.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: write access through at ALLOC[0x0] is forbidden - --> $DIR/unique.rs:LL:CC + --> tests/fail/tree_borrows/unique.rs:LL:CC | LL | *uniq.as_ptr() = 3; | ^^^^^^^^^^^^^^^^^^ write access through at ALLOC[0x0] is forbidden @@ -7,24 +7,24 @@ LL | *uniq.as_ptr() = 3; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental = help: the accessed tag has state Frozen which forbids this child write access help: the accessed tag was created here, in the initial state Reserved - --> $DIR/unique.rs:LL:CC + --> tests/fail/tree_borrows/unique.rs:LL:CC | LL | let refmut = &mut data; | ^^^^^^^^^ help: the accessed tag later transitioned to Active due to a child write access at offsets [0x0..0x1] - --> $DIR/unique.rs:LL:CC + --> tests/fail/tree_borrows/unique.rs:LL:CC | LL | *uniq.as_ptr() = 1; // activation | ^^^^^^^^^^^^^^^^^^ = help: this transition corresponds to the first write to a 2-phase borrowed mutable reference help: the accessed tag later transitioned to Frozen due to a foreign read access at offsets [0x0..0x1] - --> $DIR/unique.rs:LL:CC + --> tests/fail/tree_borrows/unique.rs:LL:CC | LL | let _definitely_parent = data; // definitely Frozen by now | ^^^^ = help: this transition corresponds to a loss of write permissions = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/unique.rs:LL:CC + = note: inside `main` at tests/fail/tree_borrows/unique.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/tree_borrows/unique.uniq.stderr b/src/tools/miri/tests/fail/tree_borrows/unique.uniq.stderr index 7323cd1c5ad82..4ecff3ea0e1f1 100644 --- a/src/tools/miri/tests/fail/tree_borrows/unique.uniq.stderr +++ b/src/tools/miri/tests/fail/tree_borrows/unique.uniq.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: write access through at ALLOC[0x0] is forbidden - --> $DIR/unique.rs:LL:CC + --> tests/fail/tree_borrows/unique.rs:LL:CC | LL | *uniq.as_ptr() = 2; | ^^^^^^^^^^^^^^^^^^ write access through at ALLOC[0x0] is forbidden @@ -8,29 +8,29 @@ LL | *uniq.as_ptr() = 2; = help: the accessed tag is a child of the conflicting tag = help: the conflicting tag has state Frozen which forbids this child write access help: the accessed tag was created here - --> $DIR/unique.rs:LL:CC + --> tests/fail/tree_borrows/unique.rs:LL:CC | LL | *uniq.as_ptr() = 2; | ^^^^^^^^^^^^^ help: the conflicting tag was created here, in the initial state Reserved - --> $DIR/unique.rs:LL:CC + --> tests/fail/tree_borrows/unique.rs:LL:CC | LL | let uniq = Unique::new_unchecked(rawptr); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: the conflicting tag later transitioned to Active due to a child write access at offsets [0x0..0x1] - --> $DIR/unique.rs:LL:CC + --> tests/fail/tree_borrows/unique.rs:LL:CC | LL | *uniq.as_ptr() = 1; // activation | ^^^^^^^^^^^^^^^^^^ = help: this transition corresponds to the first write to a 2-phase borrowed mutable reference help: the conflicting tag later transitioned to Frozen due to a foreign read access at offsets [0x0..0x1] - --> $DIR/unique.rs:LL:CC + --> tests/fail/tree_borrows/unique.rs:LL:CC | LL | let _maybe_parent = *rawptr; // maybe becomes Frozen | ^^^^^^^ = help: this transition corresponds to a loss of write permissions = note: BACKTRACE (of the first span): - = note: inside `main` at $DIR/unique.rs:LL:CC + = note: inside `main` at tests/fail/tree_borrows/unique.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/tree_borrows/write-during-2phase.stderr b/src/tools/miri/tests/fail/tree_borrows/write-during-2phase.stderr index 87589299cb168..b85aac7db76ba 100644 --- a/src/tools/miri/tests/fail/tree_borrows/write-during-2phase.stderr +++ b/src/tools/miri/tests/fail/tree_borrows/write-during-2phase.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: reborrow through at ALLOC[0x0] is forbidden - --> $DIR/write-during-2phase.rs:LL:CC + --> tests/fail/tree_borrows/write-during-2phase.rs:LL:CC | LL | fn add(&mut self, n: u64) -> u64 { | ^^^^^^^^^ reborrow through at ALLOC[0x0] is forbidden @@ -7,20 +7,20 @@ LL | fn add(&mut self, n: u64) -> u64 { = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental = help: the accessed tag has state Disabled which forbids this reborrow (acting as a child read access) help: the accessed tag was created here, in the initial state Reserved - --> $DIR/write-during-2phase.rs:LL:CC + --> tests/fail/tree_borrows/write-during-2phase.rs:LL:CC | LL | let _res = f.add(unsafe { | ^ help: the accessed tag later transitioned to Disabled due to a foreign write access at offsets [0x0..0x8] - --> $DIR/write-during-2phase.rs:LL:CC + --> tests/fail/tree_borrows/write-during-2phase.rs:LL:CC | LL | *inner = 42; | ^^^^^^^^^^^ = help: this transition corresponds to a loss of read and write permissions = note: BACKTRACE (of the first span): - = note: inside `Foo::add` at $DIR/write-during-2phase.rs:LL:CC + = note: inside `Foo::add` at tests/fail/tree_borrows/write-during-2phase.rs:LL:CC note: inside `main` - --> $DIR/write-during-2phase.rs:LL:CC + --> tests/fail/tree_borrows/write-during-2phase.rs:LL:CC | LL | let _res = f.add(unsafe { | ________________^ diff --git a/src/tools/miri/tests/fail/type-too-large.rs b/src/tools/miri/tests/fail/type-too-large.rs index 81ecc6145d709..46e3ac2d6ca98 100644 --- a/src/tools/miri/tests/fail/type-too-large.rs +++ b/src/tools/miri/tests/fail/type-too-large.rs @@ -1,4 +1,4 @@ -//@ignore-32bit +//@ignore-bitwidth: 32 fn main() { let _fat: [u8; (1 << 61) + (1 << 31)]; // ideally we'd error here, but we avoid computing the layout until absolutely necessary diff --git a/src/tools/miri/tests/fail/type-too-large.stderr b/src/tools/miri/tests/fail/type-too-large.stderr index b07bb84e348f3..15ad8f1764d0e 100644 --- a/src/tools/miri/tests/fail/type-too-large.stderr +++ b/src/tools/miri/tests/fail/type-too-large.stderr @@ -1,11 +1,11 @@ error: post-monomorphization error: values of the type `[u8; 2305843011361177600]` are too big for the current architecture - --> $DIR/type-too-large.rs:LL:CC + --> tests/fail/type-too-large.rs:LL:CC | LL | _fat = [0; (1u64 << 61) as usize + (1u64 << 31) as usize]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ values of the type `[u8; 2305843011361177600]` are too big for the current architecture | = note: BACKTRACE: - = note: inside `main` at $DIR/type-too-large.rs:LL:CC + = note: inside `main` at tests/fail/type-too-large.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/unaligned_pointers/alignment.stderr b/src/tools/miri/tests/fail/unaligned_pointers/alignment.stderr index ca3d34661d38d..8bbb4dfdb603b 100644 --- a/src/tools/miri/tests/fail/unaligned_pointers/alignment.stderr +++ b/src/tools/miri/tests/fail/unaligned_pointers/alignment.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required - --> $DIR/alignment.rs:LL:CC + --> tests/fail/unaligned_pointers/alignment.rs:LL:CC | LL | *(x_ptr as *mut u32) = 42; *(x_ptr.add(1) as *mut u32) = 42; | ^ accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required @@ -7,7 +7,7 @@ LL | *(x_ptr as *mut u32) = 42; *(x_ptr.add(1) as *mut u32) = 42; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/alignment.rs:LL:CC + = note: inside `main` at tests/fail/unaligned_pointers/alignment.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/unaligned_pointers/atomic_unaligned.stderr b/src/tools/miri/tests/fail/unaligned_pointers/atomic_unaligned.stderr index 161e8977bf4ab..a9da740be1db9 100644 --- a/src/tools/miri/tests/fail/unaligned_pointers/atomic_unaligned.stderr +++ b/src/tools/miri/tests/fail/unaligned_pointers/atomic_unaligned.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: accessing memory with alignment ALIGN, but alignment ALIGN is required - --> $DIR/atomic_unaligned.rs:LL:CC + --> tests/fail/unaligned_pointers/atomic_unaligned.rs:LL:CC | LL | ::std::intrinsics::atomic_load_seqcst(zptr); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ accessing memory with alignment ALIGN, but alignment ALIGN is required @@ -7,7 +7,7 @@ LL | ::std::intrinsics::atomic_load_seqcst(zptr); = help: this usually indicates that your program performed an invalid operation and caused Undefined Behavior = help: but due to `-Zmiri-symbolic-alignment-check`, alignment errors can also be false positives = note: BACKTRACE: - = note: inside `main` at $DIR/atomic_unaligned.rs:LL:CC + = note: inside `main` at tests/fail/unaligned_pointers/atomic_unaligned.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/unaligned_pointers/drop_in_place.stderr b/src/tools/miri/tests/fail/unaligned_pointers/drop_in_place.stderr index 600028337fa6d..75efa5ff806ce 100644 --- a/src/tools/miri/tests/fail/unaligned_pointers/drop_in_place.stderr +++ b/src/tools/miri/tests/fail/unaligned_pointers/drop_in_place.stderr @@ -9,7 +9,7 @@ LL | pub unsafe fn drop_in_place(to_drop: *mut T) { = note: BACKTRACE: = note: inside `std::ptr::drop_in_place:: - shim(Some(PartialDrop))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC note: inside `main` - --> $DIR/drop_in_place.rs:LL:CC + --> tests/fail/unaligned_pointers/drop_in_place.rs:LL:CC | LL | core::ptr::drop_in_place(p); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/unaligned_pointers/dyn_alignment.stderr b/src/tools/miri/tests/fail/unaligned_pointers/dyn_alignment.stderr index 05e30f833bb2d..72cded1c0798d 100644 --- a/src/tools/miri/tests/fail/unaligned_pointers/dyn_alignment.stderr +++ b/src/tools/miri/tests/fail/unaligned_pointers/dyn_alignment.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value: encountered an unaligned reference (required ALIGN byte alignment but found ALIGN) - --> $DIR/dyn_alignment.rs:LL:CC + --> tests/fail/unaligned_pointers/dyn_alignment.rs:LL:CC | LL | let _ptr = &*ptr; | ^^^^^ constructing invalid value: encountered an unaligned reference (required ALIGN byte alignment but found ALIGN) @@ -7,7 +7,7 @@ LL | let _ptr = &*ptr; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/dyn_alignment.rs:LL:CC + = note: inside `main` at tests/fail/unaligned_pointers/dyn_alignment.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/unaligned_pointers/field_requires_parent_struct_alignment.stderr b/src/tools/miri/tests/fail/unaligned_pointers/field_requires_parent_struct_alignment.stderr index 9046502975d47..04ecf618fc0dd 100644 --- a/src/tools/miri/tests/fail/unaligned_pointers/field_requires_parent_struct_alignment.stderr +++ b/src/tools/miri/tests/fail/unaligned_pointers/field_requires_parent_struct_alignment.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required - --> $DIR/field_requires_parent_struct_alignment.rs:LL:CC + --> tests/fail/unaligned_pointers/field_requires_parent_struct_alignment.rs:LL:CC | LL | unsafe { (*x).x } | ^^^^^^ accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required @@ -7,9 +7,9 @@ LL | unsafe { (*x).x } = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `foo` at $DIR/field_requires_parent_struct_alignment.rs:LL:CC + = note: inside `foo` at tests/fail/unaligned_pointers/field_requires_parent_struct_alignment.rs:LL:CC note: inside `main` - --> $DIR/field_requires_parent_struct_alignment.rs:LL:CC + --> tests/fail/unaligned_pointers/field_requires_parent_struct_alignment.rs:LL:CC | LL | foo(odd_ptr.cast()); | ^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/unaligned_pointers/field_requires_parent_struct_alignment2.stderr b/src/tools/miri/tests/fail/unaligned_pointers/field_requires_parent_struct_alignment2.stderr index 0d0057a79abc3..da5a34a8dc675 100644 --- a/src/tools/miri/tests/fail/unaligned_pointers/field_requires_parent_struct_alignment2.stderr +++ b/src/tools/miri/tests/fail/unaligned_pointers/field_requires_parent_struct_alignment2.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required - --> $DIR/field_requires_parent_struct_alignment2.rs:LL:CC + --> tests/fail/unaligned_pointers/field_requires_parent_struct_alignment2.rs:LL:CC | LL | unsafe { (*x).packed.x } | ^^^^^^^^^^^^^ accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required @@ -7,9 +7,9 @@ LL | unsafe { (*x).packed.x } = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `foo` at $DIR/field_requires_parent_struct_alignment2.rs:LL:CC + = note: inside `foo` at tests/fail/unaligned_pointers/field_requires_parent_struct_alignment2.rs:LL:CC note: inside `main` - --> $DIR/field_requires_parent_struct_alignment2.rs:LL:CC + --> tests/fail/unaligned_pointers/field_requires_parent_struct_alignment2.rs:LL:CC | LL | foo(odd_ptr.cast()); | ^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/unaligned_pointers/intptrcast_alignment_check.stderr b/src/tools/miri/tests/fail/unaligned_pointers/intptrcast_alignment_check.stderr index 318004da6013a..e0e866b25c8c0 100644 --- a/src/tools/miri/tests/fail/unaligned_pointers/intptrcast_alignment_check.stderr +++ b/src/tools/miri/tests/fail/unaligned_pointers/intptrcast_alignment_check.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required - --> $DIR/intptrcast_alignment_check.rs:LL:CC + --> tests/fail/unaligned_pointers/intptrcast_alignment_check.rs:LL:CC | LL | unsafe { *u16_ptr = 2 }; | ^^^^^^^^^^^^ accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required @@ -7,7 +7,7 @@ LL | unsafe { *u16_ptr = 2 }; = help: this usually indicates that your program performed an invalid operation and caused Undefined Behavior = help: but due to `-Zmiri-symbolic-alignment-check`, alignment errors can also be false positives = note: BACKTRACE: - = note: inside `main` at $DIR/intptrcast_alignment_check.rs:LL:CC + = note: inside `main` at tests/fail/unaligned_pointers/intptrcast_alignment_check.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/unaligned_pointers/promise_alignment.call_unaligned_ptr.stderr b/src/tools/miri/tests/fail/unaligned_pointers/promise_alignment.call_unaligned_ptr.stderr index 6d62db4d3d556..91df7cf47a74d 100644 --- a/src/tools/miri/tests/fail/unaligned_pointers/promise_alignment.call_unaligned_ptr.stderr +++ b/src/tools/miri/tests/fail/unaligned_pointers/promise_alignment.call_unaligned_ptr.stderr @@ -1,12 +1,12 @@ error: unsupported operation: `miri_promise_symbolic_alignment`: pointer is not actually aligned - --> $DIR/promise_alignment.rs:LL:CC + --> tests/fail/unaligned_pointers/promise_alignment.rs:LL:CC | LL | unsafe { utils::miri_promise_symbolic_alignment(align8.add(1).cast(), 8) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `miri_promise_symbolic_alignment`: pointer is not actually aligned | = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support = note: BACKTRACE: - = note: inside `main` at $DIR/promise_alignment.rs:LL:CC + = note: inside `main` at tests/fail/unaligned_pointers/promise_alignment.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/unaligned_pointers/promise_alignment.read_unaligned_ptr.stderr b/src/tools/miri/tests/fail/unaligned_pointers/promise_alignment.read_unaligned_ptr.stderr index 0842ccd6d5bb6..1e984aa3efd21 100644 --- a/src/tools/miri/tests/fail/unaligned_pointers/promise_alignment.read_unaligned_ptr.stderr +++ b/src/tools/miri/tests/fail/unaligned_pointers/promise_alignment.read_unaligned_ptr.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required - --> $DIR/promise_alignment.rs:LL:CC + --> tests/fail/unaligned_pointers/promise_alignment.rs:LL:CC | LL | let _val = unsafe { align8.cast::().read() }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required @@ -7,7 +7,7 @@ LL | let _val = unsafe { align8.cast::().read() }; = help: this usually indicates that your program performed an invalid operation and caused Undefined Behavior = help: but due to `-Zmiri-symbolic-alignment-check`, alignment errors can also be false positives = note: BACKTRACE: - = note: inside `main` at $DIR/promise_alignment.rs:LL:CC + = note: inside `main` at tests/fail/unaligned_pointers/promise_alignment.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/unaligned_pointers/promise_alignment_zero.stderr b/src/tools/miri/tests/fail/unaligned_pointers/promise_alignment_zero.stderr index 3f7ced0b407df..c687d9986137d 100644 --- a/src/tools/miri/tests/fail/unaligned_pointers/promise_alignment_zero.stderr +++ b/src/tools/miri/tests/fail/unaligned_pointers/promise_alignment_zero.stderr @@ -1,12 +1,12 @@ error: unsupported operation: `miri_promise_symbolic_alignment`: alignment must be a power of 2, got 0 - --> $DIR/promise_alignment_zero.rs:LL:CC + --> tests/fail/unaligned_pointers/promise_alignment_zero.rs:LL:CC | LL | unsafe { utils::miri_promise_symbolic_alignment(buffer.as_ptr().cast(), 0) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `miri_promise_symbolic_alignment`: alignment must be a power of 2, got 0 | = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support = note: BACKTRACE: - = note: inside `main` at $DIR/promise_alignment_zero.rs:LL:CC + = note: inside `main` at tests/fail/unaligned_pointers/promise_alignment_zero.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/unaligned_pointers/reference_to_packed.stderr b/src/tools/miri/tests/fail/unaligned_pointers/reference_to_packed.stderr index 938a037572995..9adbd7f81539d 100644 --- a/src/tools/miri/tests/fail/unaligned_pointers/reference_to_packed.stderr +++ b/src/tools/miri/tests/fail/unaligned_pointers/reference_to_packed.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value: encountered an unaligned reference (required ALIGN byte alignment but found ALIGN) - --> $DIR/reference_to_packed.rs:LL:CC + --> tests/fail/unaligned_pointers/reference_to_packed.rs:LL:CC | LL | mem::transmute(x) | ^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required ALIGN byte alignment but found ALIGN) @@ -7,9 +7,9 @@ LL | mem::transmute(x) = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `raw_to_ref::<'_, i32>` at $DIR/reference_to_packed.rs:LL:CC + = note: inside `raw_to_ref::<'_, i32>` at tests/fail/unaligned_pointers/reference_to_packed.rs:LL:CC note: inside `main` - --> $DIR/reference_to_packed.rs:LL:CC + --> tests/fail/unaligned_pointers/reference_to_packed.rs:LL:CC | LL | let p: &i32 = unsafe { raw_to_ref(ptr::addr_of!(foo.x)) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr1.stderr b/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr1.stderr index ae3be1ed3afb0..90cfb4245c886 100644 --- a/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr1.stderr +++ b/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr1.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required - --> $DIR/unaligned_ptr1.rs:LL:CC + --> tests/fail/unaligned_pointers/unaligned_ptr1.rs:LL:CC | LL | let _x = unsafe { *x }; | ^^ accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required @@ -7,7 +7,7 @@ LL | let _x = unsafe { *x }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/unaligned_ptr1.rs:LL:CC + = note: inside `main` at tests/fail/unaligned_pointers/unaligned_ptr1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr2.stderr b/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr2.stderr index 2b92602749820..57ac8553930ca 100644 --- a/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr2.stderr +++ b/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr2.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required - --> $DIR/unaligned_ptr2.rs:LL:CC + --> tests/fail/unaligned_pointers/unaligned_ptr2.rs:LL:CC | LL | let _x = unsafe { *x }; | ^^ accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required @@ -7,7 +7,7 @@ LL | let _x = unsafe { *x }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/unaligned_ptr2.rs:LL:CC + = note: inside `main` at tests/fail/unaligned_pointers/unaligned_ptr2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr3.stderr b/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr3.stderr index 5ac4e23bf015e..d8ab546af6ac2 100644 --- a/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr3.stderr +++ b/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr3.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required - --> $DIR/unaligned_ptr3.rs:LL:CC + --> tests/fail/unaligned_pointers/unaligned_ptr3.rs:LL:CC | LL | let _x = unsafe { *x }; | ^^ accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required @@ -7,7 +7,7 @@ LL | let _x = unsafe { *x }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/unaligned_ptr3.rs:LL:CC + = note: inside `main` at tests/fail/unaligned_pointers/unaligned_ptr3.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr4.stderr b/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr4.stderr index 4de90118b4b88..5fe342c9b3163 100644 --- a/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr4.stderr +++ b/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr4.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required - --> $DIR/unaligned_ptr4.rs:LL:CC + --> tests/fail/unaligned_pointers/unaligned_ptr4.rs:LL:CC | LL | let _val = unsafe { *ptr }; | ^^^^ accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required @@ -7,7 +7,7 @@ LL | let _val = unsafe { *ptr }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/unaligned_ptr4.rs:LL:CC + = note: inside `main` at tests/fail/unaligned_pointers/unaligned_ptr4.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr_zst.stderr b/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr_zst.stderr index 72db125074b59..1ae8d9548821e 100644 --- a/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr_zst.stderr +++ b/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr_zst.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required - --> $DIR/unaligned_ptr_zst.rs:LL:CC + --> tests/fail/unaligned_pointers/unaligned_ptr_zst.rs:LL:CC | LL | let _x = unsafe { *x }; | ^^ accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required @@ -7,7 +7,7 @@ LL | let _x = unsafe { *x }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/unaligned_ptr_zst.rs:LL:CC + = note: inside `main` at tests/fail/unaligned_pointers/unaligned_ptr_zst.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ref_addr_of.stderr b/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ref_addr_of.stderr index 448023a2a3d8f..d7561c57a8c5a 100644 --- a/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ref_addr_of.stderr +++ b/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ref_addr_of.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value: encountered an unaligned reference (required ALIGN byte alignment but found ALIGN) - --> $DIR/unaligned_ref_addr_of.rs:LL:CC + --> tests/fail/unaligned_pointers/unaligned_ref_addr_of.rs:LL:CC | LL | let _x = unsafe { &*x }; | ^^^ constructing invalid value: encountered an unaligned reference (required ALIGN byte alignment but found ALIGN) @@ -7,7 +7,7 @@ LL | let _x = unsafe { &*x }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/unaligned_ref_addr_of.rs:LL:CC + = note: inside `main` at tests/fail/unaligned_pointers/unaligned_ref_addr_of.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/uninit/padding-enum.rs b/src/tools/miri/tests/fail/uninit/padding-enum.rs index 3852ac5c477d5..a9628799b7d30 100644 --- a/src/tools/miri/tests/fail/uninit/padding-enum.rs +++ b/src/tools/miri/tests/fail/uninit/padding-enum.rs @@ -7,17 +7,20 @@ enum E { Some(&'static (), &'static (), usize), } -fn main() { unsafe { - let mut p: mem::MaybeUninit = mem::MaybeUninit::zeroed(); - // The copy when `E` is returned from `transmute` should destroy padding - // (even when we use `write_unaligned`, which under the hood uses an untyped copy). - p.as_mut_ptr().write_unaligned(mem::transmute((0usize, 0usize, 0usize))); - // This is a `None`, so everything but the discriminant is padding. - assert!(matches!(*p.as_ptr(), E::None)); +fn main() { + unsafe { + let mut p: mem::MaybeUninit = mem::MaybeUninit::zeroed(); + // The copy when `E` is returned from `transmute` should destroy padding + // (even when we use `write_unaligned`, which under the hood uses an untyped copy). + p.as_mut_ptr().write_unaligned(mem::transmute((0usize, 0usize, 0usize))); + // This is a `None`, so everything but the discriminant is padding. + assert!(matches!(*p.as_ptr(), E::None)); - // Turns out the discriminant is (currently) stored - // in the 2nd pointer, so the first half is padding. - let c = &p as *const _ as *const u8; - let _val = *c.add(0); // Get a padding byte. - //~^ERROR: uninitialized -} } + // Turns out the discriminant is (currently) stored + // in the 2nd pointer, so the first half is padding. + let c = &p as *const _ as *const u8; + // Read a padding byte. + let _val = *c.add(0); + //~^ERROR: uninitialized + } +} diff --git a/src/tools/miri/tests/fail/uninit/padding-enum.stderr b/src/tools/miri/tests/fail/uninit/padding-enum.stderr index c571f18874076..66d3092c9ba89 100644 --- a/src/tools/miri/tests/fail/uninit/padding-enum.stderr +++ b/src/tools/miri/tests/fail/uninit/padding-enum.stderr @@ -1,13 +1,13 @@ error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory - --> $DIR/padding-enum.rs:LL:CC + --> tests/fail/uninit/padding-enum.rs:LL:CC | -LL | let _val = *c.add(0); // Get a padding byte. - | ^^^^^^^^^ using uninitialized data, but this operation requires initialized memory +LL | let _val = *c.add(0); + | ^^^^^^^^^ using uninitialized data, but this operation requires initialized memory | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/padding-enum.rs:LL:CC + = note: inside `main` at tests/fail/uninit/padding-enum.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/uninit/padding-pair.stderr b/src/tools/miri/tests/fail/uninit/padding-pair.stderr index d35934d83d58f..f4ce802b15714 100644 --- a/src/tools/miri/tests/fail/uninit/padding-pair.stderr +++ b/src/tools/miri/tests/fail/uninit/padding-pair.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory - --> $DIR/padding-pair.rs:LL:CC + --> tests/fail/uninit/padding-pair.rs:LL:CC | LL | let v = unsafe { *z.offset(first_undef) }; | ^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory @@ -7,7 +7,7 @@ LL | let v = unsafe { *z.offset(first_undef) }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/padding-pair.rs:LL:CC + = note: inside `main` at tests/fail/uninit/padding-pair.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/uninit/padding-struct-in-union.stderr b/src/tools/miri/tests/fail/uninit/padding-struct-in-union.stderr index e122249af16e5..5e9dabd56443f 100644 --- a/src/tools/miri/tests/fail/uninit/padding-struct-in-union.stderr +++ b/src/tools/miri/tests/fail/uninit/padding-struct-in-union.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value at .bytes[2]: encountered uninitialized memory, but expected an integer - --> $DIR/padding-struct-in-union.rs:LL:CC + --> tests/fail/uninit/padding-struct-in-union.rs:LL:CC | LL | let _val = unsafe { (foobar.foo, foobar.bar) }; | ^^^^^^^^^^ constructing invalid value at .bytes[2]: encountered uninitialized memory, but expected an integer @@ -7,7 +7,7 @@ LL | let _val = unsafe { (foobar.foo, foobar.bar) }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/padding-struct-in-union.rs:LL:CC + = note: inside `main` at tests/fail/uninit/padding-struct-in-union.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/uninit/padding-struct.rs b/src/tools/miri/tests/fail/uninit/padding-struct.rs index dd3be50343902..4cdc6f3a10450 100644 --- a/src/tools/miri/tests/fail/uninit/padding-struct.rs +++ b/src/tools/miri/tests/fail/uninit/padding-struct.rs @@ -3,9 +3,12 @@ use std::mem; #[repr(C)] struct Pair(u8, u16); -fn main() { unsafe { - let p: Pair = mem::transmute(0u32); // The copy when `Pair` is returned from `transmute` should destroy padding. - let c = &p as *const _ as *const u8; - let _val = *c.add(1); // Get the padding byte. - //~^ERROR: uninitialized -} } +fn main() { + unsafe { + let p: Pair = mem::transmute(0u32); // The copy when `Pair` is returned from `transmute` should destroy padding. + let c = &p as *const _ as *const u8; + // Read the padding byte. + let _val = *c.add(1); + //~^ERROR: uninitialized + } +} diff --git a/src/tools/miri/tests/fail/uninit/padding-struct.stderr b/src/tools/miri/tests/fail/uninit/padding-struct.stderr index 8dc40a482ac52..f27783c17e958 100644 --- a/src/tools/miri/tests/fail/uninit/padding-struct.stderr +++ b/src/tools/miri/tests/fail/uninit/padding-struct.stderr @@ -1,13 +1,13 @@ error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory - --> $DIR/padding-struct.rs:LL:CC + --> tests/fail/uninit/padding-struct.rs:LL:CC | -LL | let _val = *c.add(1); // Get the padding byte. - | ^^^^^^^^^ using uninitialized data, but this operation requires initialized memory +LL | let _val = *c.add(1); + | ^^^^^^^^^ using uninitialized data, but this operation requires initialized memory | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/padding-struct.rs:LL:CC + = note: inside `main` at tests/fail/uninit/padding-struct.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/uninit/padding-union.rs b/src/tools/miri/tests/fail/uninit/padding-union.rs index 2e9e0a40d6c68..294578607b37d 100644 --- a/src/tools/miri/tests/fail/uninit/padding-union.rs +++ b/src/tools/miri/tests/fail/uninit/padding-union.rs @@ -6,9 +6,12 @@ union U { field: (u8, u16), } -fn main() { unsafe { - let p: U = mem::transmute(0u32); // The copy when `U` is returned from `transmute` should destroy padding. - let c = &p as *const _ as *const [u8; 4]; - let _val = *c; // Read the entire thing, definitely contains the padding byte. - //~^ERROR: uninitialized -} } +fn main() { + unsafe { + let p: U = mem::transmute(0u32); // The copy when `U` is returned from `transmute` should destroy padding. + let c = &p as *const _ as *const [u8; 4]; + // Read the entire thing, definitely contains the padding byte. + let _val = *c; + //~^ERROR: uninitialized + } +} diff --git a/src/tools/miri/tests/fail/uninit/padding-union.stderr b/src/tools/miri/tests/fail/uninit/padding-union.stderr index 04002da4f195c..248b06a14fe28 100644 --- a/src/tools/miri/tests/fail/uninit/padding-union.stderr +++ b/src/tools/miri/tests/fail/uninit/padding-union.stderr @@ -1,13 +1,13 @@ error: Undefined Behavior: constructing invalid value at [1]: encountered uninitialized memory, but expected an integer - --> $DIR/padding-union.rs:LL:CC + --> tests/fail/uninit/padding-union.rs:LL:CC | -LL | let _val = *c; // Read the entire thing, definitely contains the padding byte. - | ^^ constructing invalid value at [1]: encountered uninitialized memory, but expected an integer +LL | let _val = *c; + | ^^ constructing invalid value at [1]: encountered uninitialized memory, but expected an integer | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/padding-union.rs:LL:CC + = note: inside `main` at tests/fail/uninit/padding-union.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/uninit/padding-wide-ptr.rs b/src/tools/miri/tests/fail/uninit/padding-wide-ptr.rs index 0403a9caba66d..4e363dbf81e08 100644 --- a/src/tools/miri/tests/fail/uninit/padding-wide-ptr.rs +++ b/src/tools/miri/tests/fail/uninit/padding-wide-ptr.rs @@ -3,16 +3,19 @@ use std::mem; // If this is `None`, the metadata becomes padding. type T = Option<&'static str>; -fn main() { unsafe { - let mut p: mem::MaybeUninit = mem::MaybeUninit::zeroed(); - // The copy when `T` is returned from `transmute` should destroy padding - // (even when we use `write_unaligned`, which under the hood uses an untyped copy). - p.as_mut_ptr().write_unaligned(mem::transmute((0usize, 0usize))); - // Null epresents `None`. - assert!(matches!(*p.as_ptr(), None)); +fn main() { + unsafe { + let mut p: mem::MaybeUninit = mem::MaybeUninit::zeroed(); + // The copy when `T` is returned from `transmute` should destroy padding + // (even when we use `write_unaligned`, which under the hood uses an untyped copy). + p.as_mut_ptr().write_unaligned(mem::transmute((0usize, 0usize))); + // Null epresents `None`. + assert!(matches!(*p.as_ptr(), None)); - // The second part, with the length, becomes padding. - let c = &p as *const _ as *const u8; - let _val = *c.add(mem::size_of::<*const u8>()); // Get a padding byte. - //~^ERROR: uninitialized -} } + // The second part, with the length, becomes padding. + let c = &p as *const _ as *const u8; + // Read a padding byte. + let _val = *c.add(mem::size_of::<*const u8>()); + //~^ERROR: uninitialized + } +} diff --git a/src/tools/miri/tests/fail/uninit/padding-wide-ptr.stderr b/src/tools/miri/tests/fail/uninit/padding-wide-ptr.stderr index 0da72550b2e08..219bee45fe8ec 100644 --- a/src/tools/miri/tests/fail/uninit/padding-wide-ptr.stderr +++ b/src/tools/miri/tests/fail/uninit/padding-wide-ptr.stderr @@ -1,13 +1,13 @@ error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory - --> $DIR/padding-wide-ptr.rs:LL:CC + --> tests/fail/uninit/padding-wide-ptr.rs:LL:CC | -LL | let _val = *c.add(mem::size_of::<*const u8>()); // Get a padding byte. - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory +LL | let _val = *c.add(mem::size_of::<*const u8>()); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/padding-wide-ptr.rs:LL:CC + = note: inside `main` at tests/fail/uninit/padding-wide-ptr.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/uninit/transmute-pair-uninit.stderr b/src/tools/miri/tests/fail/uninit/transmute-pair-uninit.stderr index 30306054fbb3a..7fe88df560c83 100644 --- a/src/tools/miri/tests/fail/uninit/transmute-pair-uninit.stderr +++ b/src/tools/miri/tests/fail/uninit/transmute-pair-uninit.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory - --> $DIR/transmute-pair-uninit.rs:LL:CC + --> tests/fail/uninit/transmute-pair-uninit.rs:LL:CC | LL | let v = unsafe { *z.offset(first_undef) }; | ^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory @@ -7,7 +7,7 @@ LL | let v = unsafe { *z.offset(first_undef) }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/transmute-pair-uninit.rs:LL:CC + = note: inside `main` at tests/fail/uninit/transmute-pair-uninit.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/uninit/uninit-after-aggregate-assign.stderr b/src/tools/miri/tests/fail/uninit/uninit-after-aggregate-assign.stderr index 5f3d9bde1f244..ec6ba3fea7d6c 100644 --- a/src/tools/miri/tests/fail/uninit/uninit-after-aggregate-assign.stderr +++ b/src/tools/miri/tests/fail/uninit/uninit-after-aggregate-assign.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value at [1]: encountered uninitialized memory, but expected an integer - --> $DIR/uninit-after-aggregate-assign.rs:LL:CC + --> tests/fail/uninit/uninit-after-aggregate-assign.rs:LL:CC | LL | _val = *sptr2; // should hence be UB | ^^^^^^^^^^^^^ constructing invalid value at [1]: encountered uninitialized memory, but expected an integer @@ -7,7 +7,7 @@ LL | _val = *sptr2; // should hence be UB = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/uninit-after-aggregate-assign.rs:LL:CC + = note: inside `main` at tests/fail/uninit/uninit-after-aggregate-assign.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/uninit/uninit_alloc_diagnostic.stderr b/src/tools/miri/tests/fail/uninit/uninit_alloc_diagnostic.stderr index dfe3ed4b522ab..0996e5d11eff6 100644 --- a/src/tools/miri/tests/fail/uninit/uninit_alloc_diagnostic.stderr +++ b/src/tools/miri/tests/fail/uninit/uninit_alloc_diagnostic.stderr @@ -10,7 +10,7 @@ LL | let mut order = unsafe { compare_bytes(left, right, len) as isize } = note: inside `::compare` at RUSTLIB/core/src/slice/cmp.rs:LL:CC = note: inside `core::slice::cmp::::cmp` at RUSTLIB/core/src/slice/cmp.rs:LL:CC note: inside `main` - --> $DIR/uninit_alloc_diagnostic.rs:LL:CC + --> tests/fail/uninit/uninit_alloc_diagnostic.rs:LL:CC | LL | drop(slice1.cmp(slice2)); | ^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/uninit/uninit_alloc_diagnostic_with_provenance.stderr b/src/tools/miri/tests/fail/uninit/uninit_alloc_diagnostic_with_provenance.stderr index 48ce9ae76568a..bcde9377c5400 100644 --- a/src/tools/miri/tests/fail/uninit/uninit_alloc_diagnostic_with_provenance.stderr +++ b/src/tools/miri/tests/fail/uninit/uninit_alloc_diagnostic_with_provenance.stderr @@ -10,7 +10,7 @@ LL | let mut order = unsafe { compare_bytes(left, right, len) as isize } = note: inside `::compare` at RUSTLIB/core/src/slice/cmp.rs:LL:CC = note: inside `core::slice::cmp::::cmp` at RUSTLIB/core/src/slice/cmp.rs:LL:CC note: inside `main` - --> $DIR/uninit_alloc_diagnostic_with_provenance.rs:LL:CC + --> tests/fail/uninit/uninit_alloc_diagnostic_with_provenance.rs:LL:CC | LL | drop(slice1.cmp(slice2)); | ^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/uninit/uninit_byte_read.stderr b/src/tools/miri/tests/fail/uninit/uninit_byte_read.stderr index 3917d868289ea..5da89976b0371 100644 --- a/src/tools/miri/tests/fail/uninit/uninit_byte_read.stderr +++ b/src/tools/miri/tests/fail/uninit/uninit_byte_read.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory - --> $DIR/uninit_byte_read.rs:LL:CC + --> tests/fail/uninit/uninit_byte_read.rs:LL:CC | LL | let undef = unsafe { *v.as_ptr().add(5) }; | ^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory @@ -7,7 +7,7 @@ LL | let undef = unsafe { *v.as_ptr().add(5) }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/uninit_byte_read.rs:LL:CC + = note: inside `main` at tests/fail/uninit/uninit_byte_read.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/unreachable.stderr b/src/tools/miri/tests/fail/unreachable.stderr index f6982dc86535e..46c956ff77ea7 100644 --- a/src/tools/miri/tests/fail/unreachable.stderr +++ b/src/tools/miri/tests/fail/unreachable.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: entering unreachable code - --> $DIR/unreachable.rs:LL:CC + --> tests/fail/unreachable.rs:LL:CC | LL | unsafe { std::hint::unreachable_unchecked() } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ entering unreachable code @@ -7,7 +7,7 @@ LL | unsafe { std::hint::unreachable_unchecked() } = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/unreachable.rs:LL:CC + = note: inside `main` at tests/fail/unreachable.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/unsized-local.stderr b/src/tools/miri/tests/fail/unsized-local.stderr index df54c98bb0e11..548f3d66c7338 100644 --- a/src/tools/miri/tests/fail/unsized-local.stderr +++ b/src/tools/miri/tests/fail/unsized-local.stderr @@ -1,12 +1,12 @@ error: unsupported operation: unsized locals are not supported - --> $DIR/unsized-local.rs:LL:CC + --> tests/fail/unsized-local.rs:LL:CC | LL | let x = *(Box::new(A) as Box); | ^ unsized locals are not supported | = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support = note: BACKTRACE: - = note: inside `main` at $DIR/unsized-local.rs:LL:CC + = note: inside `main` at tests/fail/unsized-local.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/unsupported_foreign_function.stderr b/src/tools/miri/tests/fail/unsupported_foreign_function.stderr index f392e9564c751..4fe45b0868a93 100644 --- a/src/tools/miri/tests/fail/unsupported_foreign_function.stderr +++ b/src/tools/miri/tests/fail/unsupported_foreign_function.stderr @@ -1,5 +1,5 @@ error: unsupported operation: can't call foreign function `foo` on $OS - --> $DIR/unsupported_foreign_function.rs:LL:CC + --> tests/fail/unsupported_foreign_function.rs:LL:CC | LL | foo(); | ^^^^^ can't call foreign function `foo` on $OS @@ -7,7 +7,7 @@ LL | foo(); = help: if this is a basic API commonly used on this target, please report an issue with Miri = help: however, note that Miri does not aim to support every FFI function out there; for instance, we will not support APIs for things such as GUIs, scripting languages, or databases = note: BACKTRACE: - = note: inside `main` at $DIR/unsupported_foreign_function.rs:LL:CC + = note: inside `main` at tests/fail/unsupported_foreign_function.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/unwind-action-terminate.stderr b/src/tools/miri/tests/fail/unwind-action-terminate.stderr index fd67bdf4a90bc..818371220514f 100644 --- a/src/tools/miri/tests/fail/unwind-action-terminate.stderr +++ b/src/tools/miri/tests/fail/unwind-action-terminate.stderr @@ -1,4 +1,4 @@ -thread 'main' panicked at $DIR/unwind-action-terminate.rs:LL:CC: +thread 'main' panicked at tests/fail/unwind-action-terminate.rs:LL:CC: explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect @@ -21,14 +21,14 @@ LL | ABORT(); = note: inside `core::panicking::panic_nounwind` at RUSTLIB/core/src/panicking.rs:LL:CC = note: inside `core::panicking::panic_cannot_unwind` at RUSTLIB/core/src/panicking.rs:LL:CC note: inside `panic_abort` - --> $DIR/unwind-action-terminate.rs:LL:CC + --> tests/fail/unwind-action-terminate.rs:LL:CC | LL | / extern "C" fn panic_abort() { LL | | panic!() LL | | } | |_^ note: inside `main` - --> $DIR/unwind-action-terminate.rs:LL:CC + --> tests/fail/unwind-action-terminate.rs:LL:CC | LL | panic_abort(); | ^ diff --git a/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_callee_arg.stderr b/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_callee_arg.stderr index f526f77a4f000..9b6b7098e5cd6 100644 --- a/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_callee_arg.stderr +++ b/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_callee_arg.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value: encountered a null reference - --> $DIR/cast_fn_ptr_invalid_callee_arg.rs:LL:CC + --> tests/fail/validity/cast_fn_ptr_invalid_callee_arg.rs:LL:CC | LL | g(0usize as *const i32) | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null reference @@ -7,7 +7,7 @@ LL | g(0usize as *const i32) = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/cast_fn_ptr_invalid_callee_arg.rs:LL:CC + = note: inside `main` at tests/fail/validity/cast_fn_ptr_invalid_callee_arg.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_callee_ret.stderr b/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_callee_ret.stderr index 35de453522257..a0b7cc7a521d4 100644 --- a/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_callee_ret.stderr +++ b/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_callee_ret.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value at .0: encountered 0, but expected something greater or equal to 1 - --> $DIR/cast_fn_ptr_invalid_callee_ret.rs:LL:CC + --> tests/fail/validity/cast_fn_ptr_invalid_callee_ret.rs:LL:CC | LL | f(); | ^^^ constructing invalid value at .0: encountered 0, but expected something greater or equal to 1 @@ -7,7 +7,7 @@ LL | f(); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/cast_fn_ptr_invalid_callee_ret.rs:LL:CC + = note: inside `main` at tests/fail/validity/cast_fn_ptr_invalid_callee_ret.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_caller_arg.stderr b/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_caller_arg.stderr index 81d775f6d7f5f..6af0e72b9c43f 100644 --- a/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_caller_arg.stderr +++ b/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_caller_arg.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value at .0: encountered 0, but expected something greater or equal to 1 - --> $DIR/cast_fn_ptr_invalid_caller_arg.rs:LL:CC + --> tests/fail/validity/cast_fn_ptr_invalid_caller_arg.rs:LL:CC | LL | Call(_res = f(*ptr), ReturnTo(retblock), UnwindContinue()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered 0, but expected something greater or equal to 1 @@ -7,9 +7,9 @@ LL | Call(_res = f(*ptr), ReturnTo(retblock), UnwindContinue()) = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `call` at $DIR/cast_fn_ptr_invalid_caller_arg.rs:LL:CC + = note: inside `call` at tests/fail/validity/cast_fn_ptr_invalid_caller_arg.rs:LL:CC note: inside `main` - --> $DIR/cast_fn_ptr_invalid_caller_arg.rs:LL:CC + --> tests/fail/validity/cast_fn_ptr_invalid_caller_arg.rs:LL:CC | LL | call(f); | ^^^^^^^ diff --git a/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_caller_ret.stderr b/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_caller_ret.stderr index 7593b8a399873..c02651c7cc9d8 100644 --- a/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_caller_ret.stderr +++ b/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_caller_ret.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value: encountered a null reference - --> $DIR/cast_fn_ptr_invalid_caller_ret.rs:LL:CC + --> tests/fail/validity/cast_fn_ptr_invalid_caller_ret.rs:LL:CC | LL | let _x = g(); | ^^^ constructing invalid value: encountered a null reference @@ -7,7 +7,7 @@ LL | let _x = g(); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/cast_fn_ptr_invalid_caller_ret.rs:LL:CC + = note: inside `main` at tests/fail/validity/cast_fn_ptr_invalid_caller_ret.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/validity/dangling_ref1.stderr b/src/tools/miri/tests/fail/validity/dangling_ref1.stderr index fd4dd502bd5c1..09634e5ae7b01 100644 --- a/src/tools/miri/tests/fail/validity/dangling_ref1.stderr +++ b/src/tools/miri/tests/fail/validity/dangling_ref1.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value: encountered a dangling reference (0x10[noalloc] has no provenance) - --> $DIR/dangling_ref1.rs:LL:CC + --> tests/fail/validity/dangling_ref1.rs:LL:CC | LL | let _x: &i32 = unsafe { mem::transmute(16usize) }; | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (0x10[noalloc] has no provenance) @@ -7,7 +7,7 @@ LL | let _x: &i32 = unsafe { mem::transmute(16usize) }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/dangling_ref1.rs:LL:CC + = note: inside `main` at tests/fail/validity/dangling_ref1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/validity/dangling_ref2.stderr b/src/tools/miri/tests/fail/validity/dangling_ref2.stderr index 2d45ae68ca474..fe7fe2795ef55 100644 --- a/src/tools/miri/tests/fail/validity/dangling_ref2.stderr +++ b/src/tools/miri/tests/fail/validity/dangling_ref2.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation) - --> $DIR/dangling_ref2.rs:LL:CC + --> tests/fail/validity/dangling_ref2.rs:LL:CC | LL | let _x: &i32 = unsafe { mem::transmute(ptr) }; | ^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation) @@ -7,7 +7,7 @@ LL | let _x: &i32 = unsafe { mem::transmute(ptr) }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/dangling_ref2.rs:LL:CC + = note: inside `main` at tests/fail/validity/dangling_ref2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/validity/dangling_ref3.stderr b/src/tools/miri/tests/fail/validity/dangling_ref3.stderr index 5ac4f5deffe7c..fe40aaa122f4f 100644 --- a/src/tools/miri/tests/fail/validity/dangling_ref3.stderr +++ b/src/tools/miri/tests/fail/validity/dangling_ref3.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value: encountered a dangling reference (use-after-free) - --> $DIR/dangling_ref3.rs:LL:CC + --> tests/fail/validity/dangling_ref3.rs:LL:CC | LL | let _x: &i32 = unsafe { mem::transmute(dangling()) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (use-after-free) @@ -7,7 +7,7 @@ LL | let _x: &i32 = unsafe { mem::transmute(dangling()) }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/dangling_ref3.rs:LL:CC + = note: inside `main` at tests/fail/validity/dangling_ref3.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/validity/invalid_bool.stderr b/src/tools/miri/tests/fail/validity/invalid_bool.stderr index 3ed823dde9427..9bed0f716a03c 100644 --- a/src/tools/miri/tests/fail/validity/invalid_bool.stderr +++ b/src/tools/miri/tests/fail/validity/invalid_bool.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value: encountered 0x02, but expected a boolean - --> $DIR/invalid_bool.rs:LL:CC + --> tests/fail/validity/invalid_bool.rs:LL:CC | LL | let _b = unsafe { std::mem::transmute::(2) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x02, but expected a boolean @@ -7,7 +7,7 @@ LL | let _b = unsafe { std::mem::transmute::(2) }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/invalid_bool.rs:LL:CC + = note: inside `main` at tests/fail/validity/invalid_bool.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/validity/invalid_bool_op.stderr b/src/tools/miri/tests/fail/validity/invalid_bool_op.stderr index b938d29e760ad..ee84762fe40ba 100644 --- a/src/tools/miri/tests/fail/validity/invalid_bool_op.stderr +++ b/src/tools/miri/tests/fail/validity/invalid_bool_op.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: interpreting an invalid 8-bit value as a bool: 0x02 - --> $DIR/invalid_bool_op.rs:LL:CC + --> tests/fail/validity/invalid_bool_op.rs:LL:CC | LL | let _x = b == std::hint::black_box(true); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ interpreting an invalid 8-bit value as a bool: 0x02 @@ -7,7 +7,7 @@ LL | let _x = b == std::hint::black_box(true); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/invalid_bool_op.rs:LL:CC + = note: inside `main` at tests/fail/validity/invalid_bool_op.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/validity/invalid_bool_uninit.stderr b/src/tools/miri/tests/fail/validity/invalid_bool_uninit.stderr index 314416766a57a..487e3714b72b3 100644 --- a/src/tools/miri/tests/fail/validity/invalid_bool_uninit.stderr +++ b/src/tools/miri/tests/fail/validity/invalid_bool_uninit.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value at [0]: encountered uninitialized memory, but expected a boolean - --> $DIR/invalid_bool_uninit.rs:LL:CC + --> tests/fail/validity/invalid_bool_uninit.rs:LL:CC | LL | let _b = unsafe { MyUninit { init: () }.uninit }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0]: encountered uninitialized memory, but expected a boolean @@ -7,7 +7,7 @@ LL | let _b = unsafe { MyUninit { init: () }.uninit }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/invalid_bool_uninit.rs:LL:CC + = note: inside `main` at tests/fail/validity/invalid_bool_uninit.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/validity/invalid_char.stderr b/src/tools/miri/tests/fail/validity/invalid_char.stderr index c761669c6db45..5d258176cb65d 100644 --- a/src/tools/miri/tests/fail/validity/invalid_char.stderr +++ b/src/tools/miri/tests/fail/validity/invalid_char.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value: encountered $HEX, but expected a valid unicode scalar value (in `0..=$HEX` but not in `$HEX..=$HEX`) - --> $DIR/invalid_char.rs:LL:CC + --> tests/fail/validity/invalid_char.rs:LL:CC | LL | let _val = match unsafe { std::mem::transmute::(-1) } { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered $HEX, but expected a valid unicode scalar value (in `0..=$HEX` but not in `$HEX..=$HEX`) @@ -7,7 +7,7 @@ LL | let _val = match unsafe { std::mem::transmute::(-1) } { = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/invalid_char.rs:LL:CC + = note: inside `main` at tests/fail/validity/invalid_char.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/validity/invalid_char_cast.stderr b/src/tools/miri/tests/fail/validity/invalid_char_cast.stderr index 1b5c838cf463c..b88f9f77208b7 100644 --- a/src/tools/miri/tests/fail/validity/invalid_char_cast.stderr +++ b/src/tools/miri/tests/fail/validity/invalid_char_cast.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: interpreting an invalid 32-bit value as a char: $HEX - --> $DIR/invalid_char_cast.rs:LL:CC + --> tests/fail/validity/invalid_char_cast.rs:LL:CC | LL | RET = *ptr as u32; | ^^^^^^^^^^^^^^^^^ interpreting an invalid 32-bit value as a char: $HEX @@ -7,9 +7,9 @@ LL | RET = *ptr as u32; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `cast` at $DIR/invalid_char_cast.rs:LL:CC + = note: inside `cast` at tests/fail/validity/invalid_char_cast.rs:LL:CC note: inside `main` - --> $DIR/invalid_char_cast.rs:LL:CC + --> tests/fail/validity/invalid_char_cast.rs:LL:CC | LL | cast(&v as *const u32 as *const char); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/validity/invalid_char_match.stderr b/src/tools/miri/tests/fail/validity/invalid_char_match.stderr index 7706ed97316ce..9ce1631e67fba 100644 --- a/src/tools/miri/tests/fail/validity/invalid_char_match.stderr +++ b/src/tools/miri/tests/fail/validity/invalid_char_match.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: interpreting an invalid 32-bit value as a char: $HEX - --> $DIR/invalid_char_match.rs:LL:CC + --> tests/fail/validity/invalid_char_match.rs:LL:CC | LL | / match *ptr { LL | | '0' => ret, @@ -10,9 +10,9 @@ LL | | } = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `switch_int` at $DIR/invalid_char_match.rs:LL:CC + = note: inside `switch_int` at tests/fail/validity/invalid_char_match.rs:LL:CC note: inside `main` - --> $DIR/invalid_char_match.rs:LL:CC + --> tests/fail/validity/invalid_char_match.rs:LL:CC | LL | switch_int(&v as *const u32 as *const char); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/validity/invalid_char_op.stderr b/src/tools/miri/tests/fail/validity/invalid_char_op.stderr index 113eecd9cf7aa..2d84ef3dda6c4 100644 --- a/src/tools/miri/tests/fail/validity/invalid_char_op.stderr +++ b/src/tools/miri/tests/fail/validity/invalid_char_op.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: interpreting an invalid 32-bit value as a char: $HEX - --> $DIR/invalid_char_op.rs:LL:CC + --> tests/fail/validity/invalid_char_op.rs:LL:CC | LL | let _x = c == 'x'; | ^^^^^^^^ interpreting an invalid 32-bit value as a char: $HEX @@ -7,7 +7,7 @@ LL | let _x = c == 'x'; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/invalid_char_op.rs:LL:CC + = note: inside `main` at tests/fail/validity/invalid_char_op.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/validity/invalid_char_uninit.stderr b/src/tools/miri/tests/fail/validity/invalid_char_uninit.stderr index 34babac4dd330..6fd311df5ee24 100644 --- a/src/tools/miri/tests/fail/validity/invalid_char_uninit.stderr +++ b/src/tools/miri/tests/fail/validity/invalid_char_uninit.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value at [0]: encountered uninitialized memory, but expected a unicode scalar value - --> $DIR/invalid_char_uninit.rs:LL:CC + --> tests/fail/validity/invalid_char_uninit.rs:LL:CC | LL | let _b = unsafe { MyUninit { init: () }.uninit }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0]: encountered uninitialized memory, but expected a unicode scalar value @@ -7,7 +7,7 @@ LL | let _b = unsafe { MyUninit { init: () }.uninit }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/invalid_char_uninit.rs:LL:CC + = note: inside `main` at tests/fail/validity/invalid_char_uninit.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/validity/invalid_enum_cast.stderr b/src/tools/miri/tests/fail/validity/invalid_enum_cast.stderr index 30afb5e8087b4..0736dfb2df119 100644 --- a/src/tools/miri/tests/fail/validity/invalid_enum_cast.stderr +++ b/src/tools/miri/tests/fail/validity/invalid_enum_cast.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: enum value has invalid tag: 0xff - --> $DIR/invalid_enum_cast.rs:LL:CC + --> tests/fail/validity/invalid_enum_cast.rs:LL:CC | LL | let _val = *ptr as u32; | ^^^^^^^^^^^ enum value has invalid tag: 0xff @@ -7,9 +7,9 @@ LL | let _val = *ptr as u32; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `cast` at $DIR/invalid_enum_cast.rs:LL:CC + = note: inside `cast` at tests/fail/validity/invalid_enum_cast.rs:LL:CC note: inside `main` - --> $DIR/invalid_enum_cast.rs:LL:CC + --> tests/fail/validity/invalid_enum_cast.rs:LL:CC | LL | cast(&v as *const u32 as *const E); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/fail/validity/invalid_enum_op.stderr b/src/tools/miri/tests/fail/validity/invalid_enum_op.stderr index e7997689c51c0..d2cfa86de869d 100644 --- a/src/tools/miri/tests/fail/validity/invalid_enum_op.stderr +++ b/src/tools/miri/tests/fail/validity/invalid_enum_op.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: enum value has invalid tag: $HEX - --> $DIR/invalid_enum_op.rs:LL:CC + --> tests/fail/validity/invalid_enum_op.rs:LL:CC | LL | let _val = mem::discriminant(&f); | ^^^^^^^^^^^^^^^^^^^^^ enum value has invalid tag: $HEX @@ -7,7 +7,7 @@ LL | let _val = mem::discriminant(&f); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/invalid_enum_op.rs:LL:CC + = note: inside `main` at tests/fail/validity/invalid_enum_op.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/validity/invalid_enum_tag.stderr b/src/tools/miri/tests/fail/validity/invalid_enum_tag.stderr index 5d27062fbc273..5721cfda932fa 100644 --- a/src/tools/miri/tests/fail/validity/invalid_enum_tag.stderr +++ b/src/tools/miri/tests/fail/validity/invalid_enum_tag.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value at .: encountered $HEX, but expected a valid enum tag - --> $DIR/invalid_enum_tag.rs:LL:CC + --> tests/fail/validity/invalid_enum_tag.rs:LL:CC | LL | let _f = unsafe { std::mem::transmute::(42) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .: encountered $HEX, but expected a valid enum tag @@ -7,7 +7,7 @@ LL | let _f = unsafe { std::mem::transmute::(42) }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/invalid_enum_tag.rs:LL:CC + = note: inside `main` at tests/fail/validity/invalid_enum_tag.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/validity/invalid_fnptr_null.stderr b/src/tools/miri/tests/fail/validity/invalid_fnptr_null.stderr index f781ca04f0334..a07b5babe1af3 100644 --- a/src/tools/miri/tests/fail/validity/invalid_fnptr_null.stderr +++ b/src/tools/miri/tests/fail/validity/invalid_fnptr_null.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value: encountered a null function pointer - --> $DIR/invalid_fnptr_null.rs:LL:CC + --> tests/fail/validity/invalid_fnptr_null.rs:LL:CC | LL | let _b: fn() = unsafe { std::mem::transmute(0usize) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null function pointer @@ -7,7 +7,7 @@ LL | let _b: fn() = unsafe { std::mem::transmute(0usize) }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/invalid_fnptr_null.rs:LL:CC + = note: inside `main` at tests/fail/validity/invalid_fnptr_null.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/validity/invalid_fnptr_uninit.stderr b/src/tools/miri/tests/fail/validity/invalid_fnptr_uninit.stderr index 54781b507e081..85fabc1836b5a 100644 --- a/src/tools/miri/tests/fail/validity/invalid_fnptr_uninit.stderr +++ b/src/tools/miri/tests/fail/validity/invalid_fnptr_uninit.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value at [0]: encountered uninitialized memory, but expected a function pointer - --> $DIR/invalid_fnptr_uninit.rs:LL:CC + --> tests/fail/validity/invalid_fnptr_uninit.rs:LL:CC | LL | let _b = unsafe { MyUninit { init: () }.uninit }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0]: encountered uninitialized memory, but expected a function pointer @@ -7,7 +7,7 @@ LL | let _b = unsafe { MyUninit { init: () }.uninit }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/invalid_fnptr_uninit.rs:LL:CC + = note: inside `main` at tests/fail/validity/invalid_fnptr_uninit.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/validity/invalid_int_op.stderr b/src/tools/miri/tests/fail/validity/invalid_int_op.stderr index df344311b7577..c3f47df12f927 100644 --- a/src/tools/miri/tests/fail/validity/invalid_int_op.stderr +++ b/src/tools/miri/tests/fail/validity/invalid_int_op.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory - --> $DIR/invalid_int_op.rs:LL:CC + --> tests/fail/validity/invalid_int_op.rs:LL:CC | LL | let i = unsafe { std::mem::MaybeUninit::::uninit().assume_init() }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory @@ -7,7 +7,7 @@ LL | let i = unsafe { std::mem::MaybeUninit::::uninit().assume_init() } = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/invalid_int_op.rs:LL:CC + = note: inside `main` at tests/fail/validity/invalid_int_op.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/validity/invalid_wide_raw.stderr b/src/tools/miri/tests/fail/validity/invalid_wide_raw.stderr index ed34d5255a438..5321dc0f4cfa1 100644 --- a/src/tools/miri/tests/fail/validity/invalid_wide_raw.stderr +++ b/src/tools/miri/tests/fail/validity/invalid_wide_raw.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value: encountered null pointer, but expected a vtable pointer - --> $DIR/invalid_wide_raw.rs:LL:CC + --> tests/fail/validity/invalid_wide_raw.rs:LL:CC | LL | dbg!(S { x: unsafe { std::mem::transmute((0usize, 0usize)) } }); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered null pointer, but expected a vtable pointer @@ -7,7 +7,7 @@ LL | dbg!(S { x: unsafe { std::mem::transmute((0usize, 0usize)) } }); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/invalid_wide_raw.rs:LL:CC + = note: inside `main` at tests/fail/validity/invalid_wide_raw.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/validity/match_binder_checks_validity1.stderr b/src/tools/miri/tests/fail/validity/match_binder_checks_validity1.stderr index a1bfa267cbe0e..ec607512686cc 100644 --- a/src/tools/miri/tests/fail/validity/match_binder_checks_validity1.stderr +++ b/src/tools/miri/tests/fail/validity/match_binder_checks_validity1.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value: encountered a value of uninhabited type `main::Void` - --> $DIR/match_binder_checks_validity1.rs:LL:CC + --> tests/fail/validity/match_binder_checks_validity1.rs:LL:CC | LL | _x => println!("hi from the void!"), | ^^ constructing invalid value: encountered a value of uninhabited type `main::Void` @@ -7,7 +7,7 @@ LL | _x => println!("hi from the void!"), = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/match_binder_checks_validity1.rs:LL:CC + = note: inside `main` at tests/fail/validity/match_binder_checks_validity1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/validity/match_binder_checks_validity2.stderr b/src/tools/miri/tests/fail/validity/match_binder_checks_validity2.stderr index 2d8238350f332..0375ead8f55fc 100644 --- a/src/tools/miri/tests/fail/validity/match_binder_checks_validity2.stderr +++ b/src/tools/miri/tests/fail/validity/match_binder_checks_validity2.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value: encountered 0x03, but expected a boolean - --> $DIR/match_binder_checks_validity2.rs:LL:CC + --> tests/fail/validity/match_binder_checks_validity2.rs:LL:CC | LL | _x => println!("hi from the void!"), | ^^ constructing invalid value: encountered 0x03, but expected a boolean @@ -7,7 +7,7 @@ LL | _x => println!("hi from the void!"), = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/match_binder_checks_validity2.rs:LL:CC + = note: inside `main` at tests/fail/validity/match_binder_checks_validity2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/validity/nonzero.stderr b/src/tools/miri/tests/fail/validity/nonzero.stderr index 2add8434ca562..bbf1f9a73ff59 100644 --- a/src/tools/miri/tests/fail/validity/nonzero.stderr +++ b/src/tools/miri/tests/fail/validity/nonzero.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value: encountered 0, but expected something greater or equal to 1 - --> $DIR/nonzero.rs:LL:CC + --> tests/fail/validity/nonzero.rs:LL:CC | LL | let _x = Some(unsafe { NonZero(0) }); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1 @@ -7,7 +7,7 @@ LL | let _x = Some(unsafe { NonZero(0) }); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/nonzero.rs:LL:CC + = note: inside `main` at tests/fail/validity/nonzero.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/validity/recursive-validity-ref-bool.stderr b/src/tools/miri/tests/fail/validity/recursive-validity-ref-bool.stderr index 2b2fa9b8a206d..87ac8c179328a 100644 --- a/src/tools/miri/tests/fail/validity/recursive-validity-ref-bool.stderr +++ b/src/tools/miri/tests/fail/validity/recursive-validity-ref-bool.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value at .: encountered 0x03, but expected a boolean - --> $DIR/recursive-validity-ref-bool.rs:LL:CC + --> tests/fail/validity/recursive-validity-ref-bool.rs:LL:CC | LL | let xref_wrong_type: &bool = unsafe { std::mem::transmute(xref) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .: encountered 0x03, but expected a boolean @@ -7,7 +7,7 @@ LL | let xref_wrong_type: &bool = unsafe { std::mem::transmute(xref) }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/recursive-validity-ref-bool.rs:LL:CC + = note: inside `main` at tests/fail/validity/recursive-validity-ref-bool.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/validity/ref_to_uninhabited1.stderr b/src/tools/miri/tests/fail/validity/ref_to_uninhabited1.stderr index d893f7a9e545e..30acfef02fff1 100644 --- a/src/tools/miri/tests/fail/validity/ref_to_uninhabited1.stderr +++ b/src/tools/miri/tests/fail/validity/ref_to_uninhabited1.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value: encountered a box pointing to uninhabited type ! - --> $DIR/ref_to_uninhabited1.rs:LL:CC + --> tests/fail/validity/ref_to_uninhabited1.rs:LL:CC | LL | let x: Box = transmute(&mut 42); | ^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a box pointing to uninhabited type ! @@ -7,7 +7,7 @@ LL | let x: Box = transmute(&mut 42); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/ref_to_uninhabited1.rs:LL:CC + = note: inside `main` at tests/fail/validity/ref_to_uninhabited1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/validity/ref_to_uninhabited2.stderr b/src/tools/miri/tests/fail/validity/ref_to_uninhabited2.stderr index 1d9c89c6880c8..1015d1ec42793 100644 --- a/src/tools/miri/tests/fail/validity/ref_to_uninhabited2.stderr +++ b/src/tools/miri/tests/fail/validity/ref_to_uninhabited2.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value: encountered a reference pointing to uninhabited type (i32, Void) - --> $DIR/ref_to_uninhabited2.rs:LL:CC + --> tests/fail/validity/ref_to_uninhabited2.rs:LL:CC | LL | let _x: &(i32, Void) = transmute(&42); | ^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to uninhabited type (i32, Void) @@ -7,7 +7,7 @@ LL | let _x: &(i32, Void) = transmute(&42); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/ref_to_uninhabited2.rs:LL:CC + = note: inside `main` at tests/fail/validity/ref_to_uninhabited2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/validity/too-big-slice.stderr b/src/tools/miri/tests/fail/validity/too-big-slice.stderr index 2abe6c6fdf3d0..2b0a8f03813c4 100644 --- a/src/tools/miri/tests/fail/validity/too-big-slice.stderr +++ b/src/tools/miri/tests/fail/validity/too-big-slice.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object - --> $DIR/too-big-slice.rs:LL:CC + --> tests/fail/validity/too-big-slice.rs:LL:CC | LL | let _x: &[u8] = mem::transmute((ptr, usize::MAX)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object @@ -7,7 +7,7 @@ LL | let _x: &[u8] = mem::transmute((ptr, usize::MAX)); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/too-big-slice.rs:LL:CC + = note: inside `main` at tests/fail/validity/too-big-slice.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/validity/too-big-unsized.stderr b/src/tools/miri/tests/fail/validity/too-big-unsized.stderr index bc8a140ac22c0..1e8b37979b0b6 100644 --- a/src/tools/miri/tests/fail/validity/too-big-unsized.stderr +++ b/src/tools/miri/tests/fail/validity/too-big-unsized.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value: encountered invalid reference metadata: total size is bigger than largest supported object - --> $DIR/too-big-unsized.rs:LL:CC + --> tests/fail/validity/too-big-unsized.rs:LL:CC | LL | let _x: &MySlice = mem::transmute((ptr, isize::MAX as usize)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: total size is bigger than largest supported object @@ -7,7 +7,7 @@ LL | let _x: &MySlice = mem::transmute((ptr, isize::MAX as usize)); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/too-big-unsized.rs:LL:CC + = note: inside `main` at tests/fail/validity/too-big-unsized.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/validity/transmute_through_ptr.stderr b/src/tools/miri/tests/fail/validity/transmute_through_ptr.stderr index fcd077daa38ff..bbb40d1f58f0b 100644 --- a/src/tools/miri/tests/fail/validity/transmute_through_ptr.stderr +++ b/src/tools/miri/tests/fail/validity/transmute_through_ptr.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value at .: encountered $HEX, but expected a valid enum tag - --> $DIR/transmute_through_ptr.rs:LL:CC + --> tests/fail/validity/transmute_through_ptr.rs:LL:CC | LL | let y = x; // reading this ought to be enough to trigger validation | ^ constructing invalid value at .: encountered $HEX, but expected a valid enum tag @@ -7,7 +7,7 @@ LL | let y = x; // reading this ought to be enough to trigger validation = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/transmute_through_ptr.rs:LL:CC + = note: inside `main` at tests/fail/validity/transmute_through_ptr.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/validity/uninit_float.stderr b/src/tools/miri/tests/fail/validity/uninit_float.stderr index 3d7ec44fdb064..a6ca0f40f0db3 100644 --- a/src/tools/miri/tests/fail/validity/uninit_float.stderr +++ b/src/tools/miri/tests/fail/validity/uninit_float.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value at .value[0]: encountered uninitialized memory, but expected a floating point number - --> $DIR/uninit_float.rs:LL:CC + --> tests/fail/validity/uninit_float.rs:LL:CC | LL | let _val: [f32; 1] = unsafe { std::mem::uninitialized() }; | ^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .value[0]: encountered uninitialized memory, but expected a floating point number @@ -7,7 +7,7 @@ LL | let _val: [f32; 1] = unsafe { std::mem::uninitialized() }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/uninit_float.rs:LL:CC + = note: inside `main` at tests/fail/validity/uninit_float.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/validity/uninit_integer.stderr b/src/tools/miri/tests/fail/validity/uninit_integer.stderr index 55f3f803ad14c..b983832799b16 100644 --- a/src/tools/miri/tests/fail/validity/uninit_integer.stderr +++ b/src/tools/miri/tests/fail/validity/uninit_integer.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value at .value[0]: encountered uninitialized memory, but expected an integer - --> $DIR/uninit_integer.rs:LL:CC + --> tests/fail/validity/uninit_integer.rs:LL:CC | LL | let _val = unsafe { std::mem::MaybeUninit::<[usize; 1]>::uninit().assume_init() }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .value[0]: encountered uninitialized memory, but expected an integer @@ -7,7 +7,7 @@ LL | let _val = unsafe { std::mem::MaybeUninit::<[usize; 1]>::uninit().assum = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/uninit_integer.rs:LL:CC + = note: inside `main` at tests/fail/validity/uninit_integer.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/validity/uninit_raw_ptr.stderr b/src/tools/miri/tests/fail/validity/uninit_raw_ptr.stderr index fed1cf4587431..83af585201a93 100644 --- a/src/tools/miri/tests/fail/validity/uninit_raw_ptr.stderr +++ b/src/tools/miri/tests/fail/validity/uninit_raw_ptr.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value at .value[0]: encountered uninitialized memory, but expected a raw pointer - --> $DIR/uninit_raw_ptr.rs:LL:CC + --> tests/fail/validity/uninit_raw_ptr.rs:LL:CC | LL | let _val = unsafe { std::mem::MaybeUninit::<[*const u8; 1]>::uninit().assume_init() }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .value[0]: encountered uninitialized memory, but expected a raw pointer @@ -7,7 +7,7 @@ LL | let _val = unsafe { std::mem::MaybeUninit::<[*const u8; 1]>::uninit().a = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/uninit_raw_ptr.rs:LL:CC + = note: inside `main` at tests/fail/validity/uninit_raw_ptr.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/validity/wrong-dyn-trait-generic.stderr b/src/tools/miri/tests/fail/validity/wrong-dyn-trait-generic.stderr index 1219f9f88cf8c..0b5163f711ec4 100644 --- a/src/tools/miri/tests/fail/validity/wrong-dyn-trait-generic.stderr +++ b/src/tools/miri/tests/fail/validity/wrong-dyn-trait-generic.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value: wrong trait in wide pointer vtable: expected `Trait`, but encountered `Trait` - --> $DIR/wrong-dyn-trait-generic.rs:LL:CC + --> tests/fail/validity/wrong-dyn-trait-generic.rs:LL:CC | LL | let _y: *const dyn Trait = unsafe { mem::transmute(x) }; | ^^^^^^^^^^^^^^^^^ constructing invalid value: wrong trait in wide pointer vtable: expected `Trait`, but encountered `Trait` @@ -7,7 +7,7 @@ LL | let _y: *const dyn Trait = unsafe { mem::transmute(x) }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/wrong-dyn-trait-generic.rs:LL:CC + = note: inside `main` at tests/fail/validity/wrong-dyn-trait-generic.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/validity/wrong-dyn-trait.stderr b/src/tools/miri/tests/fail/validity/wrong-dyn-trait.stderr index e3503323b31a7..4be3fb52bdb7f 100644 --- a/src/tools/miri/tests/fail/validity/wrong-dyn-trait.stderr +++ b/src/tools/miri/tests/fail/validity/wrong-dyn-trait.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: constructing invalid value: wrong trait in wide pointer vtable: expected `std::fmt::Debug`, but encountered `` - --> $DIR/wrong-dyn-trait.rs:LL:CC + --> tests/fail/validity/wrong-dyn-trait.rs:LL:CC | LL | let _y: *const dyn fmt::Debug = unsafe { mem::transmute(x) }; | ^^^^^^^^^^^^^^^^^ constructing invalid value: wrong trait in wide pointer vtable: expected `std::fmt::Debug`, but encountered `` @@ -7,7 +7,7 @@ LL | let _y: *const dyn fmt::Debug = unsafe { mem::transmute(x) }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/wrong-dyn-trait.rs:LL:CC + = note: inside `main` at tests/fail/validity/wrong-dyn-trait.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/weak_memory/racing_mixed_size.stderr b/src/tools/miri/tests/fail/weak_memory/racing_mixed_size.stderr index 44430cd25db72..a437ca3425853 100644 --- a/src/tools/miri/tests/fail/weak_memory/racing_mixed_size.stderr +++ b/src/tools/miri/tests/fail/weak_memory/racing_mixed_size.stderr @@ -1,11 +1,11 @@ error: Undefined Behavior: Race condition detected between (1) 4-byte atomic store on thread `unnamed-ID` and (2) 2-byte atomic load on thread `unnamed-ID` at ALLOC. (2) just happened here - --> $DIR/racing_mixed_size.rs:LL:CC + --> tests/fail/weak_memory/racing_mixed_size.rs:LL:CC | LL | std::intrinsics::atomic_load_relaxed(hi); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Race condition detected between (1) 4-byte atomic store on thread `unnamed-ID` and (2) 2-byte atomic load on thread `unnamed-ID` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/racing_mixed_size.rs:LL:CC + --> tests/fail/weak_memory/racing_mixed_size.rs:LL:CC | LL | x.store(1, Relaxed); | ^^^^^^^^^^^^^^^^^^^ @@ -14,7 +14,7 @@ LL | x.store(1, Relaxed); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at $DIR/racing_mixed_size.rs:LL:CC + = note: inside closure at tests/fail/weak_memory/racing_mixed_size.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/weak_memory/racing_mixed_size_read.stderr b/src/tools/miri/tests/fail/weak_memory/racing_mixed_size_read.stderr index 94b4123d34567..9e6a6e80418cf 100644 --- a/src/tools/miri/tests/fail/weak_memory/racing_mixed_size_read.stderr +++ b/src/tools/miri/tests/fail/weak_memory/racing_mixed_size_read.stderr @@ -1,11 +1,11 @@ error: Undefined Behavior: Race condition detected between (1) 4-byte atomic load on thread `unnamed-ID` and (2) 2-byte atomic load on thread `unnamed-ID` at ALLOC. (2) just happened here - --> $DIR/racing_mixed_size_read.rs:LL:CC + --> tests/fail/weak_memory/racing_mixed_size_read.rs:LL:CC | LL | (*hi).load(Relaxed); | ^^^^^^^^^^^^^^^^^^^ Race condition detected between (1) 4-byte atomic load on thread `unnamed-ID` and (2) 2-byte atomic load on thread `unnamed-ID` at ALLOC. (2) just happened here | help: and (1) occurred earlier here - --> $DIR/racing_mixed_size_read.rs:LL:CC + --> tests/fail/weak_memory/racing_mixed_size_read.rs:LL:CC | LL | x.load(Relaxed); | ^^^^^^^^^^^^^^^ @@ -14,7 +14,7 @@ LL | x.load(Relaxed); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at $DIR/racing_mixed_size_read.rs:LL:CC + = note: inside closure at tests/fail/weak_memory/racing_mixed_size_read.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/weak_memory/weak_uninit.stderr b/src/tools/miri/tests/fail/weak_memory/weak_uninit.stderr index 9aa5bc2fa76df..816bd323f4cc4 100644 --- a/src/tools/miri/tests/fail/weak_memory/weak_uninit.stderr +++ b/src/tools/miri/tests/fail/weak_memory/weak_uninit.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory - --> $DIR/weak_uninit.rs:LL:CC + --> tests/fail/weak_memory/weak_uninit.rs:LL:CC | LL | let j2 = spawn(move || x.load(Ordering::Relaxed)); | ^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory @@ -7,7 +7,7 @@ LL | let j2 = spawn(move || x.load(Ordering::Relaxed)); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE on thread `unnamed-ID`: - = note: inside closure at $DIR/weak_uninit.rs:LL:CC + = note: inside closure at tests/fail/weak_memory/weak_uninit.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/zst_local_oob.stderr b/src/tools/miri/tests/fail/zst_local_oob.stderr index 39ac2c91437c6..26911948eff71 100644 --- a/src/tools/miri/tests/fail/zst_local_oob.stderr +++ b/src/tools/miri/tests/fail/zst_local_oob.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: memory access failed: expected a pointer to 1 byte of memory, but got ALLOC which is at or beyond the end of the allocation of size 0 bytes - --> $DIR/zst_local_oob.rs:LL:CC + --> tests/fail/zst_local_oob.rs:LL:CC | LL | let _val = unsafe { *x }; | ^^ memory access failed: expected a pointer to 1 byte of memory, but got ALLOC which is at or beyond the end of the allocation of size 0 bytes @@ -7,7 +7,7 @@ LL | let _val = unsafe { *x }; = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `main` at $DIR/zst_local_oob.rs:LL:CC + = note: inside `main` at tests/fail/zst_local_oob.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/native-lib/fail/function_not_in_so.rs b/src/tools/miri/tests/native-lib/fail/function_not_in_so.rs index c532d05224537..a7df3e6118725 100644 --- a/src/tools/miri/tests/native-lib/fail/function_not_in_so.rs +++ b/src/tools/miri/tests/native-lib/fail/function_not_in_so.rs @@ -1,6 +1,5 @@ // Only works on Unix targets -//@ignore-target-windows -//@ignore-target-wasm +//@ignore-target: windows wasm //@only-on-host //@normalize-stderr-test: "OS `.*`" -> "$$OS" diff --git a/src/tools/miri/tests/native-lib/fail/function_not_in_so.stderr b/src/tools/miri/tests/native-lib/fail/function_not_in_so.stderr index e905d7d039143..bf1cfd573b8a5 100644 --- a/src/tools/miri/tests/native-lib/fail/function_not_in_so.stderr +++ b/src/tools/miri/tests/native-lib/fail/function_not_in_so.stderr @@ -1,5 +1,5 @@ error: unsupported operation: can't call foreign function `foo` on $OS - --> $DIR/function_not_in_so.rs:LL:CC + --> tests/native-lib/fail/function_not_in_so.rs:LL:CC | LL | foo(); | ^^^^^ can't call foreign function `foo` on $OS @@ -7,7 +7,7 @@ LL | foo(); = help: if this is a basic API commonly used on this target, please report an issue with Miri = help: however, note that Miri does not aim to support every FFI function out there; for instance, we will not support APIs for things such as GUIs, scripting languages, or databases = note: BACKTRACE: - = note: inside `main` at $DIR/function_not_in_so.rs:LL:CC + = note: inside `main` at tests/native-lib/fail/function_not_in_so.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/native-lib/fail/private_function.rs b/src/tools/miri/tests/native-lib/fail/private_function.rs index 3c6fda741dd70..e54880e97dabc 100644 --- a/src/tools/miri/tests/native-lib/fail/private_function.rs +++ b/src/tools/miri/tests/native-lib/fail/private_function.rs @@ -1,6 +1,5 @@ // Only works on Unix targets -//@ignore-target-windows -//@ignore-target-wasm +//@ignore-target: windows wasm //@only-on-host //@normalize-stderr-test: "OS `.*`" -> "$$OS" diff --git a/src/tools/miri/tests/native-lib/fail/private_function.stderr b/src/tools/miri/tests/native-lib/fail/private_function.stderr index e27a501ebb9d8..2cfc062212b6d 100644 --- a/src/tools/miri/tests/native-lib/fail/private_function.stderr +++ b/src/tools/miri/tests/native-lib/fail/private_function.stderr @@ -1,5 +1,5 @@ error: unsupported operation: can't call foreign function `not_exported` on $OS - --> $DIR/private_function.rs:LL:CC + --> tests/native-lib/fail/private_function.rs:LL:CC | LL | not_exported(); | ^^^^^^^^^^^^^^ can't call foreign function `not_exported` on $OS @@ -7,7 +7,7 @@ LL | not_exported(); = help: if this is a basic API commonly used on this target, please report an issue with Miri = help: however, note that Miri does not aim to support every FFI function out there; for instance, we will not support APIs for things such as GUIs, scripting languages, or databases = note: BACKTRACE: - = note: inside `main` at $DIR/private_function.rs:LL:CC + = note: inside `main` at tests/native-lib/fail/private_function.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/native-lib/pass/ptr_read_access.rs b/src/tools/miri/tests/native-lib/pass/ptr_read_access.rs index 2990dfa89756c..46eb5778b3258 100644 --- a/src/tools/miri/tests/native-lib/pass/ptr_read_access.rs +++ b/src/tools/miri/tests/native-lib/pass/ptr_read_access.rs @@ -1,6 +1,5 @@ // Only works on Unix targets -//@ignore-target-windows -//@ignore-target-wasm +//@ignore-target: windows wasm //@only-on-host fn main() { diff --git a/src/tools/miri/tests/native-lib/pass/scalar_arguments.rs b/src/tools/miri/tests/native-lib/pass/scalar_arguments.rs index 378baa7ce98de..c896bd8dd345f 100644 --- a/src/tools/miri/tests/native-lib/pass/scalar_arguments.rs +++ b/src/tools/miri/tests/native-lib/pass/scalar_arguments.rs @@ -1,6 +1,5 @@ // Only works on Unix targets -//@ignore-target-windows -//@ignore-target-wasm +//@ignore-target: windows wasm //@only-on-host extern "C" { diff --git a/src/tools/miri/tests/panic/alloc_error_handler_hook.stderr b/src/tools/miri/tests/panic/alloc_error_handler_hook.stderr index 319a10febb372..363298e49d99b 100644 --- a/src/tools/miri/tests/panic/alloc_error_handler_hook.stderr +++ b/src/tools/miri/tests/panic/alloc_error_handler_hook.stderr @@ -1,4 +1,4 @@ -thread 'main' panicked at $DIR/alloc_error_handler_hook.rs:LL:CC: +thread 'main' panicked at tests/panic/alloc_error_handler_hook.rs:LL:CC: alloc error hook called note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect diff --git a/src/tools/miri/tests/panic/div-by-zero-2.stderr b/src/tools/miri/tests/panic/div-by-zero-2.stderr index ed394f76b0e00..e47a754d38dde 100644 --- a/src/tools/miri/tests/panic/div-by-zero-2.stderr +++ b/src/tools/miri/tests/panic/div-by-zero-2.stderr @@ -1,4 +1,4 @@ -thread 'main' panicked at $DIR/div-by-zero-2.rs:LL:CC: +thread 'main' panicked at tests/panic/div-by-zero-2.rs:LL:CC: attempt to divide by zero note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect diff --git a/src/tools/miri/tests/panic/function_calls/exported_symbol_good_unwind.stderr b/src/tools/miri/tests/panic/function_calls/exported_symbol_good_unwind.stderr index 6733f2e42c1a7..ec75b6201c280 100644 --- a/src/tools/miri/tests/panic/function_calls/exported_symbol_good_unwind.stderr +++ b/src/tools/miri/tests/panic/function_calls/exported_symbol_good_unwind.stderr @@ -1,8 +1,8 @@ -thread 'main' panicked at $DIR/exported_symbol_good_unwind.rs:LL:CC: +thread 'main' panicked at tests/panic/function_calls/exported_symbol_good_unwind.rs:LL:CC: explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect -thread 'main' panicked at $DIR/exported_symbol_good_unwind.rs:LL:CC: +thread 'main' panicked at tests/panic/function_calls/exported_symbol_good_unwind.rs:LL:CC: explicit panic -thread 'main' panicked at $DIR/exported_symbol_good_unwind.rs:LL:CC: +thread 'main' panicked at tests/panic/function_calls/exported_symbol_good_unwind.rs:LL:CC: explicit panic diff --git a/src/tools/miri/tests/panic/mir-validation.rs b/src/tools/miri/tests/panic/mir-validation.rs index f1d0ccc7d0376..e4b75cccbb5c4 100644 --- a/src/tools/miri/tests/panic/mir-validation.rs +++ b/src/tools/miri/tests/panic/mir-validation.rs @@ -7,7 +7,7 @@ //@normalize-stderr-test: "DefId\([^()]*\)" -> "DefId" // Somehow on rustc Windows CI, the "Miri caused an ICE" message is not shown // and we don't even get a regular panic; rustc aborts with a different exit code instead. -//@ignore-host-windows +//@ignore-host: windows #![feature(custom_mir, core_intrinsics)] use core::intrinsics::mir::*; diff --git a/src/tools/miri/tests/panic/oob_subslice.stderr b/src/tools/miri/tests/panic/oob_subslice.stderr index 46f0f643a4728..d608cec20a487 100644 --- a/src/tools/miri/tests/panic/oob_subslice.stderr +++ b/src/tools/miri/tests/panic/oob_subslice.stderr @@ -1,4 +1,4 @@ -thread 'main' panicked at $DIR/oob_subslice.rs:LL:CC: +thread 'main' panicked at tests/panic/oob_subslice.rs:LL:CC: range end index 5 out of range for slice of length 4 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect diff --git a/src/tools/miri/tests/panic/overflowing-lsh-neg.stderr b/src/tools/miri/tests/panic/overflowing-lsh-neg.stderr index be822bd02852f..29150052b30d7 100644 --- a/src/tools/miri/tests/panic/overflowing-lsh-neg.stderr +++ b/src/tools/miri/tests/panic/overflowing-lsh-neg.stderr @@ -1,4 +1,4 @@ -thread 'main' panicked at $DIR/overflowing-lsh-neg.rs:LL:CC: +thread 'main' panicked at tests/panic/overflowing-lsh-neg.rs:LL:CC: attempt to shift left with overflow note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect diff --git a/src/tools/miri/tests/panic/overflowing-rsh-1.stderr b/src/tools/miri/tests/panic/overflowing-rsh-1.stderr index fc090aba5fdb5..9a71a797dae8b 100644 --- a/src/tools/miri/tests/panic/overflowing-rsh-1.stderr +++ b/src/tools/miri/tests/panic/overflowing-rsh-1.stderr @@ -1,4 +1,4 @@ -thread 'main' panicked at $DIR/overflowing-rsh-1.rs:LL:CC: +thread 'main' panicked at tests/panic/overflowing-rsh-1.rs:LL:CC: attempt to shift right with overflow note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect diff --git a/src/tools/miri/tests/panic/overflowing-rsh-2.stderr b/src/tools/miri/tests/panic/overflowing-rsh-2.stderr index 77160e1870f96..b671c53c611db 100644 --- a/src/tools/miri/tests/panic/overflowing-rsh-2.stderr +++ b/src/tools/miri/tests/panic/overflowing-rsh-2.stderr @@ -1,4 +1,4 @@ -thread 'main' panicked at $DIR/overflowing-rsh-2.rs:LL:CC: +thread 'main' panicked at tests/panic/overflowing-rsh-2.rs:LL:CC: attempt to shift right with overflow note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect diff --git a/src/tools/miri/tests/panic/panic1.stderr b/src/tools/miri/tests/panic/panic1.stderr index 4eb4244d7472c..7e011bfd53b14 100644 --- a/src/tools/miri/tests/panic/panic1.stderr +++ b/src/tools/miri/tests/panic/panic1.stderr @@ -1,4 +1,4 @@ -thread 'main' panicked at $DIR/panic1.rs:LL:CC: +thread 'main' panicked at tests/panic/panic1.rs:LL:CC: panicking from libstd stack backtrace: 0: std::panicking::begin_panic_handler @@ -6,7 +6,7 @@ stack backtrace: 1: std::rt::panic_fmt at RUSTLIB/core/src/panicking.rs:LL:CC 2: main - at $DIR/panic1.rs:LL:CC + at tests/panic/panic1.rs:LL:CC 3: >::call_once - shim(fn()) at RUSTLIB/core/src/ops/function.rs:LL:CC note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. diff --git a/src/tools/miri/tests/panic/panic2.stderr b/src/tools/miri/tests/panic/panic2.stderr index f7408310093d7..5640bd0b8d6a1 100644 --- a/src/tools/miri/tests/panic/panic2.stderr +++ b/src/tools/miri/tests/panic/panic2.stderr @@ -1,4 +1,4 @@ -thread 'main' panicked at $DIR/panic2.rs:LL:CC: +thread 'main' panicked at tests/panic/panic2.rs:LL:CC: 42-panicking from libstd note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect diff --git a/src/tools/miri/tests/panic/panic3.stderr b/src/tools/miri/tests/panic/panic3.stderr index 32ba400e025c3..0114320503b1d 100644 --- a/src/tools/miri/tests/panic/panic3.stderr +++ b/src/tools/miri/tests/panic/panic3.stderr @@ -1,4 +1,4 @@ -thread 'main' panicked at $DIR/panic3.rs:LL:CC: +thread 'main' panicked at tests/panic/panic3.rs:LL:CC: panicking from libcore note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect diff --git a/src/tools/miri/tests/panic/panic4.stderr b/src/tools/miri/tests/panic/panic4.stderr index a8a23ee3ce14f..f13b355ea45ab 100644 --- a/src/tools/miri/tests/panic/panic4.stderr +++ b/src/tools/miri/tests/panic/panic4.stderr @@ -1,4 +1,4 @@ -thread 'main' panicked at $DIR/panic4.rs:LL:CC: +thread 'main' panicked at tests/panic/panic4.rs:LL:CC: 42-panicking from libcore note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect diff --git a/src/tools/miri/tests/panic/transmute_fat2.stderr b/src/tools/miri/tests/panic/transmute_fat2.stderr index 021ca1c4b3298..a9bc0eb9d01c8 100644 --- a/src/tools/miri/tests/panic/transmute_fat2.stderr +++ b/src/tools/miri/tests/panic/transmute_fat2.stderr @@ -1,4 +1,4 @@ -thread 'main' panicked at $DIR/transmute_fat2.rs:LL:CC: +thread 'main' panicked at tests/panic/transmute_fat2.rs:LL:CC: index out of bounds: the len is 0 but the index is 0 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect diff --git a/src/tools/miri/tests/panic/unsupported_foreign_function.stderr b/src/tools/miri/tests/panic/unsupported_foreign_function.stderr index fcc4220bfceb8..278af9612d655 100644 --- a/src/tools/miri/tests/panic/unsupported_foreign_function.stderr +++ b/src/tools/miri/tests/panic/unsupported_foreign_function.stderr @@ -1,4 +1,4 @@ -thread 'main' panicked at $DIR/unsupported_foreign_function.rs:LL:CC: +thread 'main' panicked at tests/panic/unsupported_foreign_function.rs:LL:CC: unsupported Miri functionality: can't call foreign function `foo` on $OS note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect diff --git a/src/tools/miri/tests/panic/unsupported_syscall.rs b/src/tools/miri/tests/panic/unsupported_syscall.rs index 30f9da5f80e78..bbb076b169a6a 100644 --- a/src/tools/miri/tests/panic/unsupported_syscall.rs +++ b/src/tools/miri/tests/panic/unsupported_syscall.rs @@ -1,5 +1,5 @@ -//@ignore-target-windows: no `syscall` on Windows -//@ignore-target-apple: `syscall` is not supported on macOS +//@ignore-target: windows # no `syscall` on Windows +//@ignore-target: apple # `syscall` is not supported on macOS //@compile-flags: -Zmiri-panic-on-unsupported fn main() { diff --git a/src/tools/miri/tests/panic/unsupported_syscall.stderr b/src/tools/miri/tests/panic/unsupported_syscall.stderr index 660cfba8900f7..e9b2b5b665227 100644 --- a/src/tools/miri/tests/panic/unsupported_syscall.stderr +++ b/src/tools/miri/tests/panic/unsupported_syscall.stderr @@ -1,4 +1,4 @@ -thread 'main' panicked at $DIR/unsupported_syscall.rs:LL:CC: +thread 'main' panicked at tests/panic/unsupported_syscall.rs:LL:CC: unsupported Miri functionality: can't execute syscall with ID 0 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect diff --git a/src/tools/miri/tests/pass-dep/concurrency/apple-os-unfair-lock.rs b/src/tools/miri/tests/pass-dep/concurrency/apple-os-unfair-lock.rs index c2b9c37bbfb27..0fc432f24c8ec 100644 --- a/src/tools/miri/tests/pass-dep/concurrency/apple-os-unfair-lock.rs +++ b/src/tools/miri/tests/pass-dep/concurrency/apple-os-unfair-lock.rs @@ -1,4 +1,4 @@ -//@ only-target-darwin +//@only-target: darwin use std::cell::UnsafeCell; diff --git a/src/tools/miri/tests/pass-dep/concurrency/env-cleanup-data-race.rs b/src/tools/miri/tests/pass-dep/concurrency/env-cleanup-data-race.rs index 86a47ba365526..c9c9dc5dfd2ac 100644 --- a/src/tools/miri/tests/pass-dep/concurrency/env-cleanup-data-race.rs +++ b/src/tools/miri/tests/pass-dep/concurrency/env-cleanup-data-race.rs @@ -1,5 +1,5 @@ //@compile-flags: -Zmiri-disable-isolation -Zmiri-preemption-rate=0 -//@ignore-target-windows: No libc env support on Windows +//@ignore-target: windows # No libc env support on Windows use std::ffi::CStr; use std::thread; diff --git a/src/tools/miri/tests/pass-dep/concurrency/linux-futex.rs b/src/tools/miri/tests/pass-dep/concurrency/linux-futex.rs index 399d6df73ff12..e84ffee367f23 100644 --- a/src/tools/miri/tests/pass-dep/concurrency/linux-futex.rs +++ b/src/tools/miri/tests/pass-dep/concurrency/linux-futex.rs @@ -1,4 +1,4 @@ -//@only-target-linux +//@only-target: linux //@compile-flags: -Zmiri-disable-isolation use std::mem::MaybeUninit; diff --git a/src/tools/miri/tests/pass-dep/concurrency/tls_pthread_drop_order.rs b/src/tools/miri/tests/pass-dep/concurrency/tls_pthread_drop_order.rs index 52348aad33d72..87c8a2e1063ac 100644 --- a/src/tools/miri/tests/pass-dep/concurrency/tls_pthread_drop_order.rs +++ b/src/tools/miri/tests/pass-dep/concurrency/tls_pthread_drop_order.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No pthreads on Windows +//@ignore-target: windows # No pthreads on Windows //! Test that pthread_key destructors are run in the right order. //! Note that these are *not* used by actual `thread_local!` on Linux! Those use //! `destructors::register` from the stdlib instead. In Miri this ends up hitting diff --git a/src/tools/miri/tests/pass-dep/concurrency/windows_detach_terminated.rs b/src/tools/miri/tests/pass-dep/concurrency/windows_detach_terminated.rs index 3d4f8c5e1c063..fe2d20bb76f8e 100644 --- a/src/tools/miri/tests/pass-dep/concurrency/windows_detach_terminated.rs +++ b/src/tools/miri/tests/pass-dep/concurrency/windows_detach_terminated.rs @@ -1,4 +1,4 @@ -//@only-target-windows: Uses win32 api functions +//@only-target: windows # Uses win32 api functions // We are making scheduler assumptions here. //@compile-flags: -Zmiri-preemption-rate=0 diff --git a/src/tools/miri/tests/pass-dep/concurrency/windows_init_once.rs b/src/tools/miri/tests/pass-dep/concurrency/windows_init_once.rs index 5e33617f98ad1..afcab7a702deb 100644 --- a/src/tools/miri/tests/pass-dep/concurrency/windows_init_once.rs +++ b/src/tools/miri/tests/pass-dep/concurrency/windows_init_once.rs @@ -1,4 +1,4 @@ -//@only-target-windows: Uses win32 api functions +//@only-target: windows # Uses win32 api functions // We are making scheduler assumptions here. //@compile-flags: -Zmiri-preemption-rate=0 diff --git a/src/tools/miri/tests/pass-dep/concurrency/windows_join_multiple.rs b/src/tools/miri/tests/pass-dep/concurrency/windows_join_multiple.rs index bff59591a94ad..67e77663110e6 100644 --- a/src/tools/miri/tests/pass-dep/concurrency/windows_join_multiple.rs +++ b/src/tools/miri/tests/pass-dep/concurrency/windows_join_multiple.rs @@ -1,4 +1,4 @@ -//@only-target-windows: Uses win32 api functions +//@only-target: windows # Uses win32 api functions // We are making scheduler assumptions here. //@compile-flags: -Zmiri-preemption-rate=0 diff --git a/src/tools/miri/tests/pass-dep/extra_fn_ptr_gc.rs b/src/tools/miri/tests/pass-dep/extra_fn_ptr_gc.rs index 1198168795daf..9e5627c75a97a 100644 --- a/src/tools/miri/tests/pass-dep/extra_fn_ptr_gc.rs +++ b/src/tools/miri/tests/pass-dep/extra_fn_ptr_gc.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No `dlsym` on Windows +//@ignore-target: windows # No `dlsym` on Windows //@compile-flags: -Zmiri-permissive-provenance #[path = "../utils/mod.rs"] diff --git a/src/tools/miri/tests/pass-dep/libc/fcntl_f-fullfsync_apple.rs b/src/tools/miri/tests/pass-dep/libc/fcntl_f-fullfsync_apple.rs index 307906f2583b2..7dddfa6661388 100644 --- a/src/tools/miri/tests/pass-dep/libc/fcntl_f-fullfsync_apple.rs +++ b/src/tools/miri/tests/pass-dep/libc/fcntl_f-fullfsync_apple.rs @@ -1,4 +1,4 @@ -//@only-target-apple: F_FULLFSYNC only on apple systems +//@only-target: apple # F_FULLFSYNC only on apple systems //@compile-flags: -Zmiri-isolation-error=warn-nobacktrace use std::io::Error; diff --git a/src/tools/miri/tests/pass-dep/libc/gettid.rs b/src/tools/miri/tests/pass-dep/libc/gettid.rs index 87405b02ac35d..ca352e0109a47 100644 --- a/src/tools/miri/tests/pass-dep/libc/gettid.rs +++ b/src/tools/miri/tests/pass-dep/libc/gettid.rs @@ -1,4 +1,4 @@ -//@only-target-linux +//@only-target: linux //@revisions: with_isolation without_isolation //@[without_isolation] compile-flags: -Zmiri-disable-isolation diff --git a/src/tools/miri/tests/pass-dep/libc/libc-affinity.rs b/src/tools/miri/tests/pass-dep/libc/libc-affinity.rs index 0e482ab26010e..ff152eaea5c50 100644 --- a/src/tools/miri/tests/pass-dep/libc/libc-affinity.rs +++ b/src/tools/miri/tests/pass-dep/libc/libc-affinity.rs @@ -1,5 +1,5 @@ -//@ignore-target-windows: only very limited libc on Windows -//@ignore-target-apple: `sched_{g, s}etaffinity` are not supported on macOS +//@ignore-target: windows # only very limited libc on Windows +//@ignore-target: apple # `sched_{g, s}etaffinity` are not supported on macOS //@compile-flags: -Zmiri-disable-isolation -Zmiri-num-cpus=4 #![feature(io_error_more)] #![feature(pointer_is_aligned_to)] diff --git a/src/tools/miri/tests/pass-dep/libc/libc-epoll-blocking.rs b/src/tools/miri/tests/pass-dep/libc/libc-epoll-blocking.rs index 2a5d3dff07f91..eb38529ae57df 100644 --- a/src/tools/miri/tests/pass-dep/libc/libc-epoll-blocking.rs +++ b/src/tools/miri/tests/pass-dep/libc/libc-epoll-blocking.rs @@ -1,4 +1,4 @@ -//@only-target-linux +//@only-target: linux // test_epoll_block_then_unblock depends on a deterministic schedule. //@compile-flags: -Zmiri-preemption-rate=0 diff --git a/src/tools/miri/tests/pass-dep/libc/libc-epoll-no-blocking.rs b/src/tools/miri/tests/pass-dep/libc/libc-epoll-no-blocking.rs index 647b5e60649e8..2f65ce13d646b 100644 --- a/src/tools/miri/tests/pass-dep/libc/libc-epoll-no-blocking.rs +++ b/src/tools/miri/tests/pass-dep/libc/libc-epoll-no-blocking.rs @@ -1,4 +1,4 @@ -//@only-target-linux +//@only-target: linux #![feature(strict_provenance)] use std::convert::TryInto; @@ -23,6 +23,7 @@ fn main() { test_ready_list_fetching_logic(); test_epoll_ctl_epfd_equal_fd(); test_epoll_ctl_notification(); + test_issue_3858(); } // Using `as` cast since `EPOLLET` wraps around @@ -683,3 +684,40 @@ fn test_epoll_ctl_notification() { // for this epfd, because there is no I/O event between the two epoll_wait. check_epoll_wait::<1>(epfd0, &[]); } + +// Test for ICE caused by weak epoll interest upgrade succeed, but the attempt to retrieve +// the epoll instance based on the epoll file descriptor value failed. EpollEventInterest +// should store a WeakFileDescriptionRef instead of the file descriptor number, so if the +// epoll instance is duped, it'd still be usable after `close` is called on the original +// epoll file descriptor. +// https://github.com/rust-lang/miri/issues/3858 +fn test_issue_3858() { + // Create an eventfd instance. + let flags = libc::EFD_NONBLOCK | libc::EFD_CLOEXEC; + let fd = unsafe { libc::eventfd(0, flags) }; + + // Create an epoll instance. + let epfd = unsafe { libc::epoll_create1(0) }; + assert_ne!(epfd, -1); + + // Register eventfd with EPOLLIN | EPOLLET. + let mut ev = libc::epoll_event { + events: (libc::EPOLLIN | libc::EPOLLET) as _, + u64: u64::try_from(fd).unwrap(), + }; + let res = unsafe { libc::epoll_ctl(epfd, libc::EPOLL_CTL_ADD, fd, &mut ev) }; + assert_eq!(res, 0); + + // Dup the epoll instance. + let newfd = unsafe { libc::dup(epfd) }; + assert_ne!(newfd, -1); + + // Close the old epoll instance, so the new FD is now the only FD. + let res = unsafe { libc::close(epfd) }; + assert_eq!(res, 0); + + // Write to the eventfd instance. + let sized_8_data: [u8; 8] = 1_u64.to_ne_bytes(); + let res = unsafe { libc::write(fd, sized_8_data.as_ptr() as *const libc::c_void, 8) }; + assert_eq!(res, 8); +} diff --git a/src/tools/miri/tests/pass-dep/libc/libc-eventfd.rs b/src/tools/miri/tests/pass-dep/libc/libc-eventfd.rs index a3567eeb7cb4a..1e3d486233a73 100644 --- a/src/tools/miri/tests/pass-dep/libc/libc-eventfd.rs +++ b/src/tools/miri/tests/pass-dep/libc/libc-eventfd.rs @@ -1,4 +1,4 @@ -//@only-target-linux +//@only-target: linux // test_race depends on a deterministic schedule. //@compile-flags: -Zmiri-preemption-rate=0 diff --git a/src/tools/miri/tests/pass-dep/libc/libc-fs-flock.rs b/src/tools/miri/tests/pass-dep/libc/libc-fs-flock.rs index 3f7f9b18be931..be11f65a1e081 100644 --- a/src/tools/miri/tests/pass-dep/libc/libc-fs-flock.rs +++ b/src/tools/miri/tests/pass-dep/libc/libc-fs-flock.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: File handling is not implemented yet +//@ignore-target: windows # File handling is not implemented yet //@compile-flags: -Zmiri-disable-isolation use std::{fs::File, io::Error, os::fd::AsRawFd}; diff --git a/src/tools/miri/tests/pass-dep/libc/libc-fs-symlink.rs b/src/tools/miri/tests/pass-dep/libc/libc-fs-symlink.rs index 619c6db3a29de..a35c92636ce64 100644 --- a/src/tools/miri/tests/pass-dep/libc/libc-fs-symlink.rs +++ b/src/tools/miri/tests/pass-dep/libc/libc-fs-symlink.rs @@ -1,6 +1,6 @@ // Symlink tests are separate since they don't in general work on a Windows host. -//@ignore-host-windows: creating symlinks requires admin permissions on Windows -//@ignore-target-windows: File handling is not implemented yet +//@ignore-host: windows # creating symlinks requires admin permissions on Windows +//@ignore-target: windows # File handling is not implemented yet //@compile-flags: -Zmiri-disable-isolation use std::ffi::CString; diff --git a/src/tools/miri/tests/pass-dep/libc/libc-fs-with-isolation.rs b/src/tools/miri/tests/pass-dep/libc/libc-fs-with-isolation.rs index 088a632427e70..ab3fd6733ffe5 100644 --- a/src/tools/miri/tests/pass-dep/libc/libc-fs-with-isolation.rs +++ b/src/tools/miri/tests/pass-dep/libc/libc-fs-with-isolation.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: File handling is not implemented yet +//@ignore-target: windows # File handling is not implemented yet //@compile-flags: -Zmiri-isolation-error=warn-nobacktrace //@normalize-stderr-test: "(stat(x)?)" -> "$$STAT" diff --git a/src/tools/miri/tests/pass-dep/libc/libc-fs.rs b/src/tools/miri/tests/pass-dep/libc/libc-fs.rs index 5b2bbfbb27d08..1180961374946 100644 --- a/src/tools/miri/tests/pass-dep/libc/libc-fs.rs +++ b/src/tools/miri/tests/pass-dep/libc/libc-fs.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: File handling is not implemented yet +//@ignore-target: windows # File handling is not implemented yet //@compile-flags: -Zmiri-disable-isolation #![feature(io_error_more)] diff --git a/src/tools/miri/tests/pass-dep/libc/libc-misc.rs b/src/tools/miri/tests/pass-dep/libc/libc-misc.rs index a5b944e9d426a..f3261eaa43c92 100644 --- a/src/tools/miri/tests/pass-dep/libc/libc-misc.rs +++ b/src/tools/miri/tests/pass-dep/libc/libc-misc.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: only very limited libc on Windows +//@ignore-target: windows # only very limited libc on Windows //@compile-flags: -Zmiri-disable-isolation #![feature(io_error_more)] #![feature(pointer_is_aligned_to)] diff --git a/src/tools/miri/tests/pass-dep/libc/libc-pipe.rs b/src/tools/miri/tests/pass-dep/libc/libc-pipe.rs index 90dbd888392bf..c6e8355c3f580 100644 --- a/src/tools/miri/tests/pass-dep/libc/libc-pipe.rs +++ b/src/tools/miri/tests/pass-dep/libc/libc-pipe.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No libc pipe on Windows +//@ignore-target: windows # No libc pipe on Windows // test_race depends on a deterministic schedule. //@compile-flags: -Zmiri-preemption-rate=0 use std::thread; diff --git a/src/tools/miri/tests/pass-dep/libc/libc-random.rs b/src/tools/miri/tests/pass-dep/libc/libc-random.rs index 71e335226345e..e951603639c3f 100644 --- a/src/tools/miri/tests/pass-dep/libc/libc-random.rs +++ b/src/tools/miri/tests/pass-dep/libc/libc-random.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: no libc +//@ignore-target: windows # no libc //@revisions: isolation no_isolation //@[no_isolation]compile-flags: -Zmiri-disable-isolation diff --git a/src/tools/miri/tests/pass-dep/libc/libc-socketpair.rs b/src/tools/miri/tests/pass-dep/libc/libc-socketpair.rs index 15e040116debc..c3d6af5a1efdf 100644 --- a/src/tools/miri/tests/pass-dep/libc/libc-socketpair.rs +++ b/src/tools/miri/tests/pass-dep/libc/libc-socketpair.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No libc socketpair on Windows +//@ignore-target: windows # No libc socketpair on Windows // test_race depends on a deterministic schedule. //@compile-flags: -Zmiri-preemption-rate=0 use std::thread; diff --git a/src/tools/miri/tests/pass-dep/libc/libc-time.rs b/src/tools/miri/tests/pass-dep/libc/libc-time.rs index 5e4bb73e36883..c2c875864920a 100644 --- a/src/tools/miri/tests/pass-dep/libc/libc-time.rs +++ b/src/tools/miri/tests/pass-dep/libc/libc-time.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: no libc time APIs on Windows +//@ignore-target: windows # no libc time APIs on Windows //@compile-flags: -Zmiri-disable-isolation use std::{env, mem, ptr}; diff --git a/src/tools/miri/tests/pass-dep/concurrency/libc_pthread_cond_timedwait.rs b/src/tools/miri/tests/pass-dep/libc/libc_pthread_cond_timedwait.rs similarity index 96% rename from src/tools/miri/tests/pass-dep/concurrency/libc_pthread_cond_timedwait.rs rename to src/tools/miri/tests/pass-dep/libc/libc_pthread_cond_timedwait.rs index d758168c7c30d..997fd5cc89fd5 100644 --- a/src/tools/miri/tests/pass-dep/concurrency/libc_pthread_cond_timedwait.rs +++ b/src/tools/miri/tests/pass-dep/libc/libc_pthread_cond_timedwait.rs @@ -1,5 +1,5 @@ -//@ignore-target-windows: No pthreads on Windows -//@ignore-target-apple: pthread_condattr_setclock is not supported on MacOS. +//@ignore-target: windows # No pthreads on Windows +//@ignore-target: apple # pthread_condattr_setclock is not supported on MacOS. //@compile-flags: -Zmiri-disable-isolation /// Test that conditional variable timeouts are working properly with both diff --git a/src/tools/miri/tests/pass-dep/concurrency/libc_pthread_cond_timedwait_isolated.rs b/src/tools/miri/tests/pass-dep/libc/libc_pthread_cond_timedwait_isolated.rs similarity index 96% rename from src/tools/miri/tests/pass-dep/concurrency/libc_pthread_cond_timedwait_isolated.rs rename to src/tools/miri/tests/pass-dep/libc/libc_pthread_cond_timedwait_isolated.rs index f1a3c5dc10d07..0479d26af7250 100644 --- a/src/tools/miri/tests/pass-dep/concurrency/libc_pthread_cond_timedwait_isolated.rs +++ b/src/tools/miri/tests/pass-dep/libc/libc_pthread_cond_timedwait_isolated.rs @@ -1,5 +1,5 @@ -//@ignore-target-windows: No pthreads on Windows -//@ignore-target-apple: pthread_condattr_setclock is not supported on MacOS. +//@ignore-target: windows # No pthreads on Windows +//@ignore-target: apple # pthread_condattr_setclock is not supported on MacOS. /// Test that conditional variable timeouts are working properly /// with monotonic clocks even under isolation. diff --git a/src/tools/miri/tests/pass-dep/libc/mmap.rs b/src/tools/miri/tests/pass-dep/libc/mmap.rs index fd874dbe89e55..db305acbf4a7e 100644 --- a/src/tools/miri/tests/pass-dep/libc/mmap.rs +++ b/src/tools/miri/tests/pass-dep/libc/mmap.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No mmap on Windows +//@ignore-target: windows # No mmap on Windows //@compile-flags: -Zmiri-disable-isolation -Zmiri-permissive-provenance #![feature(strict_provenance)] diff --git a/src/tools/miri/tests/pass-dep/libc/pthread-sync.rs b/src/tools/miri/tests/pass-dep/libc/pthread-sync.rs index 142752621280a..75848bd44db70 100644 --- a/src/tools/miri/tests/pass-dep/libc/pthread-sync.rs +++ b/src/tools/miri/tests/pass-dep/libc/pthread-sync.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No pthreads on Windows +//@ignore-target: windows # No pthreads on Windows // We use `yield` to test specific interleavings, so disable automatic preemption. //@compile-flags: -Zmiri-preemption-rate=0 #![feature(sync_unsafe_cell)] diff --git a/src/tools/miri/tests/pass-dep/libc/pthread-threadname.rs b/src/tools/miri/tests/pass-dep/libc/pthread-threadname.rs index d66cd3bbb034d..a94f960f442fe 100644 --- a/src/tools/miri/tests/pass-dep/libc/pthread-threadname.rs +++ b/src/tools/miri/tests/pass-dep/libc/pthread-threadname.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: No pthreads on Windows +//@ignore-target: windows # No pthreads on Windows use std::ffi::CStr; #[cfg(not(target_os = "freebsd"))] use std::ffi::CString; @@ -10,16 +10,42 @@ fn main() { .collect::(); fn set_thread_name(name: &CStr) -> i32 { - #[cfg(any(target_os = "linux", target_os = "illumos", target_os = "solaris"))] - return unsafe { libc::pthread_setname_np(libc::pthread_self(), name.as_ptr().cast()) }; - #[cfg(target_os = "freebsd")] - unsafe { - // pthread_set_name_np does not return anything - libc::pthread_set_name_np(libc::pthread_self(), name.as_ptr().cast()); - return 0; - }; - #[cfg(target_os = "macos")] - return unsafe { libc::pthread_setname_np(name.as_ptr().cast()) }; + cfg_if::cfg_if! { + if #[cfg(any(target_os = "linux", target_os = "illumos", target_os = "solaris"))] { + unsafe { libc::pthread_setname_np(libc::pthread_self(), name.as_ptr().cast()) } + } else if #[cfg(target_os = "freebsd")] { + // pthread_set_name_np does not return anything + unsafe { libc::pthread_set_name_np(libc::pthread_self(), name.as_ptr().cast()) }; + 0 + } else if #[cfg(target_os = "macos")] { + unsafe { libc::pthread_setname_np(name.as_ptr().cast()) } + } else { + compile_error!("set_thread_name not supported for this OS") + } + } + } + + fn get_thread_name(name: &mut [u8]) -> i32 { + cfg_if::cfg_if! { + if #[cfg(any( + target_os = "linux", + target_os = "illumos", + target_os = "solaris", + target_os = "macos" + ))] { + unsafe { + libc::pthread_getname_np(libc::pthread_self(), name.as_mut_ptr().cast(), name.len()) + } + } else if #[cfg(target_os = "freebsd")] { + // pthread_get_name_np does not return anything + unsafe { + libc::pthread_get_name_np(libc::pthread_self(), name.as_mut_ptr().cast(), name.len()) + }; + 0 + } else { + compile_error!("get_thread_name not supported for this OS") + } + } } let result = thread::Builder::new().name(long_name.clone()).spawn(move || { @@ -28,14 +54,7 @@ fn main() { // But the system is limited -- make sure we successfully set a truncation. let mut buf = vec![0u8; long_name.len() + 1]; - #[cfg(not(target_os = "freebsd"))] - unsafe { - libc::pthread_getname_np(libc::pthread_self(), buf.as_mut_ptr().cast(), buf.len()) - }; - #[cfg(target_os = "freebsd")] - unsafe { - libc::pthread_get_name_np(libc::pthread_self(), buf.as_mut_ptr().cast(), buf.len()) - }; + assert_eq!(get_thread_name(&mut buf), 0); let cstr = CStr::from_bytes_until_nul(&buf).unwrap(); assert!(cstr.to_bytes().len() >= 15, "name is too short: len={}", cstr.to_bytes().len()); // POSIX seems to promise at least 15 chars assert!(long_name.as_bytes().starts_with(cstr.to_bytes())); diff --git a/src/tools/miri/tests/pass-dep/tempfile.rs b/src/tools/miri/tests/pass-dep/tempfile.rs index c4583ca3f47a4..a44a7e7d9244d 100644 --- a/src/tools/miri/tests/pass-dep/tempfile.rs +++ b/src/tools/miri/tests/pass-dep/tempfile.rs @@ -1,5 +1,5 @@ -//@ignore-target-windows: File handling is not implemented yet -//@ignore-host-windows: Only supported for UNIX hosts +//@ignore-target: windows # File handling is not implemented yet +//@ignore-host: windows # Only supported for UNIX hosts //@compile-flags: -Zmiri-disable-isolation #[path = "../utils/mod.rs"] diff --git a/src/tools/miri/tests/pass-dep/tokio/file-io.rs b/src/tools/miri/tests/pass-dep/tokio/file-io.rs index d14af299cd467..14c27285a6ae5 100644 --- a/src/tools/miri/tests/pass-dep/tokio/file-io.rs +++ b/src/tools/miri/tests/pass-dep/tokio/file-io.rs @@ -1,5 +1,5 @@ //@compile-flags: -Zmiri-disable-isolation -//@only-target-linux: We only support tokio on Linux +//@only-target: linux # We only support tokio on Linux use std::fs::remove_file; use tokio::fs::{File, OpenOptions}; diff --git a/src/tools/miri/tests/pass-dep/tokio/mpsc-await.rs b/src/tools/miri/tests/pass-dep/tokio/mpsc-await.rs index 7dea07c6e7da9..96018f34aa587 100644 --- a/src/tools/miri/tests/pass-dep/tokio/mpsc-await.rs +++ b/src/tools/miri/tests/pass-dep/tokio/mpsc-await.rs @@ -1,4 +1,4 @@ -//@only-target-linux: We only support tokio on Linux +//@only-target: linux # We only support tokio on Linux use tokio::sync::mpsc; #[tokio::main] diff --git a/src/tools/miri/tests/pass-dep/tokio/sleep.rs b/src/tools/miri/tests/pass-dep/tokio/sleep.rs index 5e63037c8a652..38f2cdde115d8 100644 --- a/src/tools/miri/tests/pass-dep/tokio/sleep.rs +++ b/src/tools/miri/tests/pass-dep/tokio/sleep.rs @@ -1,4 +1,4 @@ -//@only-target-linux: We only support tokio on Linux +//@only-target: linux # We only support tokio on Linux use tokio::time::{sleep, Duration, Instant}; diff --git a/src/tools/miri/tests/pass/alloc-access-tracking.rs b/src/tools/miri/tests/pass/alloc-access-tracking.rs index 40b8e23a33c47..50e217918b060 100644 --- a/src/tools/miri/tests/pass/alloc-access-tracking.rs +++ b/src/tools/miri/tests/pass/alloc-access-tracking.rs @@ -2,7 +2,7 @@ #![no_std] //@compile-flags: -Zmiri-track-alloc-id=21 -Zmiri-track-alloc-accesses -Cpanic=abort //@normalize-stderr-test: "id 21" -> "id $$ALLOC" -//@only-target-linux: alloc IDs differ between OSes (due to extern static allocations) +//@only-target: linux # alloc IDs differ between OSes (due to extern static allocations) extern "Rust" { fn miri_alloc(size: usize, align: usize) -> *mut u8; diff --git a/src/tools/miri/tests/pass/alloc-access-tracking.stderr b/src/tools/miri/tests/pass/alloc-access-tracking.stderr index 0af6cde833f7f..451f5de25d3b1 100644 --- a/src/tools/miri/tests/pass/alloc-access-tracking.stderr +++ b/src/tools/miri/tests/pass/alloc-access-tracking.stderr @@ -1,23 +1,23 @@ note: tracking was triggered - --> $DIR/alloc-access-tracking.rs:LL:CC + --> tests/pass/alloc-access-tracking.rs:LL:CC | LL | let ptr = miri_alloc(123, 1); | ^^^^^^^^^^^^^^^^^^ created Miri bare-metal heap allocation of 123 bytes (alignment ALIGN bytes) with id $ALLOC | = note: BACKTRACE: - = note: inside `start` at $DIR/alloc-access-tracking.rs:LL:CC + = note: inside `start` at tests/pass/alloc-access-tracking.rs:LL:CC note: tracking was triggered - --> $DIR/alloc-access-tracking.rs:LL:CC + --> tests/pass/alloc-access-tracking.rs:LL:CC | LL | *ptr = 42; // Crucially, only a write is printed here, no read! | ^^^^^^^^^ write access to allocation with id $ALLOC | = note: BACKTRACE: - = note: inside `start` at $DIR/alloc-access-tracking.rs:LL:CC + = note: inside `start` at tests/pass/alloc-access-tracking.rs:LL:CC note: tracking was triggered - --> $DIR/alloc-access-tracking.rs:LL:CC + --> tests/pass/alloc-access-tracking.rs:LL:CC | LL | assert_eq!(*ptr, 42); | ^^^^^^^^^^^^^^^^^^^^ read access to allocation with id $ALLOC @@ -27,11 +27,11 @@ LL | assert_eq!(*ptr, 42); = note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info) note: tracking was triggered - --> $DIR/alloc-access-tracking.rs:LL:CC + --> tests/pass/alloc-access-tracking.rs:LL:CC | LL | miri_dealloc(ptr, 123, 1); | ^^^^^^^^^^^^^^^^^^^^^^^^^ freed allocation with id $ALLOC | = note: BACKTRACE: - = note: inside `start` at $DIR/alloc-access-tracking.rs:LL:CC + = note: inside `start` at tests/pass/alloc-access-tracking.rs:LL:CC diff --git a/src/tools/miri/tests/pass/arrays.rs b/src/tools/miri/tests/pass/arrays.rs index b0c6f54cab87c..5cb04d0f8be19 100644 --- a/src/tools/miri/tests/pass/arrays.rs +++ b/src/tools/miri/tests/pass/arrays.rs @@ -62,7 +62,9 @@ fn debug() { } fn huge_zst() { - fn id(x: T) -> T { x } + fn id(x: T) -> T { + x + } // A "huge" zero-sized array. Make sure we don't loop over it in any part of Miri. let val = [(); usize::MAX]; diff --git a/src/tools/miri/tests/pass/async-niche-aliasing.rs b/src/tools/miri/tests/pass/async-niche-aliasing.rs index 7f19afb33e43b..ab82c929a94c2 100644 --- a/src/tools/miri/tests/pass/async-niche-aliasing.rs +++ b/src/tools/miri/tests/pass/async-niche-aliasing.rs @@ -3,10 +3,10 @@ use std::{ future::Future, + mem::MaybeUninit, pin::Pin, sync::Arc, task::{Context, Poll, Wake}, - mem::MaybeUninit, }; struct ThingAdder<'a> { diff --git a/src/tools/miri/tests/pass/backtrace/backtrace-api-v0.stderr b/src/tools/miri/tests/pass/backtrace/backtrace-api-v0.stderr index c05950ebdc746..b87063431ad88 100644 --- a/src/tools/miri/tests/pass/backtrace/backtrace-api-v0.stderr +++ b/src/tools/miri/tests/pass/backtrace/backtrace-api-v0.stderr @@ -1,8 +1,8 @@ -$DIR/backtrace-api-v0.rs:LL:CC (func_d) -$DIR/backtrace-api-v0.rs:LL:CC (func_c) -$DIR/backtrace-api-v0.rs:LL:CC (func_b) -$DIR/backtrace-api-v0.rs:LL:CC (func_a) -$DIR/backtrace-api-v0.rs:LL:CC (main) +tests/pass/backtrace/backtrace-api-v0.rs:LL:CC (func_d) +tests/pass/backtrace/backtrace-api-v0.rs:LL:CC (func_c) +tests/pass/backtrace/backtrace-api-v0.rs:LL:CC (func_b) +tests/pass/backtrace/backtrace-api-v0.rs:LL:CC (func_a) +tests/pass/backtrace/backtrace-api-v0.rs:LL:CC (main) RUSTLIB/core/src/ops/function.rs:LL:CC (>::call_once - shim(fn())) RUSTLIB/std/src/sys/backtrace.rs:LL:CC (std::sys::backtrace::__rust_begin_short_backtrace) RUSTLIB/std/src/rt.rs:LL:CC (std::rt::lang_start::{closure#0}) diff --git a/src/tools/miri/tests/pass/backtrace/backtrace-api-v0.stdout b/src/tools/miri/tests/pass/backtrace/backtrace-api-v0.stdout index e6644b4453fa5..8c1bc5c353e9f 100644 --- a/src/tools/miri/tests/pass/backtrace/backtrace-api-v0.stdout +++ b/src/tools/miri/tests/pass/backtrace/backtrace-api-v0.stdout @@ -1,5 +1,5 @@ -$DIR/backtrace-api-v0.rs:24:14 (func_d) -$DIR/backtrace-api-v0.rs:14:9 (func_c) -$DIR/backtrace-api-v0.rs:9:5 (func_b::) -$DIR/backtrace-api-v0.rs:5:5 (func_a) -$DIR/backtrace-api-v0.rs:29:18 (main) +tests/pass/backtrace/backtrace-api-v0.rs:24:14 (func_d) +tests/pass/backtrace/backtrace-api-v0.rs:14:9 (func_c) +tests/pass/backtrace/backtrace-api-v0.rs:9:5 (func_b::) +tests/pass/backtrace/backtrace-api-v0.rs:5:5 (func_a) +tests/pass/backtrace/backtrace-api-v0.rs:29:18 (main) diff --git a/src/tools/miri/tests/pass/backtrace/backtrace-api-v1.stderr b/src/tools/miri/tests/pass/backtrace/backtrace-api-v1.stderr index b56d983d42984..2c729c49ee05d 100644 --- a/src/tools/miri/tests/pass/backtrace/backtrace-api-v1.stderr +++ b/src/tools/miri/tests/pass/backtrace/backtrace-api-v1.stderr @@ -1,8 +1,8 @@ -$DIR/backtrace-api-v1.rs:LL:CC (func_d) -$DIR/backtrace-api-v1.rs:LL:CC (func_c) -$DIR/backtrace-api-v1.rs:LL:CC (func_b) -$DIR/backtrace-api-v1.rs:LL:CC (func_a) -$DIR/backtrace-api-v1.rs:LL:CC (main) +tests/pass/backtrace/backtrace-api-v1.rs:LL:CC (func_d) +tests/pass/backtrace/backtrace-api-v1.rs:LL:CC (func_c) +tests/pass/backtrace/backtrace-api-v1.rs:LL:CC (func_b) +tests/pass/backtrace/backtrace-api-v1.rs:LL:CC (func_a) +tests/pass/backtrace/backtrace-api-v1.rs:LL:CC (main) RUSTLIB/core/src/ops/function.rs:LL:CC (>::call_once - shim(fn())) RUSTLIB/std/src/sys/backtrace.rs:LL:CC (std::sys::backtrace::__rust_begin_short_backtrace) RUSTLIB/std/src/rt.rs:LL:CC (std::rt::lang_start::{closure#0}) diff --git a/src/tools/miri/tests/pass/backtrace/backtrace-api-v1.stdout b/src/tools/miri/tests/pass/backtrace/backtrace-api-v1.stdout index 11efd2f0752d9..5c2995e132aa6 100644 --- a/src/tools/miri/tests/pass/backtrace/backtrace-api-v1.stdout +++ b/src/tools/miri/tests/pass/backtrace/backtrace-api-v1.stdout @@ -1,5 +1,5 @@ -$DIR/backtrace-api-v1.rs:27:9 (func_d) -$DIR/backtrace-api-v1.rs:14:9 (func_c) -$DIR/backtrace-api-v1.rs:9:5 (func_b::) -$DIR/backtrace-api-v1.rs:5:5 (func_a) -$DIR/backtrace-api-v1.rs:34:18 (main) +tests/pass/backtrace/backtrace-api-v1.rs:27:9 (func_d) +tests/pass/backtrace/backtrace-api-v1.rs:14:9 (func_c) +tests/pass/backtrace/backtrace-api-v1.rs:9:5 (func_b::) +tests/pass/backtrace/backtrace-api-v1.rs:5:5 (func_a) +tests/pass/backtrace/backtrace-api-v1.rs:34:18 (main) diff --git a/src/tools/miri/tests/pass/backtrace/backtrace-global-alloc.stderr b/src/tools/miri/tests/pass/backtrace/backtrace-global-alloc.stderr index b06dd1da3c645..d9414aa651835 100644 --- a/src/tools/miri/tests/pass/backtrace/backtrace-global-alloc.stderr +++ b/src/tools/miri/tests/pass/backtrace/backtrace-global-alloc.stderr @@ -1,5 +1,5 @@ 0: main - at $DIR/backtrace-global-alloc.rs:LL:CC + at tests/pass/backtrace/backtrace-global-alloc.rs:LL:CC 1: >::call_once - shim(fn()) at RUSTLIB/core/src/ops/function.rs:LL:CC 2: std::sys::backtrace::__rust_begin_short_backtrace diff --git a/src/tools/miri/tests/pass/backtrace/backtrace-std.stderr b/src/tools/miri/tests/pass/backtrace/backtrace-std.stderr index 84bdda59fce9a..d6d69ee837ede 100644 --- a/src/tools/miri/tests/pass/backtrace/backtrace-std.stderr +++ b/src/tools/miri/tests/pass/backtrace/backtrace-std.stderr @@ -1,13 +1,13 @@ 0: func_d - at $DIR/backtrace-std.rs:LL:CC + at tests/pass/backtrace/backtrace-std.rs:LL:CC 1: func_c - at $DIR/backtrace-std.rs:LL:CC + at tests/pass/backtrace/backtrace-std.rs:LL:CC 2: func_b - at $DIR/backtrace-std.rs:LL:CC + at tests/pass/backtrace/backtrace-std.rs:LL:CC 3: func_a - at $DIR/backtrace-std.rs:LL:CC + at tests/pass/backtrace/backtrace-std.rs:LL:CC 4: main - at $DIR/backtrace-std.rs:LL:CC + at tests/pass/backtrace/backtrace-std.rs:LL:CC 5: >::call_once - shim(fn()) at RUSTLIB/core/src/ops/function.rs:LL:CC 6: std::sys::backtrace::__rust_begin_short_backtrace diff --git a/src/tools/miri/tests/pass/concurrency/thread_park_isolated.rs b/src/tools/miri/tests/pass/concurrency/thread_park_isolated.rs index 7852d495e28fa..35145fe9bd31a 100644 --- a/src/tools/miri/tests/pass/concurrency/thread_park_isolated.rs +++ b/src/tools/miri/tests/pass/concurrency/thread_park_isolated.rs @@ -1,4 +1,4 @@ -//@ignore-target-apple: park_timeout on macOS uses the system clock +//@ignore-target: apple # park_timeout on macOS uses the system clock use std::thread; use std::time::{Duration, Instant}; diff --git a/src/tools/miri/tests/pass/extern_types.stack.stderr b/src/tools/miri/tests/pass/extern_types.stack.stderr index 2c9fc0192af83..898c19d514b5b 100644 --- a/src/tools/miri/tests/pass/extern_types.stack.stderr +++ b/src/tools/miri/tests/pass/extern_types.stack.stderr @@ -1,5 +1,5 @@ warning: reborrow of reference to `extern type` - --> $DIR/extern_types.rs:LL:CC + --> tests/pass/extern_types.rs:LL:CC | LL | let x: &Foo = unsafe { &*(ptr::without_provenance::<()>(16) as *const Foo) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ reborrow of a reference to `extern type` is not properly supported @@ -7,5 +7,5 @@ LL | let x: &Foo = unsafe { &*(ptr::without_provenance::<()>(16) as *const F = help: `extern type` are not compatible with the Stacked Borrows aliasing model implemented by Miri; Miri may miss bugs in this code = help: try running with `MIRIFLAGS=-Zmiri-tree-borrows` to use the more permissive but also even more experimental Tree Borrows aliasing checks instead = note: BACKTRACE: - = note: inside `main` at $DIR/extern_types.rs:LL:CC + = note: inside `main` at tests/pass/extern_types.rs:LL:CC diff --git a/src/tools/miri/tests/pass/function_calls/target_feature.rs b/src/tools/miri/tests/pass/function_calls/target_feature.rs index 0be86ba373165..43df761bd0bb0 100644 --- a/src/tools/miri/tests/pass/function_calls/target_feature.rs +++ b/src/tools/miri/tests/pass/function_calls/target_feature.rs @@ -1,4 +1,4 @@ -//@only-target-x86_64: uses x86 target features +//@only-target: x86_64 # uses x86 target features //@compile-flags: -C target-feature=+ssse3 fn main() { diff --git a/src/tools/miri/tests/pass/issues/issue-miri-3680.rs b/src/tools/miri/tests/pass/issues/issue-miri-3680.rs index 55b896c91adb7..c8e2498fa5ace 100644 --- a/src/tools/miri/tests/pass/issues/issue-miri-3680.rs +++ b/src/tools/miri/tests/pass/issues/issue-miri-3680.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: File handling is not implemented yet +//@ignore-target: windows # File handling is not implemented yet //@compile-flags: -Zmiri-disable-isolation use std::fs::remove_file; diff --git a/src/tools/miri/tests/pass/miri-alloc.rs b/src/tools/miri/tests/pass/miri-alloc.rs index 8f1724754181f..17f6d5d05a529 100644 --- a/src/tools/miri/tests/pass/miri-alloc.rs +++ b/src/tools/miri/tests/pass/miri-alloc.rs @@ -4,7 +4,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-target-windows: no-std not supported on Windows +//@ignore-target: windows # no-std not supported on Windows extern "Rust" { fn miri_alloc(size: usize, align: usize) -> *mut u8; diff --git a/src/tools/miri/tests/pass/panic/catch_panic.stderr b/src/tools/miri/tests/pass/panic/catch_panic.stderr index f61b39493ed17..cb74312a83ae5 100644 --- a/src/tools/miri/tests/pass/panic/catch_panic.stderr +++ b/src/tools/miri/tests/pass/panic/catch_panic.stderr @@ -1,36 +1,36 @@ -thread 'main' panicked at $DIR/catch_panic.rs:LL:CC: +thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC: Hello from std::panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect Caught panic message (&str): Hello from std::panic -thread 'main' panicked at $DIR/catch_panic.rs:LL:CC: +thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC: Hello from std::panic: 1 Caught panic message (String): Hello from std::panic: 1 -thread 'main' panicked at $DIR/catch_panic.rs:LL:CC: +thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC: Hello from std::panic_any: 2 Caught panic message (String): Hello from std::panic_any: 2 -thread 'main' panicked at $DIR/catch_panic.rs:LL:CC: +thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC: Box Failed to get caught panic message. -thread 'main' panicked at $DIR/catch_panic.rs:LL:CC: +thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC: Hello from core::panic Caught panic message (&str): Hello from core::panic -thread 'main' panicked at $DIR/catch_panic.rs:LL:CC: +thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC: Hello from core::panic: 5 Caught panic message (String): Hello from core::panic: 5 -thread 'main' panicked at $DIR/catch_panic.rs:LL:CC: +thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC: index out of bounds: the len is 3 but the index is 4 Caught panic message (String): index out of bounds: the len is 3 but the index is 4 -thread 'main' panicked at $DIR/catch_panic.rs:LL:CC: +thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC: attempt to divide by zero Caught panic message (&str): attempt to divide by zero thread 'main' panicked at RUSTLIB/core/src/ptr/const_ptr.rs:LL:CC: align_offset: align is not a power-of-two Caught panic message (&str): align_offset: align is not a power-of-two -thread 'main' panicked at $DIR/catch_panic.rs:LL:CC: +thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC: assertion failed: false Caught panic message (&str): assertion failed: false -thread 'main' panicked at $DIR/catch_panic.rs:LL:CC: +thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC: assertion failed: false Caught panic message (&str): assertion failed: false Success! diff --git a/src/tools/miri/tests/pass/panic/concurrent-panic.stderr b/src/tools/miri/tests/pass/panic/concurrent-panic.stderr index fe0d16ca78ac0..9c87489e8db37 100644 --- a/src/tools/miri/tests/pass/panic/concurrent-panic.stderr +++ b/src/tools/miri/tests/pass/panic/concurrent-panic.stderr @@ -1,13 +1,13 @@ Thread 1 starting, will block on mutex Thread 1 reported it has started -thread '' panicked at $DIR/concurrent-panic.rs:LL:CC: +thread '' panicked at tests/pass/panic/concurrent-panic.rs:LL:CC: panic in thread 2 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect Thread 2 blocking on thread 1 Thread 2 reported it has started Unlocking mutex -thread '' panicked at $DIR/concurrent-panic.rs:LL:CC: +thread '' panicked at tests/pass/panic/concurrent-panic.rs:LL:CC: panic in thread 1 Thread 1 has exited Thread 2 has exited diff --git a/src/tools/miri/tests/pass/panic/nested_panic_caught.stderr b/src/tools/miri/tests/pass/panic/nested_panic_caught.stderr index a346d31f645eb..e066f7dfce167 100644 --- a/src/tools/miri/tests/pass/panic/nested_panic_caught.stderr +++ b/src/tools/miri/tests/pass/panic/nested_panic_caught.stderr @@ -1,7 +1,7 @@ -thread 'main' panicked at $DIR/nested_panic_caught.rs:LL:CC: +thread 'main' panicked at tests/pass/panic/nested_panic_caught.rs:LL:CC: once note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect -thread 'main' panicked at $DIR/nested_panic_caught.rs:LL:CC: +thread 'main' panicked at tests/pass/panic/nested_panic_caught.rs:LL:CC: twice stack backtrace: diff --git a/src/tools/miri/tests/pass/panic/thread_panic.stderr b/src/tools/miri/tests/pass/panic/thread_panic.stderr index 0fde5922c192d..9464e76b6c9c0 100644 --- a/src/tools/miri/tests/pass/panic/thread_panic.stderr +++ b/src/tools/miri/tests/pass/panic/thread_panic.stderr @@ -1,6 +1,6 @@ -thread '' panicked at $DIR/thread_panic.rs:LL:CC: +thread '' panicked at tests/pass/panic/thread_panic.rs:LL:CC: Hello! note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect -thread 'childthread' panicked at $DIR/thread_panic.rs:LL:CC: +thread 'childthread' panicked at tests/pass/panic/thread_panic.rs:LL:CC: Hello, world! diff --git a/src/tools/miri/tests/pass/panic/unwind_dwarf.rs b/src/tools/miri/tests/pass/panic/unwind_dwarf.rs index f690be471ba70..ca90e4f4d94f7 100644 --- a/src/tools/miri/tests/pass/panic/unwind_dwarf.rs +++ b/src/tools/miri/tests/pass/panic/unwind_dwarf.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: Windows uses a different unwinding mechanism +//@ignore-target: windows # Windows uses a different unwinding mechanism #![feature(core_intrinsics, panic_unwind, rustc_attrs)] #![allow(internal_features)] diff --git a/src/tools/miri/tests/pass/ptr_int_casts.tree.stderr b/src/tools/miri/tests/pass/ptr_int_casts.tree.stderr index a34474ee0d627..21c5b2b0dfe8f 100644 --- a/src/tools/miri/tests/pass/ptr_int_casts.tree.stderr +++ b/src/tools/miri/tests/pass/ptr_int_casts.tree.stderr @@ -1,5 +1,5 @@ warning: integer-to-pointer cast - --> $DIR/ptr_int_casts.rs:LL:CC + --> tests/pass/ptr_int_casts.rs:LL:CC | LL | assert_eq!(1 as *const i32 as usize, 1); | ^^^^^^^^^^^^^^^ integer-to-pointer cast @@ -10,79 +10,79 @@ LL | assert_eq!(1 as *const i32 as usize, 1); = help: you can then set `MIRIFLAGS=-Zmiri-strict-provenance` to ensure you are not relying on `with_exposed_provenance` semantics = help: Tree Borrows does not support integer-to-pointer casts, so the program is likely to go wrong when this pointer gets used = note: BACKTRACE: - = note: inside `ptr_int_casts` at $DIR/ptr_int_casts.rs:LL:CC + = note: inside `ptr_int_casts` at tests/pass/ptr_int_casts.rs:LL:CC note: inside `main` - --> $DIR/ptr_int_casts.rs:LL:CC + --> tests/pass/ptr_int_casts.rs:LL:CC | LL | ptr_int_casts(); | ^^^^^^^^^^^^^^^ warning: integer-to-pointer cast - --> $DIR/ptr_int_casts.rs:LL:CC + --> tests/pass/ptr_int_casts.rs:LL:CC | LL | assert_eq!((1 as *const i32).wrapping_offset(4) as usize, 1 + 4 * 4); | ^^^^^^^^^^^^^^^^^ integer-to-pointer cast | = note: BACKTRACE: - = note: inside `ptr_int_casts` at $DIR/ptr_int_casts.rs:LL:CC + = note: inside `ptr_int_casts` at tests/pass/ptr_int_casts.rs:LL:CC note: inside `main` - --> $DIR/ptr_int_casts.rs:LL:CC + --> tests/pass/ptr_int_casts.rs:LL:CC | LL | ptr_int_casts(); | ^^^^^^^^^^^^^^^ warning: integer-to-pointer cast - --> $DIR/ptr_int_casts.rs:LL:CC + --> tests/pass/ptr_int_casts.rs:LL:CC | LL | *val = (1 as *const u8).wrapping_offset(-4); | ^^^^^^^^^^^^^^^^ integer-to-pointer cast | = note: BACKTRACE: - = note: inside `ptr_int_casts` at $DIR/ptr_int_casts.rs:LL:CC + = note: inside `ptr_int_casts` at tests/pass/ptr_int_casts.rs:LL:CC note: inside `main` - --> $DIR/ptr_int_casts.rs:LL:CC + --> tests/pass/ptr_int_casts.rs:LL:CC | LL | ptr_int_casts(); | ^^^^^^^^^^^^^^^ warning: integer-to-pointer cast - --> $DIR/ptr_int_casts.rs:LL:CC + --> tests/pass/ptr_int_casts.rs:LL:CC | LL | let y = y as *const _; | ^^^^^^^^^^^^^ integer-to-pointer cast | = note: BACKTRACE: - = note: inside `ptr_int_casts` at $DIR/ptr_int_casts.rs:LL:CC + = note: inside `ptr_int_casts` at tests/pass/ptr_int_casts.rs:LL:CC note: inside `main` - --> $DIR/ptr_int_casts.rs:LL:CC + --> tests/pass/ptr_int_casts.rs:LL:CC | LL | ptr_int_casts(); | ^^^^^^^^^^^^^^^ warning: integer-to-pointer cast - --> $DIR/ptr_int_casts.rs:LL:CC + --> tests/pass/ptr_int_casts.rs:LL:CC | LL | let x: fn() -> i32 = unsafe { mem::transmute(y as *mut u8) }; | ^^^^^^^^^^^^ integer-to-pointer cast | = note: BACKTRACE: - = note: inside `ptr_int_casts` at $DIR/ptr_int_casts.rs:LL:CC + = note: inside `ptr_int_casts` at tests/pass/ptr_int_casts.rs:LL:CC note: inside `main` - --> $DIR/ptr_int_casts.rs:LL:CC + --> tests/pass/ptr_int_casts.rs:LL:CC | LL | ptr_int_casts(); | ^^^^^^^^^^^^^^^ warning: integer-to-pointer cast - --> $DIR/ptr_int_casts.rs:LL:CC + --> tests/pass/ptr_int_casts.rs:LL:CC | LL | assert_eq!((-1i32) as usize as *const i32 as usize, (-1i32) as usize); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ integer-to-pointer cast | = note: BACKTRACE: - = note: inside `ptr_int_casts` at $DIR/ptr_int_casts.rs:LL:CC + = note: inside `ptr_int_casts` at tests/pass/ptr_int_casts.rs:LL:CC note: inside `main` - --> $DIR/ptr_int_casts.rs:LL:CC + --> tests/pass/ptr_int_casts.rs:LL:CC | LL | ptr_int_casts(); | ^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/pass/ptr_int_from_exposed.tree.stderr b/src/tools/miri/tests/pass/ptr_int_from_exposed.tree.stderr index 614b0d26a6304..aac6d0f48d015 100644 --- a/src/tools/miri/tests/pass/ptr_int_from_exposed.tree.stderr +++ b/src/tools/miri/tests/pass/ptr_int_from_exposed.tree.stderr @@ -1,5 +1,5 @@ warning: integer-to-pointer cast - --> $DIR/ptr_int_from_exposed.rs:LL:CC + --> tests/pass/ptr_int_from_exposed.rs:LL:CC | LL | let ptr = ptr::with_exposed_provenance::(x_usize).wrapping_offset(-128); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ integer-to-pointer cast @@ -10,9 +10,9 @@ LL | let ptr = ptr::with_exposed_provenance::(x_usize).wrapping_offset( = help: you can then set `MIRIFLAGS=-Zmiri-strict-provenance` to ensure you are not relying on `with_exposed_provenance` semantics = help: Tree Borrows does not support integer-to-pointer casts, so the program is likely to go wrong when this pointer gets used = note: BACKTRACE: - = note: inside `ptr_roundtrip_out_of_bounds` at $DIR/ptr_int_from_exposed.rs:LL:CC + = note: inside `ptr_roundtrip_out_of_bounds` at tests/pass/ptr_int_from_exposed.rs:LL:CC note: inside `main` - --> $DIR/ptr_int_from_exposed.rs:LL:CC + --> tests/pass/ptr_int_from_exposed.rs:LL:CC | LL | ptr_roundtrip_out_of_bounds(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/miri/tests/pass/shims/fs-symlink.rs b/src/tools/miri/tests/pass/shims/fs-symlink.rs index 4d5103b24c32d..01bb713926c65 100644 --- a/src/tools/miri/tests/pass/shims/fs-symlink.rs +++ b/src/tools/miri/tests/pass/shims/fs-symlink.rs @@ -1,6 +1,6 @@ // Symlink tests are separate since they don't in general work on a Windows host. -//@ignore-host-windows: creating symlinks requires admin permissions on Windows -//@ignore-target-windows: File handling is not implemented yet +//@ignore-host: windows # creating symlinks requires admin permissions on Windows +//@ignore-target: windows # File handling is not implemented yet //@compile-flags: -Zmiri-disable-isolation use std::fs::{read_link, remove_file, File}; diff --git a/src/tools/miri/tests/pass/shims/fs-with-isolation.rs b/src/tools/miri/tests/pass/shims/fs-with-isolation.rs index 8fa683085b98b..c42f97458c4b5 100644 --- a/src/tools/miri/tests/pass/shims/fs-with-isolation.rs +++ b/src/tools/miri/tests/pass/shims/fs-with-isolation.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: File handling is not implemented yet +//@ignore-target: windows # File handling is not implemented yet //@compile-flags: -Zmiri-isolation-error=warn-nobacktrace //@normalize-stderr-test: "(stat(x)?)" -> "$$STAT" diff --git a/src/tools/miri/tests/pass/shims/fs.rs b/src/tools/miri/tests/pass/shims/fs.rs index 70e375b098128..761164a4ba375 100644 --- a/src/tools/miri/tests/pass/shims/fs.rs +++ b/src/tools/miri/tests/pass/shims/fs.rs @@ -1,4 +1,4 @@ -//@ignore-target-windows: File handling is not implemented yet +//@ignore-target: windows # File handling is not implemented yet //@compile-flags: -Zmiri-disable-isolation #![feature(io_error_more)] diff --git a/src/tools/miri/tests/pass/shims/time-with-isolation.rs b/src/tools/miri/tests/pass/shims/time-with-isolation.rs index 645d42ad975da..e7b1624412358 100644 --- a/src/tools/miri/tests/pass/shims/time-with-isolation.rs +++ b/src/tools/miri/tests/pass/shims/time-with-isolation.rs @@ -41,9 +41,9 @@ fn test_block_for_one_second() { /// Ensures that we get the same behavior across all targets. fn test_deterministic() { let begin = Instant::now(); - for _ in 0..100_000 {} + for _ in 0..10_000 {} let time = begin.elapsed(); - println!("The loop took around {}s", time.as_secs()); + println!("The loop took around {}ms", time.as_millis()); println!("(It's fine for this number to change when you `--bless` this test.)") } diff --git a/src/tools/miri/tests/pass/shims/time-with-isolation.stdout b/src/tools/miri/tests/pass/shims/time-with-isolation.stdout index ff5889bacd5d1..2d7fb5f4a6144 100644 --- a/src/tools/miri/tests/pass/shims/time-with-isolation.stdout +++ b/src/tools/miri/tests/pass/shims/time-with-isolation.stdout @@ -1,2 +1,2 @@ -The loop took around 12s +The loop took around 1250ms (It's fine for this number to change when you `--bless` this test.) diff --git a/src/tools/miri/tests/pass/shims/windows-rand.rs b/src/tools/miri/tests/pass/shims/windows-rand.rs index cfbc1d278a932..1947e6d13569b 100644 --- a/src/tools/miri/tests/pass/shims/windows-rand.rs +++ b/src/tools/miri/tests/pass/shims/windows-rand.rs @@ -1,4 +1,4 @@ -//@only-target-windows: this directly tests windows-only functions +//@only-target: windows # this directly tests windows-only functions use core::ffi::c_void; use core::mem::size_of_val; use core::ptr::null_mut; diff --git a/src/tools/miri/tests/pass/shims/windows-threadname.rs b/src/tools/miri/tests/pass/shims/windows-threadname.rs index c863ac670b6d5..29c3fa5d5f3aa 100644 --- a/src/tools/miri/tests/pass/shims/windows-threadname.rs +++ b/src/tools/miri/tests/pass/shims/windows-threadname.rs @@ -1,4 +1,4 @@ -//@only-target-windows: this directly tests windows-only functions +//@only-target: windows # this directly tests windows-only functions use std::ffi::OsStr; use std::os::windows::ffi::OsStrExt; diff --git a/src/tools/miri/tests/pass/shims/x86/intrinsics-sha.rs b/src/tools/miri/tests/pass/shims/x86/intrinsics-sha.rs index 79ac4432dffac..4e892e6e3cb38 100644 --- a/src/tools/miri/tests/pass/shims/x86/intrinsics-sha.rs +++ b/src/tools/miri/tests/pass/shims/x86/intrinsics-sha.rs @@ -1,12 +1,5 @@ -// Ignore everything except x86 and x86_64 -// Any new targets that are added to CI should be ignored here. -// (We cannot use `cfg`-based tricks here since the `target-feature` flags below only work on x86.) -//@ignore-target-aarch64 -//@ignore-target-arm -//@ignore-target-avr -//@ignore-target-s390x -//@ignore-target-thumbv7em -//@ignore-target-wasm +// We're testing x86 target specific features +//@only-target: x86_64 i686 //@compile-flags: -C target-feature=+sha,+sse2,+ssse3,+sse4.1 #[cfg(target_arch = "x86")] diff --git a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-adx.rs b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-adx.rs index 0fd4b7c091097..baa984e68d83b 100644 --- a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-adx.rs +++ b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-adx.rs @@ -1,12 +1,5 @@ -// Ignore everything except x86 and x86_64 -// Any new targets that are added to CI should be ignored here. -// (We cannot use `cfg`-based tricks here since the `target-feature` flags below only work on x86.) -//@ignore-target-aarch64 -//@ignore-target-arm -//@ignore-target-avr -//@ignore-target-s390x -//@ignore-target-thumbv7em -//@ignore-target-wasm +// We're testing x86 target specific features +//@only-target: x86_64 i686 //@compile-flags: -C target-feature=+adx #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] diff --git a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-aes-vaes.rs b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-aes-vaes.rs index d4d1b6180a7b3..47f086f7340d7 100644 --- a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-aes-vaes.rs +++ b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-aes-vaes.rs @@ -1,12 +1,5 @@ -// Ignore everything except x86 and x86_64 -// Any new targets that are added to CI should be ignored here. -// (We cannot use `cfg`-based tricks here since the `target-feature` flags below only work on x86.) -//@ignore-target-aarch64 -//@ignore-target-arm -//@ignore-target-avr -//@ignore-target-s390x -//@ignore-target-thumbv7em -//@ignore-target-wasm +// We're testing x86 target specific features +//@only-target: x86_64 i686 //@compile-flags: -C target-feature=+aes,+vaes,+avx512f #![feature(avx512_target_feature, stdarch_x86_avx512)] diff --git a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-avx.rs b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-avx.rs index 3847a80be9053..b3c2434c0d288 100644 --- a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-avx.rs +++ b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-avx.rs @@ -1,12 +1,5 @@ -// Ignore everything except x86 and x86_64 -// Any new targets that are added to CI should be ignored here. -// (We cannot use `cfg`-based tricks here since the `target-feature` flags below only work on x86.) -//@ignore-target-aarch64 -//@ignore-target-arm -//@ignore-target-avr -//@ignore-target-s390x -//@ignore-target-thumbv7em -//@ignore-target-wasm +// We're testing x86 target specific features +//@only-target: x86_64 i686 //@compile-flags: -C target-feature=+avx #[cfg(target_arch = "x86")] diff --git a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-avx2.rs b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-avx2.rs index 8b8d8880e3bed..de1abc818420c 100644 --- a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-avx2.rs +++ b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-avx2.rs @@ -1,12 +1,5 @@ -// Ignore everything except x86 and x86_64 -// Any new targets that are added to CI should be ignored here. -// (We cannot use `cfg`-based tricks here since the `target-feature` flags below only work on x86.) -//@ignore-target-aarch64 -//@ignore-target-arm -//@ignore-target-avr -//@ignore-target-s390x -//@ignore-target-thumbv7em -//@ignore-target-wasm +// We're testing x86 target specific features +//@only-target: x86_64 i686 //@compile-flags: -C target-feature=+avx2 #[cfg(target_arch = "x86")] diff --git a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-avx512.rs b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-avx512.rs index a40eddde97c15..db59306389016 100644 --- a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-avx512.rs +++ b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-avx512.rs @@ -1,12 +1,5 @@ -// Ignore everything except x86 and x86_64 -// Any new targets that are added to CI should be ignored here. -// (We cannot use `cfg`-based tricks here since the `target-feature` flags below only work on x86.) -//@ignore-target-aarch64 -//@ignore-target-arm -//@ignore-target-avr -//@ignore-target-s390x -//@ignore-target-thumbv7em -//@ignore-target-wasm +// We're testing x86 target specific features +//@only-target: x86_64 i686 //@compile-flags: -C target-feature=+avx512f,+avx512vl,+avx512bitalg,+avx512vpopcntdq #![feature(avx512_target_feature)] diff --git a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-bmi.rs b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-bmi.rs index 02f57f4b451e1..030258f21fa51 100644 --- a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-bmi.rs +++ b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-bmi.rs @@ -1,12 +1,5 @@ -// Ignore everything except x86 and x86_64 -// Any new targets that are added to CI should be ignored here. -// (We cannot use `cfg`-based tricks here since the `target-feature` flags below only work on x86.) -//@ignore-target-aarch64 -//@ignore-target-arm -//@ignore-target-avr -//@ignore-target-s390x -//@ignore-target-thumbv7em -//@ignore-target-wasm +// We're testing x86 target specific features +//@only-target: x86_64 i686 //@compile-flags: -C target-feature=+bmi1,+bmi2 #[cfg(target_arch = "x86")] diff --git a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-pause-without-sse2.rs b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-pause-without-sse2.rs index 60da88df046ef..4d5ddd75f385a 100644 --- a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-pause-without-sse2.rs +++ b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-pause-without-sse2.rs @@ -1,12 +1,5 @@ -// Ignore everything except x86 and x86_64 -// Any new targets that are added to CI should be ignored here. -// (We cannot use `cfg`-based tricks here since the `target-feature` flags below only work on x86.) -//@ignore-target-aarch64 -//@ignore-target-arm -//@ignore-target-avr -//@ignore-target-s390x -//@ignore-target-thumbv7em -//@ignore-target-wasm +// We're testing x86 target specific features +//@only-target: x86_64 i686 //@compile-flags: -C target-feature=-sse2 #[cfg(target_arch = "x86")] diff --git a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-pclmulqdq.rs b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-pclmulqdq.rs index 86ac5835a168b..6051987f8d4c1 100644 --- a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-pclmulqdq.rs +++ b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-pclmulqdq.rs @@ -1,12 +1,5 @@ -// Ignore everything except x86 and x86_64 -// Any new targets that are added to CI should be ignored here. -// (We cannot use `cfg`-based tricks here since the `target-feature` flags below only work on x86.) -//@ignore-target-aarch64 -//@ignore-target-arm -//@ignore-target-avr -//@ignore-target-s390x -//@ignore-target-thumbv7em -//@ignore-target-wasm +// We're testing x86 target specific features +//@only-target: x86_64 i686 //@compile-flags: -C target-feature=+pclmulqdq #[cfg(target_arch = "x86")] diff --git a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-sse3-ssse3.rs b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-sse3-ssse3.rs index 0b3be7f3cbd00..10842160abdc6 100644 --- a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-sse3-ssse3.rs +++ b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-sse3-ssse3.rs @@ -1,12 +1,5 @@ -// Ignore everything except x86 and x86_64 -// Any new targets that are added to CI should be ignored here. -// (We cannot use `cfg`-based tricks here since the `target-feature` flags below only work on x86.) -//@ignore-target-aarch64 -//@ignore-target-arm -//@ignore-target-avr -//@ignore-target-s390x -//@ignore-target-thumbv7em -//@ignore-target-wasm +// We're testing x86 target specific features +//@only-target: x86_64 i686 // SSSE3 implicitly enables SSE3 //@compile-flags: -C target-feature=+ssse3 diff --git a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-sse41.rs b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-sse41.rs index 8cd4e6308e29f..7331c6ed0db33 100644 --- a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-sse41.rs +++ b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-sse41.rs @@ -1,12 +1,5 @@ -// Ignore everything except x86 and x86_64 -// Any new targets that are added to CI should be ignored here. -// (We cannot use `cfg`-based tricks here since the `target-feature` flags below only work on x86.) -//@ignore-target-aarch64 -//@ignore-target-arm -//@ignore-target-avr -//@ignore-target-s390x -//@ignore-target-thumbv7em -//@ignore-target-wasm +// We're testing x86 target specific features +//@only-target: x86_64 i686 //@compile-flags: -C target-feature=+sse4.1 #[cfg(target_arch = "x86")] diff --git a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-sse42.rs b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-sse42.rs index c87eb51877431..30908baa6c15e 100644 --- a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-sse42.rs +++ b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-sse42.rs @@ -1,12 +1,5 @@ -// Ignore everything except x86 and x86_64 -// Any new targets that are added to CI should be ignored here. -// (We cannot use `cfg`-based tricks here since the `target-feature` flags below only work on x86.) -//@ignore-target-aarch64 -//@ignore-target-arm -//@ignore-target-avr -//@ignore-target-s390x -//@ignore-target-thumbv7em -//@ignore-target-wasm +// We're testing x86 target specific features +//@only-target: x86_64 i686 //@compile-flags: -C target-feature=+sse4.2 #[cfg(target_arch = "x86")] diff --git a/src/tools/miri/tests/pass/stacked-borrows/issue-miri-2389.stderr b/src/tools/miri/tests/pass/stacked-borrows/issue-miri-2389.stderr index 216bb6c76bc9a..bcb7a65e90f05 100644 --- a/src/tools/miri/tests/pass/stacked-borrows/issue-miri-2389.stderr +++ b/src/tools/miri/tests/pass/stacked-borrows/issue-miri-2389.stderr @@ -1,5 +1,5 @@ warning: integer-to-pointer cast - --> $DIR/issue-miri-2389.rs:LL:CC + --> tests/pass/stacked-borrows/issue-miri-2389.rs:LL:CC | LL | let wildcard = &root0 as *const Cell as usize as *const Cell; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ integer-to-pointer cast @@ -10,5 +10,5 @@ LL | let wildcard = &root0 as *const Cell as usize as *const Cell PathBuf { PathBuf::from(env::var("MIRI").unwrap_or_else(|_| env!("CARGO_BIN_EXE_miri").into())) @@ -77,32 +89,53 @@ fn miri_config(target: &str, path: &str, mode: Mode, with_dependencies: bool) -> let mut config = Config { target: Some(target.to_owned()), - stderr_filters: stderr_filters().into(), - stdout_filters: stdout_filters().into(), - mode, program, out_dir: PathBuf::from(std::env::var_os("CARGO_TARGET_DIR").unwrap()).join("miri_ui"), - edition: Some("2021".into()), // keep in sync with `./miri run` threads: std::env::var("MIRI_TEST_THREADS") .ok() .map(|threads| NonZero::new(threads.parse().unwrap()).unwrap()), ..Config::rustc(path) }; + config.comment_defaults.base().exit_status = match mode { + Mode::Pass => Some(0), + Mode::Fail => Some(1), + Mode::RunDep => None, + Mode::Panic => Some(101), + } + .map(Spanned::dummy) + .into(); + + config.comment_defaults.base().require_annotations = + Spanned::dummy(matches!(mode, Mode::Fail)).into(); + + config.comment_defaults.base().normalize_stderr = + stderr_filters().iter().map(|(m, p)| (m.clone(), p.to_vec())).collect(); + config.comment_defaults.base().normalize_stdout = + stdout_filters().iter().map(|(m, p)| (m.clone(), p.to_vec())).collect(); + + // keep in sync with `./miri run` + config.comment_defaults.base().add_custom("edition", Edition("2021".into())); + if with_dependencies { - // Set the `cargo-miri` binary, which we expect to be in the same folder as the `miri` binary. - // (It's a separate crate, so we don't get an env var from cargo.) - config.dependency_builder.program = { - let mut prog = miri_path(); - prog.set_file_name(format!("cargo-miri{}", env::consts::EXE_SUFFIX)); - prog - }; - let builder_args = ["miri", "run"]; // There is no `cargo miri build` so we just use `cargo miri run`. - config.dependency_builder.args = builder_args.into_iter().map(Into::into).collect(); - config.dependencies_crate_manifest_path = - Some(Path::new("test_dependencies").join("Cargo.toml")); - // Reset `RUSTFLAGS` to work around . - config.dependency_builder.envs.push(("RUSTFLAGS".into(), None)); + config.comment_defaults.base().set_custom( + "dependencies", + DependencyBuilder { + program: CommandBuilder { + // Set the `cargo-miri` binary, which we expect to be in the same folder as the `miri` binary. + // (It's a separate crate, so we don't get an env var from cargo.) + program: miri_path() + .with_file_name(format!("cargo-miri{}", env::consts::EXE_SUFFIX)), + // There is no `cargo miri build` so we just use `cargo miri run`. + args: ["miri", "run"].into_iter().map(Into::into).collect(), + // Reset `RUSTFLAGS` to work around . + envs: vec![("RUSTFLAGS".into(), None)], + ..CommandBuilder::cargo() + }, + crate_manifest_path: Path::new("test_dependencies").join("Cargo.toml"), + build_std: None, + }, + ); } config } @@ -140,8 +173,6 @@ fn run_tests( } } config.program.args.push("-Zui-testing".into()); - config.program.args.push("--target".into()); - config.program.args.push(target.into()); // If we're testing the native-lib functionality, then build the shared object file for testing // external C function calls and push the relevant compiler flag. @@ -153,14 +184,13 @@ fn run_tests( } // Handle command-line arguments. - let args = ui_test::Args::test()?; - let default_bless = env::var_os("RUSTC_BLESS").is_some_and(|v| v != "0"); - config.with_args(&args, default_bless); - if let OutputConflictHandling::Error(msg) = &mut config.output_conflict_handling { - *msg = "./miri test --bless".into(); - } + let mut args = ui_test::Args::test()?; + args.bless |= env::var_os("RUSTC_BLESS").is_some_and(|v| v != "0"); + config.with_args(&args); + config.bless_command = Some("./miri test --bless".into()); + if env::var_os("MIRI_SKIP_UI_CHECKS").is_some() { - assert!(!default_bless, "cannot use RUSTC_BLESS and MIRI_SKIP_UI_CHECKS at the same time"); + assert!(!args.bless, "cannot use RUSTC_BLESS and MIRI_SKIP_UI_CHECKS at the same time"); config.output_conflict_handling = OutputConflictHandling::Ignore; } eprintln!(" Compiler: {}", config.program.display()); @@ -171,7 +201,7 @@ fn run_tests( // The files we're actually interested in (all `.rs` files). ui_test::default_file_filter, // This could be used to overwrite the `Config` on a per-test basis. - |_, _, _| {}, + |_, _| {}, ( match args.format { Format::Terse => status_emitter::Text::quiet(), @@ -287,50 +317,29 @@ fn main() -> Result<()> { ui(Mode::Pass, "tests/pass", &target, WithoutDependencies, tmpdir.path())?; ui(Mode::Pass, "tests/pass-dep", &target, WithDependencies, tmpdir.path())?; ui(Mode::Panic, "tests/panic", &target, WithDependencies, tmpdir.path())?; - ui( - Mode::Fail { require_patterns: true, rustfix: RustfixMode::Disabled }, - "tests/fail", - &target, - WithoutDependencies, - tmpdir.path(), - )?; - ui( - Mode::Fail { require_patterns: true, rustfix: RustfixMode::Disabled }, - "tests/fail-dep", - &target, - WithDependencies, - tmpdir.path(), - )?; + ui(Mode::Fail, "tests/fail", &target, WithoutDependencies, tmpdir.path())?; + ui(Mode::Fail, "tests/fail-dep", &target, WithDependencies, tmpdir.path())?; if cfg!(unix) { ui(Mode::Pass, "tests/native-lib/pass", &target, WithoutDependencies, tmpdir.path())?; - ui( - Mode::Fail { require_patterns: true, rustfix: RustfixMode::Disabled }, - "tests/native-lib/fail", - &target, - WithoutDependencies, - tmpdir.path(), - )?; + ui(Mode::Fail, "tests/native-lib/fail", &target, WithoutDependencies, tmpdir.path())?; } Ok(()) } -fn run_dep_mode(target: String, mut args: impl Iterator) -> Result<()> { - let path = args.next().expect("./miri run-dep must be followed by a file name"); - let mut config = miri_config( - &target, - "", - Mode::Yolo { rustfix: RustfixMode::Disabled }, - /* with dependencies */ true, - ); - config.program.args.clear(); // remove the `--error-format` that ui_test adds by default - let dep_args = config.build_dependencies()?; +fn run_dep_mode(target: String, args: impl Iterator) -> Result<()> { + let mut config = miri_config(&target, "", Mode::RunDep, /* with dependencies */ true); + config.comment_defaults.base().custom.remove("edition"); // `./miri` adds an `--edition` in `args`, so don't set it twice + config.fill_host_and_target()?; + config.program.args = args.collect(); - let mut cmd = config.program.build(&config.out_dir); - cmd.args(dep_args); + let test_config = TestConfig::one_off_runner(config.clone(), PathBuf::new()); - cmd.arg(path); + let build_manager = BuildManager::one_off(config); + let mut cmd = test_config.config.program.build(&test_config.config.out_dir); + cmd.arg("--target").arg(test_config.config.target.as_ref().unwrap()); + // Build dependencies + test_config.apply_custom(&mut cmd, &build_manager).unwrap(); - cmd.args(args); if cmd.spawn()?.wait()?.success() { Ok(()) } else { std::process::exit(1) } } diff --git a/src/tools/miri/triagebot.toml b/src/tools/miri/triagebot.toml index addb36418d4b4..2d93777f61d3d 100644 --- a/src/tools/miri/triagebot.toml +++ b/src/tools/miri/triagebot.toml @@ -17,3 +17,15 @@ contributing_url = "https://github.com/rust-lang/miri/blob/master/CONTRIBUTING.m [no-merges] exclude_titles = ["Rustup"] + +[review-submitted] +# This label is added when a "request changes" review is submitted. +reviewed_label = "S-waiting-on-author" +# These labels are removed when a "request changes" review is submitted. +review_labels = ["S-waiting-on-review"] + +[review-requested] +# Those labels are removed when PR author requests a review from an assignee +remove_labels = ["S-waiting-on-author"] +# Those labels are added when PR author requests a review from an assignee +add_labels = ["S-waiting-on-review"] diff --git a/tests/ui-fulldeps/fluent-messages/many-lines.ftl b/tests/ui-fulldeps/fluent-messages/many-lines.ftl new file mode 100644 index 0000000000000..43660ebeacdc5 --- /dev/null +++ b/tests/ui-fulldeps/fluent-messages/many-lines.ftl @@ -0,0 +1,11 @@ +no_crate_foo = foo + +# This file tests error reporting for +# fluent files with many lines. +# The error message should point to the correct line number +# and include no more context than necessary. + +no_crate_bar = + +no_crate_baz = + baz diff --git a/tests/ui-fulldeps/fluent-messages/test.rs b/tests/ui-fulldeps/fluent-messages/test.rs index 7bf1252ccf602..3361ebcef018d 100644 --- a/tests/ui-fulldeps/fluent-messages/test.rs +++ b/tests/ui-fulldeps/fluent-messages/test.rs @@ -80,3 +80,8 @@ mod bad_escape { //~| ERROR invalid escape `\"` //~| ERROR invalid escape `\'` } + +mod many_lines { + rustc_fluent_macro::fluent_messages! { "./many-lines.ftl" } + //~^ ERROR could not parse Fluent resource +} diff --git a/tests/ui-fulldeps/fluent-messages/test.stderr b/tests/ui-fulldeps/fluent-messages/test.stderr index 09d4a38473204..0b3bb14ce513b 100644 --- a/tests/ui-fulldeps/fluent-messages/test.stderr +++ b/tests/ui-fulldeps/fluent-messages/test.stderr @@ -103,5 +103,20 @@ LL | rustc_fluent_macro::fluent_messages! { "./invalid-escape.ftl" } | = note: Fluent does not interpret these escape sequences () -error: aborting due to 13 previous errors +error: could not parse Fluent resource + --> $DIR/test.rs:85:44 + | +LL | rustc_fluent_macro::fluent_messages! { "./many-lines.ftl" } + | ^^^^^^^^^^^^^^^^^^ + | + = help: see additional errors emitted + +error: expected a message field for "no_crate_bar" + --> ./many-lines.ftl:8:1 + | +8 | no_crate_bar = + | ^^^^^^^^^^^^^^ + | + +error: aborting due to 14 previous errors