From 13e36cf8870a88ab0ac5651d9513b13085baa8cc Mon Sep 17 00:00:00 2001 From: Matthew Giordano Date: Tue, 27 Aug 2024 18:06:00 -0700 Subject: [PATCH 01/49] add new_cyclic_in for rc --- library/alloc/src/rc.rs | 60 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/library/alloc/src/rc.rs b/library/alloc/src/rc.rs index f153aa6d3be..151eec53261 100644 --- a/library/alloc/src/rc.rs +++ b/library/alloc/src/rc.rs @@ -687,6 +687,54 @@ pub fn new_in(value: T, alloc: A) -> Rc { } } + /// TODO: document + #[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_ptr: NonNull<_> = Box::leak( + Box::new_in(RcBox { + strong: Cell::new(0), + weak: Cell::new(1), + value: mem::MaybeUninit::::uninit(), + }), + alloc, + ) + .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 + } + /// Constructs a new `Rc` with uninitialized contents in the provided allocator. /// /// # Examples @@ -1662,7 +1710,11 @@ fn is_unique(this: &Self) -> bool { #[inline] #[stable(feature = "rc_unique", since = "1.4.0")] pub fn get_mut(this: &mut Self) -> Option<&mut T> { - if Rc::is_unique(this) { unsafe { Some(Rc::get_mut_unchecked(this)) } } else { None } + if Rc::is_unique(this) { + unsafe { Some(Rc::get_mut_unchecked(this)) } + } else { + None + } } /// Returns a mutable reference into the given `Rc`, @@ -3239,7 +3291,11 @@ pub fn upgrade(&self) -> Option> #[must_use] #[stable(feature = "weak_counts", since = "1.41.0")] pub fn strong_count(&self) -> usize { - if let Some(inner) = self.inner() { inner.strong() } else { 0 } + if let Some(inner) = self.inner() { + inner.strong() + } else { + 0 + } } /// Gets the number of `Weak` pointers pointing to this allocation. From 21cb84763cf942dc2fa70d582cf2b8ba50163750 Mon Sep 17 00:00:00 2001 From: Matthew Giordano Date: Thu, 29 Aug 2024 12:32:33 -0700 Subject: [PATCH 02/49] fix fmt --- library/alloc/src/rc.rs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/library/alloc/src/rc.rs b/library/alloc/src/rc.rs index 151eec53261..0afb138db8a 100644 --- a/library/alloc/src/rc.rs +++ b/library/alloc/src/rc.rs @@ -1710,11 +1710,7 @@ fn is_unique(this: &Self) -> bool { #[inline] #[stable(feature = "rc_unique", since = "1.4.0")] pub fn get_mut(this: &mut Self) -> Option<&mut T> { - if Rc::is_unique(this) { - unsafe { Some(Rc::get_mut_unchecked(this)) } - } else { - None - } + if Rc::is_unique(this) { unsafe { Some(Rc::get_mut_unchecked(this)) } } else { None } } /// Returns a mutable reference into the given `Rc`, @@ -3291,11 +3287,7 @@ pub fn upgrade(&self) -> Option> #[must_use] #[stable(feature = "weak_counts", since = "1.41.0")] pub fn strong_count(&self) -> usize { - if let Some(inner) = self.inner() { - inner.strong() - } else { - 0 - } + if let Some(inner) = self.inner() { inner.strong() } else { 0 } } /// Gets the number of `Weak` pointers pointing to this allocation. From 4abb8e2d0d1821a98e77109dae4001a613229074 Mon Sep 17 00:00:00 2001 From: Matthew Giordano Date: Thu, 29 Aug 2024 13:26:39 -0700 Subject: [PATCH 03/49] fix new_cyclic_in for rc --- library/alloc/src/rc.rs | 127 +++++++++++++++++++++++++--------------- 1 file changed, 79 insertions(+), 48 deletions(-) diff --git a/library/alloc/src/rc.rs b/library/alloc/src/rc.rs index 0afb138db8a..726c0f2de9f 100644 --- a/library/alloc/src/rc.rs +++ b/library/alloc/src/rc.rs @@ -687,54 +687,6 @@ pub fn new_in(value: T, alloc: A) -> Rc { } } - /// TODO: document - #[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_ptr: NonNull<_> = Box::leak( - Box::new_in(RcBox { - strong: Cell::new(0), - weak: Cell::new(1), - value: mem::MaybeUninit::::uninit(), - }), - alloc, - ) - .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 - } - /// Constructs a new `Rc` with uninitialized contents in the provided allocator. /// /// # Examples @@ -2312,6 +2264,85 @@ fn clone(&self) -> Self { } } +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` 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` + /// 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, + { + // Note: comments and implementation are copied from Rc::new_cyclic. + + // Construct the inner in the "uninitialized" state with a single + // weak reference. + let uninit_ptr: NonNull<_> = Box::leak(Box::new_in( + RcBox { + strong: Cell::new(0), + weak: Cell::new(1), + value: mem::MaybeUninit::::uninit(), + }, + alloc.clone(), + )) + .into(); + + let init_ptr: NonNull> = uninit_ptr.cast(); + + let weak = Weak { ptr: init_ptr, alloc: alloc.clone() }; + + // 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_in(init_ptr, alloc) + }; + + // Strong references should collectively own a shared weak reference, + // so don't run the destructor for our old weak reference. + mem::forget(weak); + strong + } +} + #[cfg(not(no_global_oom_handling))] #[stable(feature = "rust1", since = "1.0.0")] impl Default for Rc { From 2383cc991020b9dd678074072fcd3ed4f459eb6c Mon Sep 17 00:00:00 2001 From: Matthew Giordano Date: Thu, 29 Aug 2024 13:41:37 -0700 Subject: [PATCH 04/49] improve comments --- library/alloc/src/rc.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/alloc/src/rc.rs b/library/alloc/src/rc.rs index 726c0f2de9f..f6d4174f5eb 100644 --- a/library/alloc/src/rc.rs +++ b/library/alloc/src/rc.rs @@ -2279,7 +2279,7 @@ impl Rc { /// 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` + /// 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. /// @@ -2289,6 +2289,7 @@ impl Rc { /// temporary [`Weak`] is dropped normally. /// /// # Examples + /// /// See [`new_cyclic`]. /// /// [`new_cyclic`]: Rc::new_cyclic From 68169d3103dca63330b7e3e0e03f41b43b3b0490 Mon Sep 17 00:00:00 2001 From: Matthew Giordano Date: Thu, 29 Aug 2024 13:41:57 -0700 Subject: [PATCH 05/49] add new_cyclic_in for Arc --- library/alloc/src/sync.rs | 93 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs index 4a3522f1a64..f808f331329 100644 --- a/library/alloc/src/sync.rs +++ b/library/alloc/src/sync.rs @@ -1322,6 +1322,99 @@ pub unsafe fn assume_init(self) -> Arc<[T], A> { } } +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` 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] + #[stable(feature = "arc_new_cyclic", since = "1.60.0")] + pub fn new_cyclic_in(data_fn: F, alloc: A) -> Arc + where + F: FnOnce(&Weak) -> T, + { + // Note: these comments and much of the implementation is copied from Arc::new_cyclic. + + // Construct the inner in the "uninitialized" state with a single + // weak reference. + let uninit_ptr: NonNull<_> = Box::leak(Box::new_in( + ArcInner { + strong: atomic::AtomicUsize::new(0), + weak: atomic::AtomicUsize::new(1), + data: mem::MaybeUninit::::uninit(), + }, + alloc.clone(), + )) + .into(); + let init_ptr: NonNull> = uninit_ptr.cast(); + + let weak = Weak { ptr: init_ptr, alloc: alloc.clone() }; + + // 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_in(init_ptr, alloc) + }; + + // Strong references should collectively own a shared weak reference, + // so don't run the destructor for our old weak reference. + mem::forget(weak); + strong + } +} + impl Arc { /// Constructs an `Arc` from a raw pointer. /// From 97df334d5fd97725ffc2836c80a9bfae501085d1 Mon Sep 17 00:00:00 2001 From: Matthew Giordano Date: Fri, 6 Sep 2024 14:24:25 -0700 Subject: [PATCH 06/49] remove the Clone requirement --- library/alloc/src/rc.rs | 158 ++++++++++++++++---------------- library/alloc/src/sync.rs | 185 +++++++++++++++++++------------------- 2 files changed, 170 insertions(+), 173 deletions(-) diff --git a/library/alloc/src/rc.rs b/library/alloc/src/rc.rs index f6d4174f5eb..664bc5ffc34 100644 --- a/library/alloc/src/rc.rs +++ b/library/alloc/src/rc.rs @@ -766,6 +766,84 @@ pub fn new_zeroed_in(alloc: A) -> Rc, A> { } } + /// 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, + { + // Note: comments and implementation are copied from Rc::new_cyclic. + + // 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. + 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 /// @@ -2264,86 +2342,6 @@ fn clone(&self) -> Self { } } -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` 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, - { - // Note: comments and implementation are copied from Rc::new_cyclic. - - // Construct the inner in the "uninitialized" state with a single - // weak reference. - let uninit_ptr: NonNull<_> = Box::leak(Box::new_in( - RcBox { - strong: Cell::new(0), - weak: Cell::new(1), - value: mem::MaybeUninit::::uninit(), - }, - alloc.clone(), - )) - .into(); - - let init_ptr: NonNull> = uninit_ptr.cast(); - - let weak = Weak { ptr: init_ptr, alloc: alloc.clone() }; - - // 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_in(init_ptr, alloc) - }; - - // Strong references should collectively own a shared weak reference, - // so don't run the destructor for our old weak reference. - mem::forget(weak); - strong - } -} - #[cfg(not(no_global_oom_handling))] #[stable(feature = "rust1", since = "1.0.0")] impl Default for Rc { diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs index f808f331329..4f8039fd1f8 100644 --- a/library/alloc/src/sync.rs +++ b/library/alloc/src/sync.rs @@ -785,6 +785,98 @@ pub fn new_zeroed_in(alloc: A) -> Arc, A> { } } + /// 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] + #[stable(feature = "arc_new_cyclic", since = "1.60.0")] + pub fn new_cyclic_in(data_fn: F, alloc: A) -> Arc + where + F: FnOnce(&Weak) -> T, + { + // Note: these comments and much of the implementation is copied from Arc::new_cyclic. + + // 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. + 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))] @@ -1322,99 +1414,6 @@ pub unsafe fn assume_init(self) -> Arc<[T], A> { } } -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` 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] - #[stable(feature = "arc_new_cyclic", since = "1.60.0")] - pub fn new_cyclic_in(data_fn: F, alloc: A) -> Arc - where - F: FnOnce(&Weak) -> T, - { - // Note: these comments and much of the implementation is copied from Arc::new_cyclic. - - // Construct the inner in the "uninitialized" state with a single - // weak reference. - let uninit_ptr: NonNull<_> = Box::leak(Box::new_in( - ArcInner { - strong: atomic::AtomicUsize::new(0), - weak: atomic::AtomicUsize::new(1), - data: mem::MaybeUninit::::uninit(), - }, - alloc.clone(), - )) - .into(); - let init_ptr: NonNull> = uninit_ptr.cast(); - - let weak = Weak { ptr: init_ptr, alloc: alloc.clone() }; - - // 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_in(init_ptr, alloc) - }; - - // Strong references should collectively own a shared weak reference, - // so don't run the destructor for our old weak reference. - mem::forget(weak); - strong - } -} - impl Arc { /// Constructs an `Arc` from a raw pointer. /// From 550e55fec5cf3a11cf5b7372fda45465e4e6b4d0 Mon Sep 17 00:00:00 2001 From: Matthew Giordano Date: Fri, 6 Sep 2024 15:20:41 -0700 Subject: [PATCH 07/49] Remove duplicate impl --- library/alloc/src/rc.rs | 41 +++--------------------------- library/alloc/src/sync.rs | 53 +++------------------------------------ 2 files changed, 6 insertions(+), 88 deletions(-) diff --git a/library/alloc/src/rc.rs b/library/alloc/src/rc.rs index 664bc5ffc34..719f154141b 100644 --- a/library/alloc/src/rc.rs +++ b/library/alloc/src/rc.rs @@ -460,42 +460,7 @@ pub fn new_cyclic(data_fn: F) -> 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. @@ -801,8 +766,6 @@ pub fn new_cyclic_in(data_fn: F, alloc: A) -> Rc where F: FnOnce(&Weak) -> T, { - // Note: comments and implementation are copied from Rc::new_cyclic. - // 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( @@ -836,6 +799,8 @@ pub fn new_cyclic_in(data_fn: F, alloc: A) -> Rc // 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) diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs index 4f8039fd1f8..496865e303b 100644 --- a/library/alloc/src/sync.rs +++ b/library/alloc/src/sync.rs @@ -450,54 +450,7 @@ pub fn new_cyclic(data_fn: F) -> 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. @@ -821,8 +774,6 @@ pub fn new_cyclic_in(data_fn: F, alloc: A) -> Arc where F: FnOnce(&Weak) -> T, { - // Note: these comments and much of the implementation is copied from Arc::new_cyclic. - // 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( @@ -869,6 +820,8 @@ pub fn new_cyclic_in(data_fn: F, alloc: A) -> Arc // 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) From 4db9c01f8b1e7cfc82a5bcd522d72f9e6a84fdf1 Mon Sep 17 00:00:00 2001 From: DeSevilla Date: Sat, 7 Sep 2024 13:36:09 -0400 Subject: [PATCH 08/49] Renamed variable and fixed comments referring to renamed FileDescriptor --- src/tools/miri/src/shims/unix/fd.rs | 14 +++++++------- src/tools/miri/src/shims/unix/fs.rs | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/tools/miri/src/shims/unix/fd.rs b/src/tools/miri/src/shims/unix/fd.rs index 3ca5f6bb2df..d756c06ebdb 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 FileDescriptionRef do not have any tags. } } @@ -411,7 +411,7 @@ fn dup2(&mut self, old_fd: i32, new_fd: i32) -> InterpResult<'tcx, Scalar> { fn flock(&mut self, fd: 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_ref) = this.machine.fds.get(fd) else { return Ok(Scalar::from_i32(this.fd_not_found()?)); }; @@ -436,8 +436,8 @@ fn flock(&mut self, fd: i32, op: i32) -> InterpResult<'tcx, Scalar> { throw_unsup_format!("unsupported flags {:#x}", op); }; - let result = file_descriptor.flock(this.machine.communicate(), parsed_op)?; - drop(file_descriptor); + let result = fd_ref.flock(this.machine.communicate(), parsed_op)?; + drop(fd_ref); // return `0` if flock is successful let result = result.map(|()| 0i32); Ok(Scalar::from_i32(this.try_unwrap_io_result(result)?)) @@ -539,7 +539,7 @@ fn read( ) -> 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); @@ -604,7 +604,7 @@ fn write( ) -> 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)?; diff --git a/src/tools/miri/src/shims/unix/fs.rs b/src/tools/miri/src/shims/unix/fs.rs index e00758bb98d..58d3a73b481 100644 --- a/src/tools/miri/src/shims/unix/fs.rs +++ b/src/tools/miri/src/shims/unix/fs.rs @@ -557,7 +557,7 @@ fn open(&mut self, args: &[OpTy<'tcx>]) -> InterpResult<'tcx, Scalar> { fn lseek64(&mut self, fd: 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 { From ff28977c065762160d35ca81dc85a199ac7d460d Mon Sep 17 00:00:00 2001 From: Konstantinos Andrikopoulos Date: Mon, 9 Sep 2024 02:32:19 +0200 Subject: [PATCH 09/49] detect when pthread_rwlock_t is moved For some implementations of pthreads, the address of pthread_rwlock_t (or its fields) is used to identify the lock. That means that if the contents of a pthread_rwlock_t are moved in memory, effectively a new lock object is created, which is completely independted from the original. Thus we want to detect when when such objects are moved and show an error. --- src/tools/miri/src/concurrency/sync.rs | 25 ++++++++++++++++++- src/tools/miri/src/lib.rs | 4 +-- src/tools/miri/src/shims/unix/sync.rs | 15 +++++++++-- .../concurrency/libx_pthread_rwlock_moved.rs | 14 +++++++++++ .../libx_pthread_rwlock_moved.stderr | 15 +++++++++++ 5 files changed, 68 insertions(+), 5 deletions(-) create mode 100644 src/tools/miri/tests/fail-dep/concurrency/libx_pthread_rwlock_moved.rs create mode 100644 src/tools/miri/tests/fail-dep/concurrency/libx_pthread_rwlock_moved.stderr diff --git a/src/tools/miri/src/concurrency/sync.rs b/src/tools/miri/src/concurrency/sync.rs index 97e910df6a2..a6a2a03b1b0 100644 --- a/src/tools/miri/src/concurrency/sync.rs +++ b/src/tools/miri/src/concurrency/sync.rs @@ -105,6 +105,13 @@ struct Mutex { declare_id!(RwLockId); +#[derive(Debug)] +/// Additional data that may be used by shim implementations. +pub struct AdditionalRwLockData { + /// The address of the rwlock. + pub address: u64, +} + /// The read-write lock state. #[derive(Default, Debug)] struct RwLock { @@ -137,6 +144,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); @@ -343,6 +353,10 @@ fn rwlock_get_or_create_id( lock_op: &OpTy<'tcx>, lock_layout: TyAndLayout<'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( @@ -350,11 +364,20 @@ fn rwlock_get_or_create_id( lock_layout, 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>(&'a mut self, id: RwLockId) -> Option<&'a AdditionalRwLockData> + where + 'tcx: 'a, + { + let this = self.eval_context_ref(); + this.machine.sync.rwlocks[id].data.as_ref() + } + fn condvar_get_or_create_id( &mut self, lock_op: &OpTy<'tcx>, diff --git a/src/tools/miri/src/lib.rs b/src/tools/miri/src/lib.rs index 85b4b02ff5f..273b1107ed0 100644 --- a/src/tools/miri/src/lib.rs +++ b/src/tools/miri/src/lib.rs @@ -134,8 +134,8 @@ data_race::{AtomicFenceOrd, AtomicReadOrd, AtomicRwOrd, AtomicWriteOrd, EvalContextExt as _}, init_once::{EvalContextExt as _, InitOnceId}, sync::{ - AdditionalMutexData, CondvarId, EvalContextExt as _, MutexId, MutexKind, RwLockId, - SynchronizationObjects, + AdditionalMutexData, AdditionalRwLockData, CondvarId, EvalContextExt as _, MutexId, + MutexKind, RwLockId, SynchronizationObjects, }, thread::{ BlockReason, EvalContextExt as _, StackEmptyCallback, ThreadId, ThreadManager, diff --git a/src/tools/miri/src/shims/unix/sync.rs b/src/tools/miri/src/shims/unix/sync.rs index 57cc9cf4618..9d664985fd4 100644 --- a/src/tools/miri/src/shims/unix/sync.rs +++ b/src/tools/miri/src/shims/unix/sync.rs @@ -213,11 +213,22 @@ fn rwlock_get_id<'tcx>( ecx: &mut MiriInterpCx<'tcx>, rwlock_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, RwLockId> { - ecx.rwlock_get_or_create_id( + let address = ecx.read_pointer(rwlock_op)?.addr().bytes(); + + let id = ecx.rwlock_get_or_create_id( rwlock_op, ecx.libc_ty_layout("pthread_rwlock_t"), rwlock_id_offset(ecx)?, - ) + |_| Ok(Some(AdditionalRwLockData { address })), + )?; + + // Check that the rwlock has not been moved since last use. + let data = ecx.rwlock_get_data(id).expect("data should be 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. 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 00000000000..b51bae79849 --- /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 00000000000..8a5ec4aa98d --- /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 + --> $DIR/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 $DIR/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 + From 1185eb081aae651fc6324630ed01203f92100d02 Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Mon, 9 Sep 2024 06:49:03 -0700 Subject: [PATCH 10/49] ci: bump actions/checkout to v4 --- src/tools/miri/.github/workflows/sysroots.yml | 2 +- src/tools/miri/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/miri/.github/workflows/sysroots.yml b/src/tools/miri/.github/workflows/sysroots.yml index 73a10768db9..6a4f44ddd50 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/README.md b/src/tools/miri/README.md index dbb0e8a2925..72555e8c40d 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 From d4eeb31c2eb4bee9f2e5791d01c8d55048b46a31 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 9 Sep 2024 16:01:47 +0200 Subject: [PATCH 11/49] use fd_num for file descriptors, so we can use fd for file description --- src/tools/miri/src/shims/unix/fd.rs | 85 ++++++++++---------- src/tools/miri/src/shims/unix/fs.rs | 78 ++++++++---------- src/tools/miri/src/shims/unix/linux/epoll.rs | 12 +-- 3 files changed, 83 insertions(+), 92 deletions(-) diff --git a/src/tools/miri/src/shims/unix/fd.rs b/src/tools/miri/src/shims/unix/fd.rs index d756c06ebdb..48bf959538b 100644 --- a/src/tools/miri/src/shims/unix/fd.rs +++ b/src/tools/miri/src/shims/unix/fd.rs @@ -303,7 +303,7 @@ pub struct FdTable { impl VisitProvenance for FdTable { fn visit_provenance(&self, _visit: &mut VisitWith<'_>) { - // All our FileDescriptionRef do not have any tags. + // All our FileDescription instances do not have any tags. } } @@ -337,18 +337,18 @@ pub fn insert_new(&mut self, fd: impl FileDescription) -> i32 { } 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 @@ fn insert_ref_with_min_fd(&mut self, file_handle: FileDescriptionRef, min_fd: i3 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(fd_ref) = 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 @@ fn flock(&mut self, fd: i32, op: i32) -> InterpResult<'tcx, Scalar> { throw_unsup_format!("unsupported flags {:#x}", op); }; - let result = fd_ref.flock(this.machine.communicate(), parsed_op)?; - drop(fd_ref); + 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 @@ fn fcntl(&mut self, args: &[OpTy<'tcx>]) -> InterpResult<'tcx, Scalar> { 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 @@ fn fcntl(&mut self, args: &[OpTy<'tcx>]) -> InterpResult<'tcx, Scalar> { // `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 @@ fn fcntl(&mut self, args: &[OpTy<'tcx>]) -> InterpResult<'tcx, Scalar> { } 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 @@ fn fcntl(&mut self, args: &[OpTy<'tcx>]) -> InterpResult<'tcx, Scalar> { 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 @@ fn fcntl(&mut self, args: &[OpTy<'tcx>]) -> InterpResult<'tcx, Scalar> { 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,7 +531,7 @@ fn fd_not_found>(&mut self) -> InterpResult<'tcx, T> { /// and keeps the cursor unchanged. fn read( &mut self, - fd: i32, + fd_num: i32, buf: Pointer, count: u64, offset: Option, @@ -541,7 +540,7 @@ fn read( // 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 @@ fn read( 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,7 +596,7 @@ fn read( fn write( &mut self, - fd: i32, + fd_num: i32, buf: Pointer, count: u64, offset: Option, @@ -618,7 +617,7 @@ fn write( 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 58d3a73b481..e1697a47415 100644 --- a/src/tools/miri/src/shims/unix/fs.rs +++ b/src/tools/miri/src/shims/unix/fs.rs @@ -554,7 +554,7 @@ fn open(&mut self, args: &[OpTy<'tcx>]) -> InterpResult<'tcx, Scalar> { 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 `FileDescription` trait. @@ -580,13 +580,11 @@ fn lseek64(&mut self, fd: i32, offset: i128, whence: i32) -> InterpResult<'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 @@ fn macos_fbsd_fstat( 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 @@ fn linux_statx( // 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 @@ fn closedir(&mut self, dirp_op: &OpTy<'tcx>) -> InterpResult<'tcx, Scalar> { })) } - 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 @@ fn ftruncate64(&mut self, fd: i32, length: i128) -> InterpResult<'tcx, Scalar> { 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 @@ fn fsync(&mut self, fd_op: &OpTy<'tcx>) -> InterpResult<'tcx, Scalar> { 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 @@ fn fdatasync(&mut self, fd_op: &OpTy<'tcx>) -> InterpResult<'tcx, Scalar> { 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 @@ fn sync_file_range( 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 @@ fn from_path<'tcx>( 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 @@ fn from_fd<'tcx>( .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 ee86cf5f26d..d91ce45e101 100644 --- a/src/tools/miri/src/shims/unix/linux/epoll.rs +++ b/src/tools/miri/src/shims/unix/linux/epoll.rs @@ -51,7 +51,7 @@ pub fn new(events: u32, data: u64) -> EpollEventInstance { #[derive(Clone, Debug)] pub struct EpollEventInterest { /// The file descriptor value of the file description registered. - file_descriptor: i32, + fd_num: i32, /// The events bitmask retrieved from `epoll_event`. events: u32, /// The data retrieved from `epoll_event`. @@ -62,7 +62,7 @@ pub struct EpollEventInterest { /// 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, + epfd_num: i32, } /// EpollReadyEvents reflects the readiness of a file description. @@ -339,11 +339,11 @@ fn epoll_ctl( // 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, + epfd_num: epfd_value, })); if op == epoll_ctl_add { @@ -553,7 +553,7 @@ fn check_and_update_readiness( 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(); + let epfd = this.machine.fds.get(epoll_interest.borrow().epfd_num).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 @@ -615,7 +615,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. From 51dbed2482577a33c20e4c4f08a33fbb372a2703 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 9 Sep 2024 18:59:35 +0200 Subject: [PATCH 12/49] sync methods: pass around places, not pointer-typed operands --- src/tools/miri/src/concurrency/init_once.rs | 7 +- src/tools/miri/src/concurrency/sync.rs | 46 ++++------ src/tools/miri/src/shims/unix/macos/sync.rs | 5 +- src/tools/miri/src/shims/unix/sync.rs | 97 +++++++++------------ src/tools/miri/src/shims/windows/sync.rs | 5 +- 5 files changed, 67 insertions(+), 93 deletions(-) diff --git a/src/tools/miri/src/concurrency/init_once.rs b/src/tools/miri/src/concurrency/init_once.rs index d709e4e6eae..9c2c6ae1330 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 a6a2a03b1b0..ff55af60ee8 100644 --- a/src/tools/miri/src/concurrency/sync.rs +++ b/src/tools/miri/src/concurrency/sync.rs @@ -4,7 +4,7 @@ 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; @@ -206,21 +206,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 @@ -258,18 +258,18 @@ fn get_or_create_id( /// - `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) } @@ -302,15 +302,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, ) -> 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() }, @@ -321,8 +319,7 @@ fn mutex_create( /// `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>, @@ -330,8 +327,7 @@ fn mutex_get_or_create_id( ) -> 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() }), @@ -350,8 +346,7 @@ fn mutex_get_data<'a>(&'a mut self, id: MutexId) -> Option<&'a AdditionalMutexDa 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>, @@ -360,8 +355,7 @@ fn rwlock_get_or_create_id( ) -> 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, |ecx| initialize_data(ecx).map(|data| RwLock { data, ..Default::default() }), @@ -380,14 +374,12 @@ fn rwlock_get_data<'a>(&'a mut self, id: RwLockId) -> Option<&'a AdditionalRwLoc fn condvar_get_or_create_id( &mut self, - lock_op: &OpTy<'tcx>, - lock_layout: TyAndLayout<'tcx>, + lock: &MPlaceTy<'tcx>, offset: u64, ) -> 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()), diff --git a/src/tools/miri/src/shims/unix/macos/sync.rs b/src/tools/miri/src/shims/unix/macos/sync.rs index 882c08cca15..8f9237a1d46 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 @@ 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/sync.rs b/src/tools/miri/src/shims/unix/sync.rs index 9d664985fd4..31de1362638 100644 --- a/src/tools/miri/src/shims/unix/sync.rs +++ b/src/tools/miri/src/shims/unix/sync.rs @@ -18,10 +18,10 @@ fn mutexattr_kind_offset<'tcx>(ecx: &MiriInterpCx<'tcx>) -> InterpResult<'tcx, u 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"), @@ -94,15 +94,14 @@ 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>, + mutex_ptr: &OpTy<'tcx>, kind: i32, ) -> 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 mutex = ecx.deref_pointer(mutex_ptr)?; + let address = mutex.ptr().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)?; + ecx.mutex_create(&mutex, mutex_id_offset(ecx)?, data)?; Ok(()) } @@ -112,24 +111,18 @@ 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(); + let mutex = ecx.deref_pointer(mutex_ptr)?; + let address = mutex.ptr().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)?; + 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 = kind_from_static_initializer(ecx, &mutex)?; - Ok(Some(AdditionalMutexData { kind, address })) - }, - )?; + Ok(Some(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"); @@ -143,20 +136,15 @@ fn mutex_get_id<'tcx>( /// Returns the kind of a static initializer. fn 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 { "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)?; + ecx.read_scalar(&kind_place)?.to_i32()? } | "illumos" | "solaris" | "macos" => ecx.eval_libc_i32("PTHREAD_MUTEX_DEFAULT"), os => throw_unsup_format!("`pthread_mutex` is not supported on {os}"), @@ -211,16 +199,14 @@ 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> { - let address = ecx.read_pointer(rwlock_op)?.addr().bytes(); + let rwlock = ecx.deref_pointer(rwlock_ptr)?; + let address = rwlock.ptr().addr().bytes(); - let id = ecx.rwlock_get_or_create_id( - rwlock_op, - ecx.libc_ty_layout("pthread_rwlock_t"), - rwlock_id_offset(ecx)?, - |_| Ok(Some(AdditionalRwLockData { address })), - )?; + let id = ecx.rwlock_get_or_create_id(&rwlock, rwlock_id_offset(ecx)?, |_| { + Ok(Some(AdditionalRwLockData { address })) + })?; // Check that the rwlock has not been moved since last use. let data = ecx.rwlock_get_data(id).expect("data should be always exist for pthreads"); @@ -246,10 +232,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, @@ -259,11 +245,11 @@ fn condattr_get_clock_id<'tcx>( 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"), @@ -337,21 +323,18 @@ fn cond_clock_offset<'tcx>(ecx: &MiriInterpCx<'tcx>) -> u64 { 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)?; + ecx.condvar_get_or_create_id(&cond, cond_id_offset(ecx)?) } fn cond_reset_id<'tcx>( ecx: &mut MiriInterpCx<'tcx>, - cond_op: &OpTy<'tcx>, + cond_ptr: &OpTy<'tcx>, ) -> InterpResult<'tcx, ()> { ecx.deref_pointer_and_write( - cond_op, + cond_ptr, cond_id_offset(ecx)?, Scalar::from_i32(0), ecx.libc_ty_layout("pthread_cond_t"), @@ -361,10 +344,10 @@ fn cond_reset_id<'tcx>( fn cond_get_clock_id<'tcx>( ecx: &MiriInterpCx<'tcx>, - cond_op: &OpTy<'tcx>, + cond_ptr: &OpTy<'tcx>, ) -> InterpResult<'tcx, i32> { ecx.deref_pointer_and_read( - cond_op, + cond_ptr, cond_clock_offset(ecx), ecx.libc_ty_layout("pthread_cond_t"), ecx.machine.layouts.i32, @@ -374,11 +357,11 @@ fn cond_get_clock_id<'tcx>( fn cond_set_clock_id<'tcx>( ecx: &mut MiriInterpCx<'tcx>, - cond_op: &OpTy<'tcx>, + cond_ptr: &OpTy<'tcx>, clock_id: i32, ) -> InterpResult<'tcx, ()> { ecx.deref_pointer_and_write( - cond_op, + cond_ptr, cond_clock_offset(ecx), Scalar::from_i32(clock_id), ecx.libc_ty_layout("pthread_cond_t"), diff --git a/src/tools/miri/src/shims/windows/sync.rs b/src/tools/miri/src/shims/windows/sync.rs index e1fbb77037c..51b0129356b 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. From 218057c56543957e1519fad88095a2c14e77024d Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 9 Sep 2024 19:07:51 +0200 Subject: [PATCH 13/49] sync: store extra sync primitive data in a Box so the type can be kept local --- src/tools/miri/src/concurrency/sync.rs | 48 ++++------------- src/tools/miri/src/lib.rs | 5 +- src/tools/miri/src/shims/unix/sync.rs | 72 +++++++++++++++++--------- 3 files changed, 59 insertions(+), 66 deletions(-) diff --git a/src/tools/miri/src/concurrency/sync.rs b/src/tools/miri/src/concurrency/sync.rs index ff55af60ee8..7098cc5b95b 100644 --- a/src/tools/miri/src/concurrency/sync.rs +++ b/src/tools/miri/src/concurrency/sync.rs @@ -1,3 +1,4 @@ +use std::any::Any; use std::collections::{hash_map::Entry, VecDeque}; use std::ops::Not; use std::time::Duration; @@ -66,27 +67,6 @@ pub fn to_u32_scalar(&self) -> Scalar { 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,18 +80,11 @@ struct Mutex { clock: VClock, /// Additional data that can be set by shim implementations. - data: Option, + data: Option>, } declare_id!(RwLockId); -#[derive(Debug)] -/// Additional data that may be used by shim implementations. -pub struct AdditionalRwLockData { - /// The address of the rwlock. - pub address: u64, -} - /// The read-write lock state. #[derive(Default, Debug)] struct RwLock { @@ -146,7 +119,7 @@ struct RwLock { clock_current_readers: VClock, /// Additional data that can be set by shim implementations. - data: Option, + data: Option>, } declare_id!(CondvarId); @@ -304,7 +277,7 @@ fn mutex_create( &mut self, lock: &MPlaceTy<'tcx>, offset: u64, - data: Option, + data: Option>, ) -> InterpResult<'tcx, MutexId> { let this = self.eval_context_mut(); this.create_id( @@ -323,7 +296,7 @@ fn mutex_get_or_create_id( 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( @@ -336,12 +309,12 @@ fn mutex_get_or_create_id( } /// 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( @@ -350,8 +323,7 @@ fn rwlock_get_or_create_id( offset: u64, initialize_data: impl for<'a> FnOnce( &'a mut MiriInterpCx<'tcx>, - ) - -> InterpResult<'tcx, Option>, + ) -> InterpResult<'tcx, Option>>, ) -> InterpResult<'tcx, RwLockId> { let this = self.eval_context_mut(); this.get_or_create_id( @@ -364,12 +336,12 @@ fn rwlock_get_or_create_id( } /// Retrieve the additional data stored for a rwlock. - fn rwlock_get_data<'a>(&'a mut self, id: RwLockId) -> Option<&'a AdditionalRwLockData> + 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_ref() + this.machine.sync.rwlocks[id].data.as_deref().and_then(|p| p.downcast_ref::()) } fn condvar_get_or_create_id( diff --git a/src/tools/miri/src/lib.rs b/src/tools/miri/src/lib.rs index 273b1107ed0..8a59206943d 100644 --- a/src/tools/miri/src/lib.rs +++ b/src/tools/miri/src/lib.rs @@ -133,10 +133,7 @@ cpu_affinity::MAX_CPUS, data_race::{AtomicFenceOrd, AtomicReadOrd, AtomicRwOrd, AtomicWriteOrd, EvalContextExt as _}, init_once::{EvalContextExt as _, InitOnceId}, - sync::{ - AdditionalMutexData, AdditionalRwLockData, 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/shims/unix/sync.rs b/src/tools/miri/src/shims/unix/sync.rs index 31de1362638..dacbe973af2 100644 --- a/src/tools/miri/src/shims/unix/sync.rs +++ b/src/tools/miri/src/shims/unix/sync.rs @@ -59,6 +59,25 @@ fn is_mutex_kind_normal<'tcx>(ecx: &MiriInterpCx<'tcx>, kind: i32) -> InterpResu Ok(kind == (mutex_normal_kind | PTHREAD_MUTEX_NORMAL_FLAG)) } +/// The mutex kind. +#[derive(Debug, Clone, Copy)] +pub enum MutexKind { + Normal, + Default, + Recursive, + ErrorCheck, +} + +#[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. // We ignore the platform layout and store our own fields: // - id: u32 @@ -100,8 +119,8 @@ fn mutex_create<'tcx>( let mutex = ecx.deref_pointer(mutex_ptr)?; let address = mutex.ptr().addr().bytes(); let kind = translate_kind(ecx, kind)?; - let data = Some(AdditionalMutexData { address, kind }); - ecx.mutex_create(&mutex, mutex_id_offset(ecx)?, data)?; + let data = Box::new(AdditionalMutexData { address, kind }); + ecx.mutex_create(&mutex, mutex_id_offset(ecx)?, Some(data))?; Ok(()) } @@ -121,11 +140,13 @@ fn mutex_get_id<'tcx>( // an ID yet. We have to determine the mutex kind from the static initializer. let kind = kind_from_static_initializer(ecx, &mutex)?; - Ok(Some(AdditionalMutexData { kind, address })) + 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") } @@ -171,6 +192,13 @@ fn translate_kind<'tcx>(ecx: &MiriInterpCx<'tcx>, kind: i32) -> InterpResult<'tc // We ignore the platform layout and store our own fields: // - id: u32 +#[derive(Debug)] +/// Additional data that may be used by shim implementations. +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, @@ -205,11 +233,13 @@ fn rwlock_get_id<'tcx>( let address = rwlock.ptr().addr().bytes(); let id = ecx.rwlock_get_or_create_id(&rwlock, rwlock_id_offset(ecx)?, |_| { - Ok(Some(AdditionalRwLockData { address })) + 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 be always exist for pthreads"); + 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") } @@ -473,8 +503,10 @@ fn pthread_mutex_lock( 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); @@ -492,10 +524,6 @@ fn pthread_mutex_lock( this.mutex_lock(id); 0 } - _ => - throw_unsup_format!( - "called pthread_mutex_lock on an unsupported type of mutex" - ), } } } else { @@ -511,8 +539,10 @@ fn pthread_mutex_trylock(&mut self, mutex_op: &OpTy<'tcx>) -> InterpResult<'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); @@ -526,10 +556,6 @@ fn pthread_mutex_trylock(&mut self, mutex_op: &OpTy<'tcx>) -> InterpResult<'tcx, this.mutex_lock(id); 0 } - _ => - throw_unsup_format!( - "called pthread_mutex_trylock on an unsupported type of mutex" - ), } } } else { @@ -543,8 +569,10 @@ fn pthread_mutex_unlock(&mut self, mutex_op: &OpTy<'tcx>) -> InterpResult<'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. @@ -564,10 +592,6 @@ fn pthread_mutex_unlock(&mut self, mutex_op: &OpTy<'tcx>) -> InterpResult<'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" - ), } } } From 0d12c5809f10fa6dea73af038677949a9b0286b1 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 10 Sep 2024 09:57:58 +0200 Subject: [PATCH 14/49] Preparing for merge from rustc --- src/tools/miri/rust-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/miri/rust-version b/src/tools/miri/rust-version index 3fdad2a91e9..48cc89b109d 100644 --- a/src/tools/miri/rust-version +++ b/src/tools/miri/rust-version @@ -1 +1 @@ -54fdef7799d9ff9470bb5cabd29fde9471a99eaa +304b7f801bab31233680879ca4fb6eb294706a59 From 6e70bd4d07deb838af1471258742cf1564bce632 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 10 Sep 2024 10:04:09 +0200 Subject: [PATCH 15/49] fmt --- .../provenance/int_copy_looses_provenance3.rs | 2 +- .../miri/tests/fail/uninit/padding-enum.rs | 29 ++++++++++--------- .../tests/fail/uninit/padding-enum.stderr | 4 +-- .../miri/tests/fail/uninit/padding-struct.rs | 15 ++++++---- .../tests/fail/uninit/padding-struct.stderr | 4 +-- .../miri/tests/fail/uninit/padding-union.rs | 15 ++++++---- .../tests/fail/uninit/padding-union.stderr | 4 +-- .../tests/fail/uninit/padding-wide-ptr.rs | 27 +++++++++-------- .../tests/fail/uninit/padding-wide-ptr.stderr | 4 +-- src/tools/miri/tests/pass/arrays.rs | 4 ++- .../miri/tests/pass/async-niche-aliasing.rs | 2 +- 11 files changed, 62 insertions(+), 48 deletions(-) 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 48a48ce4587..d6bbfd7d94c 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/uninit/padding-enum.rs b/src/tools/miri/tests/fail/uninit/padding-enum.rs index 3852ac5c477..a9628799b7d 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 c571f188740..312cf6d20fa 100644 --- a/src/tools/miri/tests/fail/uninit/padding-enum.stderr +++ b/src/tools/miri/tests/fail/uninit/padding-enum.stderr @@ -1,8 +1,8 @@ error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory --> $DIR/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 diff --git a/src/tools/miri/tests/fail/uninit/padding-struct.rs b/src/tools/miri/tests/fail/uninit/padding-struct.rs index dd3be503439..4cdc6f3a104 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 @@ #[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 8dc40a482ac..19e3969279b 100644 --- a/src/tools/miri/tests/fail/uninit/padding-struct.stderr +++ b/src/tools/miri/tests/fail/uninit/padding-struct.stderr @@ -1,8 +1,8 @@ error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory --> $DIR/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 diff --git a/src/tools/miri/tests/fail/uninit/padding-union.rs b/src/tools/miri/tests/fail/uninit/padding-union.rs index 2e9e0a40d6c..294578607b3 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 04002da4f19..61a8d1c6ba6 100644 --- a/src/tools/miri/tests/fail/uninit/padding-union.stderr +++ b/src/tools/miri/tests/fail/uninit/padding-union.stderr @@ -1,8 +1,8 @@ error: Undefined Behavior: constructing invalid value at [1]: encountered uninitialized memory, but expected an integer --> $DIR/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 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 0403a9caba6..4e363dbf81e 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 @@ // 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 0da72550b2e..24194c4b02a 100644 --- a/src/tools/miri/tests/fail/uninit/padding-wide-ptr.stderr +++ b/src/tools/miri/tests/fail/uninit/padding-wide-ptr.stderr @@ -1,8 +1,8 @@ error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory --> $DIR/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 diff --git a/src/tools/miri/tests/pass/arrays.rs b/src/tools/miri/tests/pass/arrays.rs index b0c6f54cab8..5cb04d0f8be 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 7f19afb33e4..ab82c929a94 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> { From 4712e572558f02a80a4d9702baf417d0513f0881 Mon Sep 17 00:00:00 2001 From: The Miri Cronjob Bot Date: Wed, 11 Sep 2024 05:04:32 +0000 Subject: [PATCH 16/49] Preparing for merge from rustc --- src/tools/miri/rust-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/miri/rust-version b/src/tools/miri/rust-version index 48cc89b109d..4fbaee9dcbe 100644 --- a/src/tools/miri/rust-version +++ b/src/tools/miri/rust-version @@ -1 +1 @@ -304b7f801bab31233680879ca4fb6eb294706a59 +a9fb00bfa4b3038c855b2097b54e05e8c198c183 From 7e6ce60ffbbe58cbc38181ad281c99196613bb8b Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Wed, 11 Sep 2024 10:03:13 +0200 Subject: [PATCH 17/49] also allow illumos to use mmap for its stack guard --- src/tools/miri/src/shims/unix/mem.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/miri/src/shims/unix/mem.rs b/src/tools/miri/src/shims/unix/mem.rs index de5a5d0759c..33ed0e26982 100644 --- a/src/tools/miri/src/shims/unix/mem.rs +++ b/src/tools/miri/src/shims/unix/mem.rs @@ -42,10 +42,10 @@ fn mmap( 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)); From 2f09cac1a4e3ec93c11e88aa91db1635fbd0d1f4 Mon Sep 17 00:00:00 2001 From: The Miri Cronjob Bot Date: Thu, 12 Sep 2024 05:07:13 +0000 Subject: [PATCH 18/49] Preparing for merge from rustc --- src/tools/miri/rust-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/miri/rust-version b/src/tools/miri/rust-version index 4fbaee9dcbe..c2850a9f9f0 100644 --- a/src/tools/miri/rust-version +++ b/src/tools/miri/rust-version @@ -1 +1 @@ -a9fb00bfa4b3038c855b2097b54e05e8c198c183 +6c65d4f47f82836f303026ec70f752e30d586bd4 From 157dd83b6316acb72fc43ae222de801be1c1b9e4 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Sun, 8 Sep 2024 14:43:12 +0200 Subject: [PATCH 19/49] Remove an unused piece of logic --- src/tools/miri/tests/ui.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/tools/miri/tests/ui.rs b/src/tools/miri/tests/ui.rs index e62394bc499..125371daa8a 100644 --- a/src/tools/miri/tests/ui.rs +++ b/src/tools/miri/tests/ui.rs @@ -315,8 +315,7 @@ fn main() -> Result<()> { 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"); +fn run_dep_mode(target: String, args: impl Iterator) -> Result<()> { let mut config = miri_config( &target, "", @@ -329,8 +328,6 @@ fn run_dep_mode(target: String, mut args: impl Iterator) -> Res let mut cmd = config.program.build(&config.out_dir); cmd.args(dep_args); - cmd.arg(path); - cmd.args(args); if cmd.spawn()?.wait()?.success() { Ok(()) } else { std::process::exit(1) } } From e4d0ae9b9d8dca8d69c71042b8239f979ad8b696 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Thu, 12 Sep 2024 21:59:56 +0200 Subject: [PATCH 20/49] add non-portable linux pthread initializers to layout sanity check --- src/tools/miri/src/shims/unix/sync.rs | 33 +++++++++++++++++++-------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/src/tools/miri/src/shims/unix/sync.rs b/src/tools/miri/src/shims/unix/sync.rs index dacbe973af2..dbf0ca0cecc 100644 --- a/src/tools/miri/src/shims/unix/sync.rs +++ b/src/tools/miri/src/shims/unix/sync.rs @@ -96,15 +96,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" => { + // No non-standard initializers. + } + os => throw_unsup_format!("`pthread_mutex` is not supported on {os}"), + } } Ok(offset) @@ -167,7 +180,7 @@ fn kind_from_static_initializer<'tcx>( mutex.offset(Size::from_bytes(offset), ecx.machine.layouts.i32, ecx)?; ecx.read_scalar(&kind_place)?.to_i32()? } - | "illumos" | "solaris" | "macos" => ecx.eval_libc_i32("PTHREAD_MUTEX_DEFAULT"), + "illumos" | "solaris" | "macos" => ecx.eval_libc_i32("PTHREAD_MUTEX_DEFAULT"), os => throw_unsup_format!("`pthread_mutex` is not supported on {os}"), }; From b7c7a45b30a3634f8bd0f049208b77cf2f62746a Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Thu, 12 Sep 2024 22:02:10 +0200 Subject: [PATCH 21/49] enable all pthread tests on Solarish --- src/tools/miri/ci/ci.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/miri/ci/ci.sh b/src/tools/miri/ci/ci.sh index 1f66b6fa776..2d7e9aa3ef6 100755 --- a/src/tools/miri/ci/ci.sh +++ b/src/tools/miri/ci/ci.sh @@ -150,8 +150,8 @@ case $HOST_TARGET in 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=x86_64-unknown-illumos run_tests_minimal $BASIC $UNIX threadname pthread available-parallelism libc-time tls + TEST_TARGET=x86_64-pc-solaris run_tests_minimal $BASIC $UNIX threadname pthread available-parallelism libc-time tls TEST_TARGET=aarch64-linux-android run_tests_minimal $BASIC $UNIX 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 From dd01ee7cd2ee5be9d740c0d7f10e054af7131bb9 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Fri, 13 Sep 2024 11:49:01 +0200 Subject: [PATCH 22/49] smoke-test './miri run --dep' --- src/tools/miri/ci/ci.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tools/miri/ci/ci.sh b/src/tools/miri/ci/ci.sh index 2d7e9aa3ef6..d23c1d3b9c1 100755 --- a/src/tools/miri/ci/ci.sh +++ b/src/tools/miri/ci/ci.sh @@ -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". From 03f14f00bfded2177d037f98689966201bcf9dd1 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Fri, 13 Sep 2024 08:09:12 +0200 Subject: [PATCH 23/49] ./miri run: directly run binary instead of using 'cargo run' --- src/tools/miri/ci/ci.sh | 2 +- src/tools/miri/miri-script/Cargo.lock | 118 +++++++++++++++------ src/tools/miri/miri-script/Cargo.toml | 1 + src/tools/miri/miri-script/src/commands.rs | 19 ++-- src/tools/miri/miri-script/src/util.rs | 59 ++++++++--- 5 files changed, 144 insertions(+), 55 deletions(-) diff --git a/src/tools/miri/ci/ci.sh b/src/tools/miri/ci/ci.sh index 2d7e9aa3ef6..7c53f1aabbe 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 diff --git a/src/tools/miri/miri-script/Cargo.lock b/src/tools/miri/miri-script/Cargo.lock index 5e792abac17..8f19576c51d 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 = "2a4e9b6a7cac734a8b4138a4e1044eac3404d8326b6c0f939276560687a033fb" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +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 631d3a82102..2922c24d6c0 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 a9a80175901..7348acac5a9 100644 --- a/src/tools/miri/miri-script/src/commands.rs +++ b/src/tools/miri/miri-script/src/commands.rs @@ -494,23 +494,21 @@ fn run( 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()); - } 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 +521,19 @@ fn run( 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 35c604b407e..9d1a8e4fb1d 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 @@ pub fn new() -> Result { 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 @@ pub fn new() -> Result { }; 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 @@ pub fn install_to_sysroot( 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(()) From 9bab91f5d40b454230ce5c69b95bfa5bd633a1af Mon Sep 17 00:00:00 2001 From: The Miri Cronjob Bot Date: Sat, 14 Sep 2024 04:58:15 +0000 Subject: [PATCH 24/49] Preparing for merge from rustc --- src/tools/miri/rust-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/miri/rust-version b/src/tools/miri/rust-version index c2850a9f9f0..58b6e1f49e3 100644 --- a/src/tools/miri/rust-version +++ b/src/tools/miri/rust-version @@ -1 +1 @@ -6c65d4f47f82836f303026ec70f752e30d586bd4 +23b04c0513472f3728ad482398008e077979e5c4 From b6dea9ebdde7f3de8a2fcc66a1d282386b30fc08 Mon Sep 17 00:00:00 2001 From: Konstantinos Andrikopoulos Date: Fri, 13 Sep 2024 15:00:44 +0200 Subject: [PATCH 25/49] detect when pthread_cond_t is moved Closes #3749 --- src/tools/miri/src/concurrency/sync.rs | 33 ++++- src/tools/miri/src/shims/unix/sync.rs | 127 ++++++++++-------- .../libc_pthread_cond_move.init.stderr | 20 +++ .../concurrency/libc_pthread_cond_move.rs | 37 +++++ ...thread_cond_move.static_initializer.stderr | 20 +++ 5 files changed, 181 insertions(+), 56 deletions(-) create mode 100644 src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_move.init.stderr create mode 100644 src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_move.rs create mode 100644 src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_move.static_initializer.stderr diff --git a/src/tools/miri/src/concurrency/sync.rs b/src/tools/miri/src/concurrency/sync.rs index 7098cc5b95b..1f910d885ca 100644 --- a/src/tools/miri/src/concurrency/sync.rs +++ b/src/tools/miri/src/concurrency/sync.rs @@ -134,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. @@ -344,21 +347,49 @@ fn rwlock_get_data<'a, T: 'static>(&'a mut self, id: RwLockId) -> Option<&'a T> 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: &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, 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/shims/unix/sync.rs b/src/tools/miri/src/shims/unix/sync.rs index dbf0ca0cecc..3535eacb447 100644 --- a/src/tools/miri/src/shims/unix/sync.rs +++ b/src/tools/miri/src/shims/unix/sync.rs @@ -206,7 +206,7 @@ fn translate_kind<'tcx>(ecx: &MiriInterpCx<'tcx>, kind: i32) -> InterpResult<'tc // - id: u32 #[derive(Debug)] -/// Additional data that may be used by shim implementations. +/// Additional data that we attach with each rwlock instance. pub struct AdditionalRwLockData { /// The address of the rwlock. pub address: u64, @@ -286,6 +286,19 @@ fn condattr_get_clock_id<'tcx>( .to_i32() } +fn translate_clock_id<'tcx>(ecx: &MiriInterpCx<'tcx>, raw_id: i32) -> InterpResult<'tcx, ClockId> { + // 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. + Ok(if raw_id == ecx.eval_libc_i32("CLOCK_REALTIME") || raw_id == 0 { + 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_ptr: &OpTy<'tcx>, @@ -331,16 +344,6 @@ 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")) -} - 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. @@ -355,8 +358,9 @@ fn cond_clock_offset<'tcx>(ecx: &MiriInterpCx<'tcx>) -> u64 { .offset(Size::from_bytes(offset), ecx.machine.layouts.i32, ecx) .unwrap(); let id = ecx.read_scalar(&id_field).unwrap().to_i32().unwrap(); + let id = translate_clock_id(ecx, id).expect("static initializer should be valid"); assert!( - is_cond_clock_realtime(ecx, id), + matches!(id, ClockId::Realtime), "PTHREAD_COND_INITIALIZER is incompatible with our pthread_cond layout: clock is not CLOCK_REALTIME" ); } @@ -364,25 +368,47 @@ fn cond_clock_offset<'tcx>(ecx: &MiriInterpCx<'tcx>) -> u64 { offset } +#[derive(Debug, Clone, Copy)] +enum ClockId { + Realtime, + Monotonic, +} + +#[derive(Debug)] +/// Additional data that we attach with each cond instance. +struct AdditionalCondData { + /// The address of the cond. + address: u64, + + /// The clock id of the cond. + clock_id: ClockId, +} + fn cond_get_id<'tcx>( ecx: &mut MiriInterpCx<'tcx>, cond_ptr: &OpTy<'tcx>, ) -> InterpResult<'tcx, CondvarId> { let cond = ecx.deref_pointer(cond_ptr)?; - ecx.condvar_get_or_create_id(&cond, cond_id_offset(ecx)?) -} + let address = cond.ptr().addr().bytes(); + let id = ecx.condvar_get_or_create_id(&cond, cond_id_offset(ecx)?, |ecx| { + let raw_id = if ecx.tcx.sess.target.os == "macos" { + ecx.eval_libc_i32("CLOCK_REALTIME") + } else { + cond_get_clock_id(ecx, cond_ptr)? + }; + let clock_id = translate_clock_id(ecx, raw_id)?; + Ok(Some(Box::new(AdditionalCondData { address, clock_id }))) + })?; -fn cond_reset_id<'tcx>( - ecx: &mut MiriInterpCx<'tcx>, - cond_ptr: &OpTy<'tcx>, -) -> InterpResult<'tcx, ()> { - ecx.deref_pointer_and_write( - cond_ptr, - cond_id_offset(ecx)?, - Scalar::from_i32(0), - ecx.libc_ty_layout("pthread_cond_t"), - ecx.machine.layouts.u32, - ) + // 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") + } + + Ok(id) } fn cond_get_clock_id<'tcx>( @@ -398,20 +424,6 @@ fn cond_get_clock_id<'tcx>( .to_i32() } -fn cond_set_clock_id<'tcx>( - ecx: &mut MiriInterpCx<'tcx>, - cond_ptr: &OpTy<'tcx>, - clock_id: i32, -) -> InterpResult<'tcx, ()> { - ecx.deref_pointer_and_write( - cond_ptr, - cond_clock_offset(ecx), - Scalar::from_i32(clock_id), - ecx.libc_ty_layout("pthread_cond_t"), - ecx.machine.layouts.i32, - ) -} - impl<'tcx> EvalContextExt<'tcx> for crate::MiriInterpCx<'tcx> {} pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { fn pthread_mutexattr_init(&mut self, attr_op: &OpTy<'tcx>) -> InterpResult<'tcx, ()> { @@ -820,11 +832,15 @@ fn pthread_cond_init( } else { condattr_get_clock_id(this, attr_op)? }; + let clock_id = translate_clock_id(this, clock_id)?; - // 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 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(()) } @@ -879,7 +895,10 @@ fn pthread_cond_timedwait( 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"))?)? { @@ -890,13 +909,12 @@ fn pthread_cond_timedwait( 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( @@ -912,6 +930,9 @@ fn pthread_cond_timedwait( } fn pthread_cond_destroy(&mut self, cond_op: &OpTy<'tcx>) -> InterpResult<'tcx, ()> { + //NOTE: Destroying an uninit pthread_cond is UB. Make sure it's not uninit, + // by accessing at least once all of its fields that we use. + let this = self.eval_context_mut(); let id = cond_get_id(this, cond_op)?; @@ -919,10 +940,6 @@ fn pthread_cond_destroy(&mut self, cond_op: &OpTy<'tcx>) -> InterpResult<'tcx, ( 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/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 00000000000..a15451cb319 --- /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 + --> $DIR/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 $DIR/libc_pthread_cond_move.rs:LL:CC +note: inside `main` + --> $DIR/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 00000000000..e4e84eb9fd0 --- /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 00000000000..4e4188e2a12 --- /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 + --> $DIR/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 $DIR/libc_pthread_cond_move.rs:LL:CC +note: inside `main` + --> $DIR/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 + From efdc01bfee960e8c10c16233cd4d6aad196374cb Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 15 Sep 2024 10:54:56 +0200 Subject: [PATCH 26/49] unix/sync: cleanup --- src/tools/miri/src/shims/unix/sync.rs | 110 +++++++------------------- 1 file changed, 29 insertions(+), 81 deletions(-) diff --git a/src/tools/miri/src/shims/unix/sync.rs b/src/tools/miri/src/shims/unix/sync.rs index 3535eacb447..b038ac33df8 100644 --- a/src/tools/miri/src/shims/unix/sync.rs +++ b/src/tools/miri/src/shims/unix/sync.rs @@ -50,15 +50,6 @@ fn mutexattr_set_kind<'tcx>( /// 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")) -} - -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)) -} - /// The mutex kind. #[derive(Debug, Clone, Copy)] pub enum MutexKind { @@ -78,7 +69,7 @@ pub struct AdditionalMutexData { 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 @@ -131,7 +122,7 @@ fn mutex_create<'tcx>( ) -> InterpResult<'tcx> { let mutex = ecx.deref_pointer(mutex_ptr)?; let address = mutex.ptr().addr().bytes(); - let kind = translate_kind(ecx, kind)?; + let kind = mutex_translate_kind(ecx, kind)?; let data = Box::new(AdditionalMutexData { address, kind }); ecx.mutex_create(&mutex, mutex_id_offset(ecx)?, Some(data))?; Ok(()) @@ -151,7 +142,7 @@ fn mutex_get_id<'tcx>( 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 = kind_from_static_initializer(ecx, &mutex)?; + let kind = mutex_kind_from_static_initializer(ecx, &mutex)?; Ok(Some(Box::new(AdditionalMutexData { kind, address }))) })?; @@ -168,12 +159,12 @@ 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: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx, MutexKind> { - // Only linux has static initializers other than PTHREAD_MUTEX_DEFAULT. let kind = 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 }; let kind_place = @@ -184,13 +175,16 @@ fn kind_from_static_initializer<'tcx>( os => throw_unsup_format!("`pthread_mutex` is not supported on {os}"), }; - translate_kind(ecx, kind) + mutex_translate_kind(ecx, kind) } -fn translate_kind<'tcx>(ecx: &MiriInterpCx<'tcx>, kind: i32) -> InterpResult<'tcx, MutexKind> { - Ok(if is_mutex_kind_default(ecx, kind)? { +fn mutex_translate_kind<'tcx>( + ecx: &MiriInterpCx<'tcx>, + kind: i32, +) -> InterpResult<'tcx, MutexKind> { + Ok(if kind == ecx.eval_libc_i32("PTHREAD_MUTEX_DEFAULT") { MutexKind::Default - } else if is_mutex_kind_normal(ecx, kind)? { + } else if kind == (ecx.eval_libc_i32("PTHREAD_MUTEX_NORMAL") | PTHREAD_MUTEX_NORMAL_FLAG) { MutexKind::Normal } else if kind == ecx.eval_libc_i32("PTHREAD_MUTEX_ERRORCHECK") { MutexKind::ErrorCheck @@ -201,7 +195,7 @@ fn translate_kind<'tcx>(ecx: &MiriInterpCx<'tcx>, kind: i32) -> InterpResult<'tc }) } -// 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 @@ -286,11 +280,11 @@ fn condattr_get_clock_id<'tcx>( .to_i32() } -fn translate_clock_id<'tcx>(ecx: &MiriInterpCx<'tcx>, raw_id: i32) -> InterpResult<'tcx, ClockId> { - // 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. - Ok(if raw_id == ecx.eval_libc_i32("CLOCK_REALTIME") || raw_id == 0 { +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 @@ -313,10 +307,9 @@ 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 { @@ -344,30 +337,6 @@ fn cond_id_offset<'tcx>(ecx: &MiriInterpCx<'tcx>) -> InterpResult<'tcx, u64> { Ok(offset) } -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; - - // 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(); - let id = translate_clock_id(ecx, id).expect("static initializer should be valid"); - assert!( - matches!(id, ClockId::Realtime), - "PTHREAD_COND_INITIALIZER is incompatible with our pthread_cond layout: clock is not CLOCK_REALTIME" - ); - } - - offset -} - #[derive(Debug, Clone, Copy)] enum ClockId { Realtime, @@ -390,14 +359,9 @@ fn cond_get_id<'tcx>( ) -> InterpResult<'tcx, CondvarId> { 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| { - let raw_id = if ecx.tcx.sess.target.os == "macos" { - ecx.eval_libc_i32("CLOCK_REALTIME") - } else { - cond_get_clock_id(ecx, cond_ptr)? - }; - let clock_id = translate_clock_id(ecx, raw_id)?; - Ok(Some(Box::new(AdditionalCondData { address, clock_id }))) + 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 }))) })?; // Check that the mutex has not been moved since last use. @@ -411,19 +375,6 @@ fn cond_get_id<'tcx>( Ok(id) } -fn cond_get_clock_id<'tcx>( - ecx: &MiriInterpCx<'tcx>, - cond_ptr: &OpTy<'tcx>, -) -> InterpResult<'tcx, i32> { - ecx.deref_pointer_and_read( - cond_ptr, - cond_clock_offset(ecx), - ecx.libc_ty_layout("pthread_cond_t"), - ecx.machine.layouts.i32, - )? - .to_i32() -} - impl<'tcx> EvalContextExt<'tcx> for crate::MiriInterpCx<'tcx> {} pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { fn pthread_mutexattr_init(&mut self, attr_op: &OpTy<'tcx>) -> InterpResult<'tcx, ()> { @@ -624,15 +575,14 @@ fn pthread_mutex_unlock(&mut self, mutex_op: &OpTy<'tcx>) -> InterpResult<'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"))?, @@ -734,15 +684,14 @@ fn pthread_rwlock_unlock(&mut self, rwlock_op: &OpTy<'tcx>) -> InterpResult<'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"))?, @@ -832,7 +781,7 @@ fn pthread_cond_init( } else { condattr_get_clock_id(this, attr_op)? }; - let clock_id = translate_clock_id(this, 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(); @@ -930,11 +879,10 @@ fn pthread_cond_timedwait( } fn pthread_cond_destroy(&mut self, cond_op: &OpTy<'tcx>) -> InterpResult<'tcx, ()> { - //NOTE: Destroying an uninit pthread_cond is UB. Make sure it's not uninit, - // by accessing at least once all of its fields that we use. - 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"); From 40000270841c2d6aadbdbe2eebdaa979196123c8 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 15 Sep 2024 11:47:22 +0200 Subject: [PATCH 27/49] pthread: add FreeBSD, remove PTHREAD_MUTEX_NORMAL_FLAG hack On FreeBSD, DEFAULT maps to ERRORCK. This clashes with the existing PTHREAD_MUTEX_NORMAL_FLAG: hack so we replace it by a different hack that works better cross-platform. Also fix a case of "accidental early UB" in a UB test -- pthread_mutexattr_t must be initialized. --- src/tools/miri/ci/ci.sh | 4 +- src/tools/miri/src/shims/unix/sync.rs | 88 ++++++++----------- .../libc_pthread_mutex_default_deadlock.rs | 3 +- 3 files changed, 43 insertions(+), 52 deletions(-) diff --git a/src/tools/miri/ci/ci.sh b/src/tools/miri/ci/ci.sh index 2e76838b001..086ea8e3af2 100755 --- a/src/tools/miri/ci/ci.sh +++ b/src/tools/miri/ci/ci.sh @@ -150,8 +150,8 @@ 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-freebsd run_tests_minimal $BASIC $UNIX threadname pthread libc-time fs + TEST_TARGET=i686-unknown-freebsd run_tests_minimal $BASIC $UNIX threadname pthread libc-time fs TEST_TARGET=x86_64-unknown-illumos run_tests_minimal $BASIC $UNIX threadname pthread available-parallelism libc-time tls TEST_TARGET=x86_64-pc-solaris run_tests_minimal $BASIC $UNIX threadname pthread available-parallelism libc-time tls TEST_TARGET=aarch64-linux-android run_tests_minimal $BASIC $UNIX diff --git a/src/tools/miri/src/shims/unix/sync.rs b/src/tools/miri/src/shims/unix/sync.rs index b038ac33df8..114a457d71a 100644 --- a/src/tools/miri/src/shims/unix/sync.rs +++ b/src/tools/miri/src/shims/unix/sync.rs @@ -11,7 +11,7 @@ #[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" => 0, os => throw_unsup_format!("`pthread_mutexattr` is not supported on {os}"), }) } @@ -43,12 +43,11 @@ 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; +/// 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)] @@ -74,8 +73,10 @@ pub struct AdditionalMutexData { // - 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" => 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}"), @@ -104,7 +105,7 @@ fn mutex_id_offset<'tcx>(ecx: &MiriInterpCx<'tcx>) -> InterpResult<'tcx, u64> { check_static_initializer("PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP"); check_static_initializer("PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP"); } - "illumos" | "solaris" | "macos" => { + "illumos" | "solaris" | "macos" | "freebsd" => { // No non-standard initializers. } os => throw_unsup_format!("`pthread_mutex` is not supported on {os}"), @@ -118,11 +119,10 @@ fn mutex_id_offset<'tcx>(ecx: &MiriInterpCx<'tcx>) -> InterpResult<'tcx, u64> { fn mutex_create<'tcx>( ecx: &mut MiriInterpCx<'tcx>, mutex_ptr: &OpTy<'tcx>, - kind: i32, + kind: MutexKind, ) -> InterpResult<'tcx> { let mutex = ecx.deref_pointer(mutex_ptr)?; let address = mutex.ptr().addr().bytes(); - let kind = mutex_translate_kind(ecx, kind)?; let data = Box::new(AdditionalMutexData { address, kind }); ecx.mutex_create(&mutex, mutex_id_offset(ecx)?, Some(data))?; Ok(()) @@ -163,33 +163,41 @@ fn mutex_kind_from_static_initializer<'tcx>( ecx: &MiriInterpCx<'tcx>, mutex: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx, MutexKind> { - 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 }; let kind_place = mutex.offset(Size::from_bytes(offset), ecx.machine.layouts.i32, ecx)?; - ecx.read_scalar(&kind_place)?.to_i32()? + 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}"), - }; - - mutex_translate_kind(ecx, kind) + _ => MutexKind::Default, + }) } fn mutex_translate_kind<'tcx>( ecx: &MiriInterpCx<'tcx>, kind: i32, ) -> InterpResult<'tcx, MutexKind> { - Ok(if kind == ecx.eval_libc_i32("PTHREAD_MUTEX_DEFAULT") { - MutexKind::Default - } else if kind == (ecx.eval_libc_i32("PTHREAD_MUTEX_NORMAL") | PTHREAD_MUTEX_NORMAL_FLAG) { + 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}"); }) @@ -208,7 +216,7 @@ pub struct AdditionalRwLockData { 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" => 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}"), @@ -261,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" => 0, // macOS does not have a clock attribute. os => throw_unsup_format!("`pthread_condattr` clock field is not supported on {os}"), }) @@ -313,7 +321,7 @@ fn condattr_set_clock_id<'tcx>( 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" => 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}"), @@ -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 @@ fn pthread_mutexattr_settype( 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 @@ fn pthread_mutex_init( 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)?; 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 1038b8988f9..6723f2c6e77 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 @@ -4,7 +4,8 @@ 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); From 2cdf5f7e696fa424282e5b1544e58573ad1a14a3 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 15 Sep 2024 12:03:20 +0200 Subject: [PATCH 28/49] move two tests to a better location --- .../pass-dep/{concurrency => libc}/libc_pthread_cond_timedwait.rs | 0 .../{concurrency => libc}/libc_pthread_cond_timedwait_isolated.rs | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename src/tools/miri/tests/pass-dep/{concurrency => libc}/libc_pthread_cond_timedwait.rs (100%) rename src/tools/miri/tests/pass-dep/{concurrency => libc}/libc_pthread_cond_timedwait_isolated.rs (100%) 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 100% 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 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 100% 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 From 2ed91881efcb7c7201b573a579824b9d4923bfff Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 15 Sep 2024 12:05:23 +0200 Subject: [PATCH 29/49] enable std::sync tests on Solarish --- src/tools/miri/ci/ci.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/miri/ci/ci.sh b/src/tools/miri/ci/ci.sh index 086ea8e3af2..6b57a294b65 100755 --- a/src/tools/miri/ci/ci.sh +++ b/src/tools/miri/ci/ci.sh @@ -152,8 +152,8 @@ case $HOST_TARGET in 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 pthread libc-time fs TEST_TARGET=i686-unknown-freebsd run_tests_minimal $BASIC $UNIX threadname pthread libc-time fs - TEST_TARGET=x86_64-unknown-illumos run_tests_minimal $BASIC $UNIX threadname pthread available-parallelism libc-time tls - TEST_TARGET=x86_64-pc-solaris run_tests_minimal $BASIC $UNIX threadname pthread available-parallelism libc-time tls + 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=wasm32-wasip2 run_tests_minimal empty_main wasm heap_alloc libc-mem TEST_TARGET=wasm32-unknown-unknown run_tests_minimal empty_main wasm From cb445d0188187c4f00dd23cdd6635e08f79ebaae Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 15 Sep 2024 12:24:31 +0200 Subject: [PATCH 30/49] make pthread-threadname nicer with cfg-if --- src/tools/miri/test_dependencies/Cargo.lock | 1 + src/tools/miri/test_dependencies/Cargo.toml | 1 + .../tests/pass-dep/libc/pthread-threadname.rs | 55 +++++++++++++------ 3 files changed, 39 insertions(+), 18 deletions(-) diff --git a/src/tools/miri/test_dependencies/Cargo.lock b/src/tools/miri/test_dependencies/Cargo.lock index 39d41281728..9a4431eb704 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 c24422df26c..e7eff46afca 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/pass-dep/libc/pthread-threadname.rs b/src/tools/miri/tests/pass-dep/libc/pthread-threadname.rs index d66cd3bbb03..8be42b50897 100644 --- a/src/tools/miri/tests/pass-dep/libc/pthread-threadname.rs +++ b/src/tools/miri/tests/pass-dep/libc/pthread-threadname.rs @@ -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 set_thread_name(name: &CStr) -> i32 { // 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())); From 8ee38bf2303f9aa72e4c957e11a6974fe0c3af6c Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 15 Sep 2024 12:33:48 +0200 Subject: [PATCH 31/49] add Android pthread support --- src/tools/miri/ci/ci.sh | 2 +- src/tools/miri/src/shims/unix/sync.rs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/tools/miri/ci/ci.sh b/src/tools/miri/ci/ci.sh index 6b57a294b65..1d72f42d5c7 100755 --- a/src/tools/miri/ci/ci.sh +++ b/src/tools/miri/ci/ci.sh @@ -154,7 +154,7 @@ case $HOST_TARGET in TEST_TARGET=i686-unknown-freebsd run_tests_minimal $BASIC $UNIX threadname pthread 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=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/src/shims/unix/sync.rs b/src/tools/miri/src/shims/unix/sync.rs index 114a457d71a..fea994663c0 100644 --- a/src/tools/miri/src/shims/unix/sync.rs +++ b/src/tools/miri/src/shims/unix/sync.rs @@ -11,7 +11,7 @@ #[inline] fn mutexattr_kind_offset<'tcx>(ecx: &MiriInterpCx<'tcx>) -> InterpResult<'tcx, u64> { Ok(match &*ecx.tcx.sess.target.os { - "linux" | "illumos" | "solaris" | "macos" | "freebsd" => 0, + "linux" | "illumos" | "solaris" | "macos" | "freebsd" | "android" => 0, os => throw_unsup_format!("`pthread_mutexattr` is not supported on {os}"), }) } @@ -76,7 +76,7 @@ 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" | "freebsd" => 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}"), @@ -105,7 +105,7 @@ fn mutex_id_offset<'tcx>(ecx: &MiriInterpCx<'tcx>) -> InterpResult<'tcx, u64> { check_static_initializer("PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP"); check_static_initializer("PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP"); } - "illumos" | "solaris" | "macos" | "freebsd" => { + "illumos" | "solaris" | "macos" | "freebsd" | "android" => { // No non-standard initializers. } os => throw_unsup_format!("`pthread_mutex` is not supported on {os}"), @@ -216,7 +216,7 @@ pub struct AdditionalRwLockData { fn rwlock_id_offset<'tcx>(ecx: &MiriInterpCx<'tcx>) -> InterpResult<'tcx, u64> { let offset = match &*ecx.tcx.sess.target.os { - "linux" | "illumos" | "solaris" | "freebsd" => 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}"), @@ -269,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" | "freebsd" => 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}"), }) @@ -321,7 +321,7 @@ fn condattr_set_clock_id<'tcx>( fn cond_id_offset<'tcx>(ecx: &MiriInterpCx<'tcx>) -> InterpResult<'tcx, u64> { let offset = match &*ecx.tcx.sess.target.os { - "linux" | "illumos" | "solaris" | "freebsd" => 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}"), From f394c6ce8c1b155df686597c2cee9ecd7eb8f7ce Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 15 Sep 2024 12:37:48 +0200 Subject: [PATCH 32/49] test std::time APIs on FreeBSD and Solarish --- src/tools/miri/ci/ci.sh | 8 ++++---- src/tools/miri/tests/pass/shims/time-with-isolation.rs | 4 ++-- .../miri/tests/pass/shims/time-with-isolation.stdout | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/tools/miri/ci/ci.sh b/src/tools/miri/ci/ci.sh index 1d72f42d5c7..ee8e8d3e1c8 100755 --- a/src/tools/miri/ci/ci.sh +++ b/src/tools/miri/ci/ci.sh @@ -150,10 +150,10 @@ 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 pthread libc-time fs - TEST_TARGET=i686-unknown-freebsd run_tests_minimal $BASIC $UNIX threadname pthread 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=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 threadname pthread sync available-parallelism time tls + TEST_TARGET=x86_64-pc-solaris run_tests_minimal $BASIC $UNIX threadname pthread 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 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 645d42ad975..e7b16244123 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 ff5889bacd5..2d7fb5f4a61 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.) From 5f3bec427c1e619dd5bb8d9c4f3d164c6d3d1469 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 15 Sep 2024 12:44:57 +0200 Subject: [PATCH 33/49] we can test more things on Solarish, and update its status in the README --- src/tools/miri/README.md | 2 +- src/tools/miri/ci/ci.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tools/miri/README.md b/src/tools/miri/README.md index 72555e8c40d..d8636915ea8 100644 --- a/src/tools/miri/README.md +++ b/src/tools/miri/README.md @@ -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 ee8e8d3e1c8..c7be71662bd 100755 --- a/src/tools/miri/ci/ci.sh +++ b/src/tools/miri/ci/ci.sh @@ -152,8 +152,8 @@ case $HOST_TARGET in 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 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 threadname pthread sync available-parallelism time tls - TEST_TARGET=x86_64-pc-solaris run_tests_minimal $BASIC $UNIX threadname pthread sync available-parallelism time tls + 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 From ffcaa7fddee251f2b7ed2ca62900c2440f25e04f Mon Sep 17 00:00:00 2001 From: The Miri Cronjob Bot Date: Mon, 16 Sep 2024 04:58:35 +0000 Subject: [PATCH 34/49] Preparing for merge from rustc --- src/tools/miri/rust-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/miri/rust-version b/src/tools/miri/rust-version index 58b6e1f49e3..eeff9ac8e38 100644 --- a/src/tools/miri/rust-version +++ b/src/tools/miri/rust-version @@ -1 +1 @@ -23b04c0513472f3728ad482398008e077979e5c4 +c16ff44537509ca911ffd3653b17c6187c71831d From 1692d12c1c43a14254d697e4b1a4abf94fd732ce Mon Sep 17 00:00:00 2001 From: The Miri Cronjob Bot Date: Mon, 16 Sep 2024 05:07:31 +0000 Subject: [PATCH 35/49] fmt --- src/tools/miri/tests/fail/data_race/local_variable_read_race.rs | 2 +- .../miri/tests/fail/data_race/local_variable_write_race.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 80d2b7b7c12..16a23f595ee 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_write_race.rs b/src/tools/miri/tests/fail/data_race/local_variable_write_race.rs index eabbe4403c6..7e00573146c 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(); From 5b8a18f9592c84569461dbb6e6638075c9ed826f Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 16 Sep 2024 08:32:19 +0200 Subject: [PATCH 36/49] fix clippy lints --- src/tools/miri/src/concurrency/data_race.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/miri/src/concurrency/data_race.rs b/src/tools/miri/src/concurrency/data_race.rs index f686b331ad6..b5b43f589f6 100644 --- a/src/tools/miri/src/concurrency/data_race.rs +++ b/src/tools/miri/src/concurrency/data_race.rs @@ -1165,7 +1165,7 @@ pub fn local_write(&self, local: mir::Local, storage_live: bool, machine: &MiriM } 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 @@ pub fn local_read(&self, local: mir::Local, machine: &MiriMachine<'_>) { // 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]; } From 9f9f19810f2bc2fa6c3b8891f1c3197124b07161 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Sat, 7 Sep 2024 16:40:08 +0200 Subject: [PATCH 37/49] Bump ui test --- src/tools/miri/Cargo.lock | 81 ++++-------- src/tools/miri/Cargo.toml | 2 +- .../apple_os_unfair_lock_assert_not_owner.rs | 2 +- ...ple_os_unfair_lock_assert_not_owner.stderr | 4 +- .../apple_os_unfair_lock_assert_owner.rs | 2 +- .../apple_os_unfair_lock_assert_owner.stderr | 4 +- .../apple_os_unfair_lock_reentrant.rs | 2 +- .../apple_os_unfair_lock_reentrant.stderr | 4 +- .../apple_os_unfair_lock_unowned.rs | 2 +- .../apple_os_unfair_lock_unowned.stderr | 4 +- .../libc_pthread_cond_double_destroy.rs | 2 +- .../libc_pthread_cond_double_destroy.stderr | 4 +- .../libc_pthread_cond_move.init.stderr | 6 +- .../concurrency/libc_pthread_cond_move.rs | 2 +- ...thread_cond_move.static_initializer.stderr | 6 +- .../libc_pthread_condattr_double_destroy.rs | 4 +- ...ibc_pthread_condattr_double_destroy.stderr | 4 +- .../libc_pthread_create_main_terminate.rs | 2 +- .../libc_pthread_create_too_few_args.rs | 2 +- .../libc_pthread_create_too_many_args.rs | 2 +- .../concurrency/libc_pthread_join_detached.rs | 2 +- .../libc_pthread_join_detached.stderr | 4 +- .../concurrency/libc_pthread_join_joined.rs | 2 +- .../libc_pthread_join_joined.stderr | 4 +- .../concurrency/libc_pthread_join_main.rs | 2 +- .../concurrency/libc_pthread_join_main.stderr | 4 +- .../concurrency/libc_pthread_join_multiple.rs | 2 +- .../libc_pthread_join_multiple.stderr | 4 +- .../concurrency/libc_pthread_join_self.rs | 2 +- .../concurrency/libc_pthread_join_self.stderr | 4 +- .../libc_pthread_mutex_NULL_deadlock.rs | 2 +- .../libc_pthread_mutex_NULL_deadlock.stderr | 4 +- .../libc_pthread_mutex_deadlock.rs | 2 +- .../libc_pthread_mutex_deadlock.stderr | 6 +- .../libc_pthread_mutex_default_deadlock.rs | 2 +- ...libc_pthread_mutex_default_deadlock.stderr | 4 +- .../libc_pthread_mutex_destroy_locked.rs | 2 +- .../libc_pthread_mutex_destroy_locked.stderr | 4 +- .../libc_pthread_mutex_double_destroy.rs | 2 +- .../libc_pthread_mutex_double_destroy.stderr | 4 +- .../libc_pthread_mutex_move.init.stderr | 6 +- .../concurrency/libc_pthread_mutex_move.rs | 2 +- ...hread_mutex_move.static_initializer.stderr | 6 +- .../libc_pthread_mutex_normal_deadlock.rs | 2 +- .../libc_pthread_mutex_normal_deadlock.stderr | 4 +- ...bc_pthread_mutex_normal_unlock_unlocked.rs | 2 +- ...thread_mutex_normal_unlock_unlocked.stderr | 4 +- .../libc_pthread_mutex_wrong_owner.rs | 2 +- .../libc_pthread_mutex_wrong_owner.stderr | 4 +- .../libc_pthread_mutexattr_double_destroy.rs | 2 +- ...bc_pthread_mutexattr_double_destroy.stderr | 4 +- ...libc_pthread_rwlock_destroy_read_locked.rs | 2 +- ..._pthread_rwlock_destroy_read_locked.stderr | 4 +- ...ibc_pthread_rwlock_destroy_write_locked.rs | 2 +- ...pthread_rwlock_destroy_write_locked.stderr | 4 +- .../libc_pthread_rwlock_double_destroy.rs | 2 +- .../libc_pthread_rwlock_double_destroy.stderr | 4 +- ...wlock_read_write_deadlock_single_thread.rs | 2 +- ...k_read_write_deadlock_single_thread.stderr | 4 +- .../libc_pthread_rwlock_read_wrong_owner.rs | 2 +- ...ibc_pthread_rwlock_read_wrong_owner.stderr | 4 +- .../libc_pthread_rwlock_unlock_unlocked.rs | 2 +- ...libc_pthread_rwlock_unlock_unlocked.stderr | 4 +- ...libc_pthread_rwlock_write_read_deadlock.rs | 2 +- ..._pthread_rwlock_write_read_deadlock.stderr | 6 +- ...wlock_write_read_deadlock_single_thread.rs | 2 +- ...k_write_read_deadlock_single_thread.stderr | 4 +- ...ibc_pthread_rwlock_write_write_deadlock.rs | 2 +- ...pthread_rwlock_write_write_deadlock.stderr | 6 +- ...lock_write_write_deadlock_single_thread.rs | 2 +- ..._write_write_deadlock_single_thread.stderr | 4 +- .../libc_pthread_rwlock_write_wrong_owner.rs | 2 +- ...bc_pthread_rwlock_write_wrong_owner.stderr | 4 +- .../concurrency/libx_pthread_rwlock_moved.rs | 2 +- .../libx_pthread_rwlock_moved.stderr | 4 +- .../concurrency/windows_join_detached.rs | 2 +- .../concurrency/windows_join_detached.stderr | 2 +- .../fail-dep/concurrency/windows_join_main.rs | 2 +- .../concurrency/windows_join_main.stderr | 4 +- .../fail-dep/concurrency/windows_join_self.rs | 2 +- .../concurrency/windows_join_self.stderr | 6 +- .../miri/tests/fail-dep/libc/affinity.rs | 4 +- .../miri/tests/fail-dep/libc/affinity.stderr | 6 +- .../libc/aligned_alloc_size_zero_leak.rs | 2 +- .../libc/aligned_alloc_size_zero_leak.stderr | 4 +- .../fail-dep/libc/env-set_var-data-race.rs | 2 +- .../libc/env-set_var-data-race.stderr | 6 +- .../tests/fail-dep/libc/fs/close_stdout.rs | 2 +- .../fail-dep/libc/fs/close_stdout.stderr | 4 +- .../tests/fail-dep/libc/fs/isolated_stdin.rs | 2 +- .../fail-dep/libc/fs/isolated_stdin.stderr | 4 +- .../fail-dep/libc/fs/mkstemp_immutable_arg.rs | 2 +- .../libc/fs/mkstemp_immutable_arg.stderr | 6 +- .../fail-dep/libc/fs/read_from_stdout.rs | 2 +- .../fail-dep/libc/fs/read_from_stdout.stderr | 4 +- .../fs/unix_open_missing_required_mode.rs | 2 +- .../fs/unix_open_missing_required_mode.stderr | 6 +- .../tests/fail-dep/libc/fs/write_to_stdin.rs | 2 +- .../fail-dep/libc/fs/write_to_stdin.stderr | 4 +- .../libc-read-and-uninit-premature-eof.rs | 2 +- .../libc-read-and-uninit-premature-eof.stderr | 4 +- .../libc/libc_epoll_unsupported_fd.rs | 2 +- .../libc/libc_epoll_unsupported_fd.stderr | 4 +- .../fail-dep/libc/libc_eventfd_read_block.rs | 2 +- .../libc/libc_eventfd_read_block.stderr | 4 +- .../fail-dep/libc/libc_eventfd_write_block.rs | 2 +- .../libc/libc_eventfd_write_block.stderr | 4 +- .../libc/malloc_zero_double_free.stderr | 8 +- .../libc/malloc_zero_memory_leak.stderr | 4 +- .../tests/fail-dep/libc/memchr_null.stderr | 4 +- .../tests/fail-dep/libc/memcmp_null.stderr | 4 +- .../tests/fail-dep/libc/memcmp_zero.stderr | 4 +- .../tests/fail-dep/libc/memcpy_zero.stderr | 4 +- .../miri/tests/fail-dep/libc/memrchr_null.rs | 4 +- .../tests/fail-dep/libc/memrchr_null.stderr | 4 +- .../fail-dep/libc/mmap_invalid_dealloc.rs | 2 +- .../fail-dep/libc/mmap_invalid_dealloc.stderr | 4 +- .../fail-dep/libc/mmap_use_after_munmap.rs | 2 +- .../libc/mmap_use_after_munmap.stderr | 8 +- .../tests/fail-dep/libc/munmap_partial.rs | 2 +- .../tests/fail-dep/libc/munmap_partial.stderr | 4 +- .../posix_memalign_size_zero_double_free.rs | 2 +- ...osix_memalign_size_zero_double_free.stderr | 8 +- .../libc/posix_memalign_size_zero_leak.rs | 2 +- .../libc/posix_memalign_size_zero_leak.stderr | 4 +- .../tests/fail-dep/libc/realloc-zero.stderr | 4 +- .../fail-dep/libc/socketpair_read_blocking.rs | 2 +- .../libc/socketpair_read_blocking.stderr | 4 +- .../libc/socketpair_write_blocking.rs | 2 +- .../libc/socketpair_write_blocking.stderr | 4 +- .../libc/unsupported_incomplete_function.rs | 2 +- .../unsupported_incomplete_function.stderr | 4 +- .../fail/alloc/alloc_error_handler.stderr | 2 +- .../alloc/alloc_error_handler_custom.stderr | 8 +- .../alloc/alloc_error_handler_no_std.stderr | 6 +- .../alloc/deallocate-bad-alignment.stderr | 4 +- .../fail/alloc/deallocate-bad-size.stderr | 4 +- .../tests/fail/alloc/deallocate-twice.stderr | 8 +- .../fail/alloc/global_system_mixup.stderr | 2 +- .../fail/alloc/no_global_allocator.stderr | 4 +- .../fail/alloc/reallocate-bad-size.stderr | 4 +- .../fail/alloc/reallocate-change-alloc.stderr | 8 +- .../fail/alloc/reallocate-dangling.stderr | 8 +- .../miri/tests/fail/alloc/stack_free.stderr | 2 +- .../miri/tests/fail/alloc/too_large.stderr | 4 +- .../alloc/unsupported_big_alignment.stderr | 4 +- ...unsupported_non_power_two_alignment.stderr | 4 +- .../alias_through_mutation.stack.stderr | 8 +- .../alias_through_mutation.tree.stderr | 8 +- .../both_borrows/aliasing_mut1.stack.stderr | 10 +- .../both_borrows/aliasing_mut1.tree.stderr | 10 +- .../both_borrows/aliasing_mut2.stack.stderr | 10 +- .../both_borrows/aliasing_mut2.tree.stderr | 10 +- .../both_borrows/aliasing_mut3.stack.stderr | 10 +- .../both_borrows/aliasing_mut3.tree.stderr | 10 +- .../both_borrows/aliasing_mut4.stack.stderr | 10 +- .../both_borrows/aliasing_mut4.tree.stderr | 8 +- .../box_exclusive_violation1.stack.stderr | 12 +- .../box_exclusive_violation1.tree.stderr | 12 +- .../box_noalias_violation.stack.stderr | 10 +- .../box_noalias_violation.tree.stderr | 12 +- .../buggy_as_mut_slice.stack.stderr | 8 +- .../buggy_as_mut_slice.tree.stderr | 8 +- .../buggy_split_at_mut.stack.stderr | 10 +- .../buggy_split_at_mut.tree.stderr | 8 +- .../both_borrows/illegal_write1.stack.stderr | 6 +- .../both_borrows/illegal_write1.tree.stderr | 6 +- .../both_borrows/illegal_write5.stack.stderr | 8 +- .../both_borrows/illegal_write5.tree.stderr | 8 +- .../both_borrows/illegal_write6.stack.stderr | 10 +- .../both_borrows/illegal_write6.tree.stderr | 12 +- ...invalidate_against_protector2.stack.stderr | 10 +- .../invalidate_against_protector2.tree.stderr | 10 +- ...invalidate_against_protector3.stack.stderr | 10 +- .../invalidate_against_protector3.tree.stderr | 10 +- .../issue-miri-1050-1.stack.stderr | 4 +- .../issue-miri-1050-1.tree.stderr | 4 +- .../issue-miri-1050-2.stack.stderr | 2 +- .../issue-miri-1050-2.tree.stderr | 2 +- .../load_invalid_shr.stack.stderr | 8 +- .../both_borrows/load_invalid_shr.tree.stderr | 8 +- .../mut_exclusive_violation1.stack.stderr | 12 +- .../mut_exclusive_violation1.tree.stderr | 12 +- .../mut_exclusive_violation2.stack.stderr | 8 +- .../mut_exclusive_violation2.tree.stderr | 8 +- .../newtype_pair_retagging.stack.stderr | 12 +- .../newtype_pair_retagging.tree.stderr | 14 +- .../newtype_retagging.stack.stderr | 12 +- .../newtype_retagging.tree.stderr | 14 +- .../both_borrows/outdated_local.stack.stderr | 8 +- .../both_borrows/outdated_local.tree.stderr | 8 +- .../pass_invalid_shr.stack.stderr | 8 +- .../both_borrows/pass_invalid_shr.tree.stderr | 8 +- .../pass_invalid_shr_option.stack.stderr | 8 +- .../pass_invalid_shr_option.tree.stderr | 8 +- .../pass_invalid_shr_tuple.stack.stderr | 8 +- .../pass_invalid_shr_tuple.tree.stderr | 8 +- .../retag_data_race_write.stack.stderr | 8 +- .../retag_data_race_write.tree.stderr | 8 +- .../return_invalid_shr.stack.stderr | 10 +- .../return_invalid_shr.tree.stderr | 10 +- .../return_invalid_shr_option.stack.stderr | 10 +- .../return_invalid_shr_option.tree.stderr | 10 +- .../return_invalid_shr_tuple.stack.stderr | 10 +- .../return_invalid_shr_tuple.tree.stderr | 10 +- .../shr_frozen_violation1.stack.stderr | 10 +- .../shr_frozen_violation1.tree.stderr | 10 +- .../shr_frozen_violation2.stack.stderr | 8 +- .../shr_frozen_violation2.tree.stderr | 8 +- .../zero-sized-protected.stack.stderr | 4 +- .../zero-sized-protected.tree.stderr | 10 +- .../miri/tests/fail/box-cell-alias.stderr | 10 +- .../branchless-select-i128-pointer.stderr | 4 +- src/tools/miri/tests/fail/breakpoint.stderr | 4 +- .../read_only_atomic_cmpxchg.stderr | 4 +- .../read_only_atomic_load_acquire.stderr | 4 +- .../read_only_atomic_load_large.rs | 2 +- .../read_only_atomic_load_large.stderr | 4 +- .../miri/tests/fail/const-ub-checks.stderr | 6 +- .../tests/fail/coroutine-pinned-moved.stderr | 16 +-- .../dangling_pointer_deref.stderr | 8 +- .../dangling_pointer_deref_match_never.stderr | 4 +- .../dangling_pointer_offset.stderr | 8 +- ...ling_pointer_project_underscore_let.stderr | 8 +- ...ject_underscore_let_type_annotation.stderr | 8 +- ...ng_pointer_project_underscore_match.stderr | 8 +- .../dangling_pointer_to_raw_pointer.stderr | 6 +- .../dangling_primitive.stderr | 6 +- .../deref-invalid-ptr.stderr | 4 +- .../deref_dangling_box.stderr | 2 +- .../deref_dangling_ref.stderr | 2 +- .../fail/dangling_pointers/dyn_size.stderr | 4 +- .../null_pointer_deref.stderr | 4 +- .../null_pointer_write.stderr | 4 +- .../out_of_bounds_project.stderr | 4 +- .../out_of_bounds_read.stderr | 6 +- .../out_of_bounds_write.stderr | 6 +- .../dangling_pointers/stack_temporary.stderr | 8 +- .../storage_dead_dangling.stderr | 6 +- .../wild_pointer_deref.stderr | 4 +- .../fail/data_race/alloc_read_race.stderr | 6 +- .../fail/data_race/alloc_write_race.stderr | 6 +- .../atomic_read_na_write_race1.stderr | 6 +- .../atomic_read_na_write_race2.stderr | 6 +- .../atomic_write_na_read_race1.stderr | 6 +- .../atomic_write_na_read_race2.stderr | 6 +- .../atomic_write_na_write_race1.stderr | 6 +- .../atomic_write_na_write_race2.stderr | 6 +- .../dangling_thread_async_race.stderr | 6 +- .../data_race/dangling_thread_race.stderr | 6 +- .../fail/data_race/dealloc_read_race1.stderr | 6 +- .../fail/data_race/dealloc_read_race2.stderr | 8 +- .../data_race/dealloc_read_race_stack.stderr | 6 +- .../fail/data_race/dealloc_write_race1.stderr | 6 +- .../fail/data_race/dealloc_write_race2.stderr | 8 +- .../data_race/dealloc_write_race_stack.stderr | 6 +- .../enable_after_join_to_main.stderr | 6 +- .../fail/data_race/fence_after_load.stderr | 6 +- .../local_variable_alloc_race.stderr | 6 +- .../data_race/local_variable_read_race.stderr | 6 +- .../local_variable_write_race.stderr | 6 +- .../fail/data_race/mixed_size_read.stderr | 6 +- .../fail/data_race/mixed_size_write.stderr | 6 +- .../fail/data_race/read_read_race1.stderr | 6 +- .../fail/data_race/read_read_race2.stderr | 6 +- .../fail/data_race/read_write_race.stderr | 6 +- .../data_race/read_write_race_stack.stderr | 6 +- .../fail/data_race/relax_acquire_race.stderr | 6 +- .../fail/data_race/release_seq_race.stderr | 6 +- .../release_seq_race_same_thread.stderr | 6 +- .../miri/tests/fail/data_race/rmw_race.stderr | 6 +- .../fail/data_race/stack_pop_race.stderr | 8 +- .../fail/data_race/write_write_race.stderr | 6 +- .../data_race/write_write_race_stack.stderr | 6 +- src/tools/miri/tests/fail/deny_lint.stderr | 4 +- .../tests/fail/dyn-call-trait-mismatch.stderr | 4 +- .../fail/dyn-upcast-nop-wrong-trait.stderr | 4 +- .../fail/dyn-upcast-trait-mismatch.stderr | 4 +- ...et-discriminant-niche-variant-wrong.stderr | 6 +- .../tests/fail/environ-gets-deallocated.rs | 2 +- .../fail/environ-gets-deallocated.stderr | 4 +- .../miri/tests/fail/erroneous_const.stderr | 6 +- .../miri/tests/fail/erroneous_const2.stderr | 8 +- .../fail/extern-type-field-offset.stderr | 8 +- .../miri/tests/fail/extern_static.stderr | 4 +- .../tests/fail/extern_static_in_const.stderr | 4 +- .../tests/fail/extern_static_wrong_size.rs | 2 +- .../fail/extern_static_wrong_size.stderr | 4 +- .../arg_inplace_mutate.stack.stderr | 10 +- .../arg_inplace_mutate.tree.stderr | 12 +- .../arg_inplace_observe_after.stderr | 4 +- .../arg_inplace_observe_during.none.stderr | 6 +- .../arg_inplace_observe_during.stack.stderr | 10 +- .../arg_inplace_observe_during.tree.stderr | 12 +- .../fail/function_calls/check_arg_abi.stderr | 4 +- .../check_arg_count_abort.stderr | 4 +- .../check_arg_count_too_few_args.stderr | 4 +- .../check_arg_count_too_many_args.stderr | 4 +- .../function_calls/check_callback_abi.stderr | 4 +- .../exported_symbol_abi_mismatch.cache.stderr | 4 +- ...exported_symbol_abi_mismatch.fn_ptr.stderr | 4 +- ...ported_symbol_abi_mismatch.no_cache.stderr | 4 +- .../exported_symbol_bad_unwind1.stderr | 6 +- .../exported_symbol_bad_unwind2.both.stderr | 6 +- ...orted_symbol_bad_unwind2.definition.stderr | 6 +- ...ted_symbol_bad_unwind2.extern_block.stderr | 6 +- .../exported_symbol_clashing.stderr | 8 +- .../exported_symbol_shim_clashing.stderr | 6 +- .../exported_symbol_wrong_arguments.stderr | 4 +- .../exported_symbol_wrong_type.stderr | 4 +- .../return_pointer_aliasing_read.none.stderr | 6 +- .../return_pointer_aliasing_read.stack.stderr | 10 +- .../return_pointer_aliasing_read.tree.stderr | 12 +- ...return_pointer_aliasing_write.stack.stderr | 10 +- .../return_pointer_aliasing_write.tree.stderr | 12 +- ...nter_aliasing_write_tail_call.stack.stderr | 10 +- ...inter_aliasing_write_tail_call.tree.stderr | 12 +- .../return_pointer_on_unwind.stderr | 4 +- .../simd_feature_flag_difference.rs | 2 +- .../simd_feature_flag_difference.stderr | 6 +- .../fail/function_calls/target_feature.rs | 4 +- .../fail/function_calls/target_feature.stderr | 4 +- .../function_calls/target_feature_wasm.rs | 2 +- .../function_calls/target_feature_wasm.stderr | 4 +- .../abi_mismatch_array_vs_struct.stderr | 4 +- .../abi_mismatch_int_vs_float.stderr | 4 +- .../abi_mismatch_raw_pointer.stderr | 4 +- .../abi_mismatch_repr_C.stderr | 4 +- .../abi_mismatch_return_type.stderr | 4 +- .../abi_mismatch_simple.stderr | 4 +- .../abi_mismatch_too_few_args.stderr | 4 +- .../abi_mismatch_too_many_args.stderr | 4 +- .../abi_mismatch_vector.stderr | 4 +- .../cast_box_int_to_fn_ptr.stderr | 4 +- .../cast_int_to_fn_ptr.stderr | 4 +- .../function_pointers/deref_fn_ptr.stderr | 4 +- .../function_pointers/execute_memory.stderr | 4 +- .../function_pointers/fn_ptr_offset.stderr | 4 +- .../fail/intrinsic_fallback_is_spec.stderr | 4 +- .../miri/tests/fail/intrinsics/assume.stderr | 4 +- .../fail/intrinsics/copy_overflow.stderr | 4 +- .../fail/intrinsics/copy_overlapping.stderr | 4 +- .../fail/intrinsics/copy_unaligned.stderr | 4 +- .../tests/fail/intrinsics/ctlz_nonzero.stderr | 4 +- .../tests/fail/intrinsics/cttz_nonzero.stderr | 4 +- .../tests/fail/intrinsics/div-by-zero.stderr | 4 +- .../tests/fail/intrinsics/exact_div1.stderr | 4 +- .../tests/fail/intrinsics/exact_div2.stderr | 4 +- .../tests/fail/intrinsics/exact_div3.stderr | 4 +- .../tests/fail/intrinsics/exact_div4.stderr | 4 +- .../fail/intrinsics/fast_math_both.stderr | 4 +- .../fail/intrinsics/fast_math_first.stderr | 4 +- .../fail/intrinsics/fast_math_result.stderr | 4 +- .../fail/intrinsics/fast_math_second.stderr | 4 +- .../intrinsics/float_to_int_32_inf1.stderr | 4 +- .../intrinsics/float_to_int_32_infneg1.stderr | 4 +- .../intrinsics/float_to_int_32_nan.stderr | 4 +- .../intrinsics/float_to_int_32_nanneg.stderr | 4 +- .../intrinsics/float_to_int_32_neg.stderr | 4 +- .../float_to_int_32_too_big1.stderr | 4 +- .../float_to_int_32_too_big2.stderr | 4 +- .../float_to_int_32_too_small1.stderr | 4 +- .../intrinsics/float_to_int_64_inf1.stderr | 4 +- .../intrinsics/float_to_int_64_infneg1.stderr | 4 +- .../intrinsics/float_to_int_64_infneg2.stderr | 4 +- .../intrinsics/float_to_int_64_nan.stderr | 4 +- .../intrinsics/float_to_int_64_neg.stderr | 4 +- .../float_to_int_64_too_big1.stderr | 4 +- .../float_to_int_64_too_big2.stderr | 4 +- .../float_to_int_64_too_big3.stderr | 4 +- .../float_to_int_64_too_big4.stderr | 4 +- .../float_to_int_64_too_big5.stderr | 4 +- .../float_to_int_64_too_big6.stderr | 4 +- .../float_to_int_64_too_big7.stderr | 4 +- .../float_to_int_64_too_small1.stderr | 4 +- .../float_to_int_64_too_small2.stderr | 4 +- .../float_to_int_64_too_small3.stderr | 4 +- .../intrinsics/intrinsic_target_feature.rs | 7 +- .../intrinsic_target_feature.stderr | 4 +- .../ptr_metadata_uninit_slice_data.stderr | 6 +- .../ptr_metadata_uninit_slice_len.stderr | 10 +- .../ptr_metadata_uninit_thin.stderr | 6 +- .../ptr_offset_from_different_ints.stderr | 4 +- .../ptr_offset_from_unsigned_neg.stderr | 4 +- .../intrinsics/ptr_offset_int_plus_int.stderr | 4 +- .../intrinsics/ptr_offset_int_plus_ptr.stderr | 4 +- .../ptr_offset_out_of_bounds.stderr | 6 +- .../ptr_offset_out_of_bounds_neg.stderr | 6 +- .../intrinsics/ptr_offset_overflow.stderr | 6 +- .../ptr_offset_unsigned_overflow.stderr | 4 +- .../tests/fail/intrinsics/rem-by-zero.stderr | 4 +- .../fail/intrinsics/simd-div-by-zero.stderr | 4 +- .../fail/intrinsics/simd-div-overflow.stderr | 4 +- .../tests/fail/intrinsics/simd-extract.stderr | 4 +- .../fail/intrinsics/simd-float-to-int.stderr | 4 +- .../tests/fail/intrinsics/simd-gather.stderr | 4 +- .../simd-reduce-invalid-bool.stderr | 4 +- .../fail/intrinsics/simd-rem-by-zero.stderr | 4 +- .../tests/fail/intrinsics/simd-scatter.stderr | 6 +- .../simd-select-bitmask-invalid.stderr | 4 +- .../simd-select-invalid-bool.stderr | 4 +- .../fail/intrinsics/simd-shl-too-far.stderr | 4 +- .../fail/intrinsics/simd-shr-too-far.stderr | 4 +- .../typed-swap-invalid-array.stderr | 6 +- .../typed-swap-invalid-scalar.stderr | 6 +- .../fail/intrinsics/unchecked_add1.stderr | 4 +- .../fail/intrinsics/unchecked_add2.stderr | 4 +- .../fail/intrinsics/unchecked_div1.stderr | 4 +- .../fail/intrinsics/unchecked_mul1.stderr | 4 +- .../fail/intrinsics/unchecked_mul2.stderr | 4 +- .../fail/intrinsics/unchecked_shl.stderr | 4 +- .../fail/intrinsics/unchecked_shl2.stderr | 4 +- .../fail/intrinsics/unchecked_shr.stderr | 4 +- .../fail/intrinsics/unchecked_sub1.stderr | 4 +- .../fail/intrinsics/unchecked_sub2.stderr | 4 +- .../intrinsics/uninit_uninhabited_type.stderr | 2 +- .../intrinsics/write_bytes_overflow.stderr | 4 +- .../tests/fail/intrinsics/zero_fn_ptr.stderr | 2 +- .../miri/tests/fail/issue-miri-1112.stderr | 6 +- ...ce-symbolic-alignment-extern-static.stderr | 4 +- src/tools/miri/tests/fail/layout_cycle.stderr | 4 +- src/tools/miri/tests/fail/memleak.stderr | 4 +- src/tools/miri/tests/fail/memleak_rc.stderr | 2 +- .../tests/fail/miri_start_wrong_sig.stderr | 2 +- .../tests/fail/modifying_constants.stderr | 4 +- .../miri/tests/fail/never_match_never.stderr | 4 +- .../miri/tests/fail/never_say_never.stderr | 4 +- .../tests/fail/never_transmute_humans.stderr | 4 +- .../tests/fail/never_transmute_void.stderr | 6 +- .../tests/fail/overlapping_assignment.stderr | 6 +- .../miri/tests/fail/panic/bad_unwind.stderr | 14 +- .../miri/tests/fail/panic/double_panic.stderr | 6 +- src/tools/miri/tests/fail/panic/no_std.stderr | 8 +- .../miri/tests/fail/panic/panic_abort1.stderr | 4 +- .../miri/tests/fail/panic/panic_abort2.stderr | 4 +- .../miri/tests/fail/panic/panic_abort3.stderr | 4 +- .../miri/tests/fail/panic/panic_abort4.stderr | 4 +- .../panic/tls_macro_const_drop_panic.stderr | 2 +- .../fail/panic/tls_macro_drop_panic.stderr | 2 +- .../fail/panic/unwind_panic_abort.stderr | 4 +- .../int_copy_looses_provenance0.stderr | 4 +- .../int_copy_looses_provenance1.stderr | 4 +- .../int_copy_looses_provenance2.stderr | 4 +- .../int_copy_looses_provenance3.stderr | 4 +- .../pointer_partial_overwrite.stderr | 4 +- .../provenance/provenance_transmute.stderr | 6 +- .../ptr_copy_loses_partial_provenance0.stderr | 4 +- .../ptr_copy_loses_partial_provenance1.stderr | 4 +- .../fail/provenance/ptr_int_unexposed.stderr | 4 +- .../tests/fail/provenance/ptr_invalid.stderr | 4 +- .../fail/provenance/ptr_invalid_offset.stderr | 4 +- .../provenance/strict_provenance_cast.stderr | 4 +- src/tools/miri/tests/fail/rc_as_ptr.stderr | 6 +- .../tests/fail/reading_half_a_pointer.stderr | 4 +- src/tools/miri/tests/fail/rustc-error.stderr | 2 +- src/tools/miri/tests/fail/rustc-error2.stderr | 2 +- .../shims/backtrace/bad-backtrace-decl.stderr | 4 +- .../backtrace/bad-backtrace-flags.stderr | 4 +- .../shims/backtrace/bad-backtrace-ptr.stderr | 4 +- .../bad-backtrace-resolve-flags.stderr | 4 +- .../bad-backtrace-resolve-names-flags.stderr | 4 +- .../backtrace/bad-backtrace-size-flags.stderr | 4 +- .../miri/tests/fail/shims/fs/isolated_file.rs | 2 +- .../tests/fail/shims/fs/isolated_file.stderr | 2 +- .../tests/fail/shims/shim_arg_size.stderr | 4 +- .../fail/should-pass/cpp20_rwc_syncs.stderr | 6 +- .../deallocate_against_protector1.stderr | 8 +- .../disable_mut_does_not_merge_srw.stderr | 8 +- .../drop_in_place_protector.stderr | 10 +- .../drop_in_place_retag.stderr | 4 +- .../stacked_borrows/exposed_only_ro.stderr | 4 +- .../fnentry_invalidation.stderr | 8 +- .../fnentry_invalidation2.stderr | 8 +- .../stacked_borrows/illegal_dealloc1.stderr | 8 +- .../fail/stacked_borrows/illegal_read1.stderr | 8 +- .../fail/stacked_borrows/illegal_read2.stderr | 8 +- .../fail/stacked_borrows/illegal_read3.stderr | 8 +- .../fail/stacked_borrows/illegal_read4.stderr | 8 +- .../fail/stacked_borrows/illegal_read5.stderr | 8 +- .../fail/stacked_borrows/illegal_read6.stderr | 8 +- .../fail/stacked_borrows/illegal_read7.stderr | 8 +- .../fail/stacked_borrows/illegal_read8.stderr | 8 +- .../illegal_read_despite_exposed1.stderr | 8 +- .../illegal_read_despite_exposed2.stderr | 8 +- .../stacked_borrows/illegal_write2.stderr | 8 +- .../stacked_borrows/illegal_write3.stderr | 6 +- .../stacked_borrows/illegal_write4.stderr | 8 +- .../illegal_write_despite_exposed1.stderr | 8 +- .../fail/stacked_borrows/interior_mut1.stderr | 8 +- .../fail/stacked_borrows/interior_mut2.stderr | 8 +- .../invalidate_against_protector1.stderr | 10 +- .../stacked_borrows/load_invalid_mut.stderr | 8 +- .../stacked_borrows/pass_invalid_mut.stderr | 8 +- .../stacked_borrows/pointer_smuggling.stderr | 10 +- .../fail/stacked_borrows/raw_tracking.stderr | 8 +- .../retag_data_race_protected_read.stderr | 6 +- .../retag_data_race_read.stderr | 8 +- .../stacked_borrows/return_invalid_mut.stderr | 10 +- .../return_invalid_mut_option.stderr | 10 +- .../return_invalid_mut_tuple.stderr | 10 +- .../shared_rw_borrows_are_weak1.stderr | 8 +- .../shared_rw_borrows_are_weak2.stderr | 8 +- .../static_memory_modification.stderr | 4 +- .../fail/stacked_borrows/track_caller.stderr | 8 +- .../transmute-is-no-escape.stderr | 6 +- .../stacked_borrows/unescaped_local.stderr | 4 +- .../stacked_borrows/unescaped_static.stderr | 6 +- .../fail/stacked_borrows/zst_slice.stderr | 4 +- .../fail/static_memory_modification1.stderr | 4 +- .../fail/static_memory_modification2.stderr | 4 +- .../fail/static_memory_modification3.stderr | 4 +- .../tests/fail/storage-live-dead-var.stderr | 4 +- .../tests/fail/storage-live-resets-var.stderr | 4 +- .../tail_calls/signature-mismatch-arg.stderr | 4 +- .../tests/fail/terminate-terminator.stderr | 8 +- .../tests/fail/tls/tls_static_dealloc.stderr | 4 +- .../miri/tests/fail/tls_macro_leak.stderr | 10 +- .../miri/tests/fail/tls_static_leak.stderr | 4 +- .../fail/tree_borrows/alternate-read-write.rs | 3 +- .../tree_borrows/alternate-read-write.stderr | 10 +- .../children-can-alias.default.stderr | 4 +- .../children-can-alias.uniq.stderr | 10 +- .../fail/tree_borrows/error-range.stderr | 8 +- .../tree_borrows/fnentry_invalidation.stderr | 10 +- .../fail/tree_borrows/outside-range.stderr | 10 +- .../parent_read_freezes_raw_mut.stderr | 10 +- .../fail/tree_borrows/pass_invalid_mut.stderr | 14 +- .../tree_borrows/protector-write-lazy.stderr | 8 +- ...peated_foreign_read_lazy_conflicted.stderr | 10 +- .../reserved/cell-protected-write.stderr | 10 +- .../reserved/int-protected-write.stderr | 10 +- .../reservedim_spurious_write.with.stderr | 8 +- .../reservedim_spurious_write.without.stderr | 8 +- .../tree_borrows/return_invalid_mut.stderr | 12 +- .../fail/tree_borrows/spurious_read.stderr | 10 +- .../tree_borrows/strongly-protected.stderr | 12 +- .../fail/tree_borrows/unique.default.stderr | 10 +- .../fail/tree_borrows/unique.uniq.stderr | 12 +- .../tree_borrows/write-during-2phase.stderr | 10 +- src/tools/miri/tests/fail/type-too-large.rs | 2 +- .../miri/tests/fail/type-too-large.stderr | 4 +- .../fail/unaligned_pointers/alignment.stderr | 4 +- .../atomic_unaligned.stderr | 4 +- .../unaligned_pointers/drop_in_place.stderr | 2 +- .../unaligned_pointers/dyn_alignment.stderr | 4 +- ...ld_requires_parent_struct_alignment.stderr | 6 +- ...d_requires_parent_struct_alignment2.stderr | 6 +- .../intptrcast_alignment_check.stderr | 4 +- ...romise_alignment.call_unaligned_ptr.stderr | 4 +- ...romise_alignment.read_unaligned_ptr.stderr | 4 +- .../promise_alignment_zero.stderr | 4 +- .../reference_to_packed.stderr | 6 +- .../unaligned_pointers/unaligned_ptr1.stderr | 4 +- .../unaligned_pointers/unaligned_ptr2.stderr | 4 +- .../unaligned_pointers/unaligned_ptr3.stderr | 4 +- .../unaligned_pointers/unaligned_ptr4.stderr | 4 +- .../unaligned_ptr_zst.stderr | 4 +- .../unaligned_ref_addr_of.stderr | 4 +- .../tests/fail/uninit/padding-enum.stderr | 4 +- .../tests/fail/uninit/padding-pair.stderr | 4 +- .../uninit/padding-struct-in-union.stderr | 4 +- .../tests/fail/uninit/padding-struct.stderr | 4 +- .../tests/fail/uninit/padding-union.stderr | 4 +- .../tests/fail/uninit/padding-wide-ptr.stderr | 4 +- .../fail/uninit/transmute-pair-uninit.stderr | 4 +- .../uninit-after-aggregate-assign.stderr | 4 +- .../uninit/uninit_alloc_diagnostic.stderr | 2 +- ...it_alloc_diagnostic_with_provenance.stderr | 2 +- .../tests/fail/uninit/uninit_byte_read.stderr | 4 +- src/tools/miri/tests/fail/unreachable.stderr | 4 +- .../miri/tests/fail/unsized-local.stderr | 4 +- .../fail/unsupported_foreign_function.stderr | 4 +- .../tests/fail/unwind-action-terminate.stderr | 6 +- .../cast_fn_ptr_invalid_callee_arg.stderr | 4 +- .../cast_fn_ptr_invalid_callee_ret.stderr | 4 +- .../cast_fn_ptr_invalid_caller_arg.stderr | 6 +- .../cast_fn_ptr_invalid_caller_ret.stderr | 4 +- .../tests/fail/validity/dangling_ref1.stderr | 4 +- .../tests/fail/validity/dangling_ref2.stderr | 4 +- .../tests/fail/validity/dangling_ref3.stderr | 4 +- .../tests/fail/validity/invalid_bool.stderr | 4 +- .../fail/validity/invalid_bool_op.stderr | 4 +- .../fail/validity/invalid_bool_uninit.stderr | 4 +- .../tests/fail/validity/invalid_char.stderr | 4 +- .../fail/validity/invalid_char_cast.stderr | 6 +- .../fail/validity/invalid_char_match.stderr | 6 +- .../fail/validity/invalid_char_op.stderr | 4 +- .../fail/validity/invalid_char_uninit.stderr | 4 +- .../fail/validity/invalid_enum_cast.stderr | 6 +- .../fail/validity/invalid_enum_op.stderr | 4 +- .../fail/validity/invalid_enum_tag.stderr | 4 +- .../fail/validity/invalid_fnptr_null.stderr | 4 +- .../fail/validity/invalid_fnptr_uninit.stderr | 4 +- .../tests/fail/validity/invalid_int_op.stderr | 4 +- .../fail/validity/invalid_wide_raw.stderr | 4 +- .../match_binder_checks_validity1.stderr | 4 +- .../match_binder_checks_validity2.stderr | 4 +- .../miri/tests/fail/validity/nonzero.stderr | 4 +- .../recursive-validity-ref-bool.stderr | 4 +- .../fail/validity/ref_to_uninhabited1.stderr | 4 +- .../fail/validity/ref_to_uninhabited2.stderr | 4 +- .../tests/fail/validity/too-big-slice.stderr | 4 +- .../fail/validity/too-big-unsized.stderr | 4 +- .../validity/transmute_through_ptr.stderr | 4 +- .../tests/fail/validity/uninit_float.stderr | 4 +- .../tests/fail/validity/uninit_integer.stderr | 4 +- .../tests/fail/validity/uninit_raw_ptr.stderr | 4 +- .../validity/wrong-dyn-trait-generic.stderr | 4 +- .../fail/validity/wrong-dyn-trait.stderr | 4 +- .../fail/weak_memory/racing_mixed_size.stderr | 6 +- .../weak_memory/racing_mixed_size_read.stderr | 6 +- .../tests/fail/weak_memory/weak_uninit.stderr | 4 +- .../miri/tests/fail/zst_local_oob.stderr | 4 +- .../native-lib/fail/function_not_in_so.rs | 3 +- .../native-lib/fail/function_not_in_so.stderr | 4 +- .../tests/native-lib/fail/private_function.rs | 3 +- .../native-lib/fail/private_function.stderr | 4 +- .../tests/native-lib/pass/ptr_read_access.rs | 3 +- .../tests/native-lib/pass/scalar_arguments.rs | 3 +- .../panic/alloc_error_handler_hook.stderr | 2 +- .../miri/tests/panic/div-by-zero-2.stderr | 2 +- .../exported_symbol_good_unwind.stderr | 6 +- src/tools/miri/tests/panic/mir-validation.rs | 2 +- .../miri/tests/panic/oob_subslice.stderr | 2 +- .../tests/panic/overflowing-lsh-neg.stderr | 2 +- .../miri/tests/panic/overflowing-rsh-1.stderr | 2 +- .../miri/tests/panic/overflowing-rsh-2.stderr | 2 +- src/tools/miri/tests/panic/panic1.stderr | 4 +- src/tools/miri/tests/panic/panic2.stderr | 2 +- src/tools/miri/tests/panic/panic3.stderr | 2 +- src/tools/miri/tests/panic/panic4.stderr | 2 +- .../miri/tests/panic/transmute_fat2.stderr | 2 +- .../panic/unsupported_foreign_function.stderr | 2 +- .../miri/tests/panic/unsupported_syscall.rs | 4 +- .../tests/panic/unsupported_syscall.stderr | 2 +- .../concurrency/apple-os-unfair-lock.rs | 2 +- .../concurrency/env-cleanup-data-race.rs | 2 +- .../tests/pass-dep/concurrency/linux-futex.rs | 2 +- .../concurrency/tls_pthread_drop_order.rs | 2 +- .../concurrency/windows_detach_terminated.rs | 2 +- .../pass-dep/concurrency/windows_init_once.rs | 2 +- .../concurrency/windows_join_multiple.rs | 2 +- .../miri/tests/pass-dep/extra_fn_ptr_gc.rs | 2 +- .../pass-dep/libc/fcntl_f-fullfsync_apple.rs | 2 +- src/tools/miri/tests/pass-dep/libc/gettid.rs | 2 +- .../miri/tests/pass-dep/libc/libc-affinity.rs | 4 +- .../pass-dep/libc/libc-epoll-blocking.rs | 2 +- .../pass-dep/libc/libc-epoll-no-blocking.rs | 2 +- .../miri/tests/pass-dep/libc/libc-eventfd.rs | 2 +- .../miri/tests/pass-dep/libc/libc-fs-flock.rs | 2 +- .../tests/pass-dep/libc/libc-fs-symlink.rs | 4 +- .../pass-dep/libc/libc-fs-with-isolation.rs | 2 +- src/tools/miri/tests/pass-dep/libc/libc-fs.rs | 2 +- .../miri/tests/pass-dep/libc/libc-misc.rs | 2 +- .../miri/tests/pass-dep/libc/libc-pipe.rs | 2 +- .../miri/tests/pass-dep/libc/libc-random.rs | 2 +- .../tests/pass-dep/libc/libc-socketpair.rs | 2 +- .../miri/tests/pass-dep/libc/libc-time.rs | 2 +- .../libc/libc_pthread_cond_timedwait.rs | 4 +- .../libc_pthread_cond_timedwait_isolated.rs | 4 +- src/tools/miri/tests/pass-dep/libc/mmap.rs | 2 +- .../miri/tests/pass-dep/libc/pthread-sync.rs | 2 +- .../tests/pass-dep/libc/pthread-threadname.rs | 2 +- src/tools/miri/tests/pass-dep/tempfile.rs | 4 +- .../miri/tests/pass-dep/tokio/file-io.rs | 2 +- .../miri/tests/pass-dep/tokio/mpsc-await.rs | 2 +- src/tools/miri/tests/pass-dep/tokio/sleep.rs | 2 +- .../miri/tests/pass/alloc-access-tracking.rs | 2 +- .../tests/pass/alloc-access-tracking.stderr | 14 +- .../pass/backtrace/backtrace-api-v0.stderr | 10 +- .../pass/backtrace/backtrace-api-v0.stdout | 10 +- .../pass/backtrace/backtrace-api-v1.stderr | 10 +- .../pass/backtrace/backtrace-api-v1.stdout | 10 +- .../backtrace/backtrace-global-alloc.stderr | 2 +- .../tests/pass/backtrace/backtrace-std.stderr | 10 +- .../pass/concurrency/thread_park_isolated.rs | 2 +- .../miri/tests/pass/extern_types.stack.stderr | 4 +- .../pass/function_calls/target_feature.rs | 2 +- .../miri/tests/pass/issues/issue-miri-3680.rs | 2 +- src/tools/miri/tests/pass/miri-alloc.rs | 2 +- .../miri/tests/pass/panic/catch_panic.stderr | 20 +-- .../tests/pass/panic/concurrent-panic.stderr | 4 +- .../pass/panic/nested_panic_caught.stderr | 4 +- .../miri/tests/pass/panic/thread_panic.stderr | 4 +- .../miri/tests/pass/panic/unwind_dwarf.rs | 2 +- .../miri/tests/pass/ptr_int_casts.tree.stderr | 36 +++--- .../pass/ptr_int_from_exposed.tree.stderr | 6 +- src/tools/miri/tests/pass/shims/fs-symlink.rs | 4 +- .../tests/pass/shims/fs-with-isolation.rs | 2 +- src/tools/miri/tests/pass/shims/fs.rs | 2 +- .../miri/tests/pass/shims/windows-rand.rs | 2 +- .../tests/pass/shims/windows-threadname.rs | 2 +- .../tests/pass/shims/x86/intrinsics-sha.rs | 11 +- .../pass/shims/x86/intrinsics-x86-adx.rs | 11 +- .../pass/shims/x86/intrinsics-x86-aes-vaes.rs | 11 +- .../pass/shims/x86/intrinsics-x86-avx.rs | 11 +- .../pass/shims/x86/intrinsics-x86-avx2.rs | 11 +- .../pass/shims/x86/intrinsics-x86-avx512.rs | 11 +- .../pass/shims/x86/intrinsics-x86-bmi.rs | 11 +- .../x86/intrinsics-x86-pause-without-sse2.rs | 11 +- .../shims/x86/intrinsics-x86-pclmulqdq.rs | 11 +- .../shims/x86/intrinsics-x86-sse3-ssse3.rs | 11 +- .../pass/shims/x86/intrinsics-x86-sse41.rs | 11 +- .../pass/shims/x86/intrinsics-x86-sse42.rs | 11 +- .../stacked-borrows/issue-miri-2389.stderr | 4 +- .../miri/tests/pass/tls/macos_tlv_atexit.rs | 2 +- .../miri/tests/pass/tls/win_tls_callback.rs | 2 +- src/tools/miri/tests/pass/wtf8.rs | 2 +- src/tools/miri/tests/ui.rs | 120 ++++++++++-------- 709 files changed, 1884 insertions(+), 1991 deletions(-) diff --git a/src/tools/miri/Cargo.lock b/src/tools/miri/Cargo.lock index e4bfd9bd122..002c44b0cc5 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 d8cfa5b886d..30cea9da373 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/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 d6604f37139..546909a13ea 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 7e890681c43..3fd02d38aae 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 ddd8b572eaf..4cbd34329f8 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 3724f7996fb..0b5dfe4ba61 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 eb98adeba07..a13e8573395 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 644462a1b05..3b02936b1f2 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 aed467552ab..2bef8bcca4d 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 6a8d12fa807..192e1cdc475 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 f22f17be0df..047fe07df14 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 899c217efbf..4cf1b4af12a 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 index a15451cb319..6e90c490a23 100644 --- 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 @@ -1,5 +1,5 @@ error: Undefined Behavior: pthread_cond_t can't be moved after first use - --> $DIR/libc_pthread_cond_move.rs:LL:CC + --> 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 @@ -7,9 +7,9 @@ LL | libc::pthread_cond_destroy(cond2.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 `check` at $DIR/libc_pthread_cond_move.rs:LL:CC + = note: inside `check` at tests/fail-dep/concurrency/libc_pthread_cond_move.rs:LL:CC note: inside `main` - --> $DIR/libc_pthread_cond_move.rs:LL:CC + --> tests/fail-dep/concurrency/libc_pthread_cond_move.rs:LL:CC | LL | check() | ^^^^^^^ 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 index e4e84eb9fd0..8fd0caac751 100644 --- 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 @@ -1,5 +1,5 @@ //@revisions: static_initializer init -//@ignore-target-windows: No pthreads on Windows +//@ignore-target: windows # No pthreads on Windows /// Test that moving a pthread_cond between uses fails. 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 index 4e4188e2a12..ba726ac7f38 100644 --- 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 @@ -1,5 +1,5 @@ error: Undefined Behavior: pthread_cond_t can't be moved after first use - --> $DIR/libc_pthread_cond_move.rs:LL:CC + --> 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 @@ -7,9 +7,9 @@ LL | libc::pthread_cond_destroy(&mut cond2 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_cond_move.rs:LL:CC + = note: inside `check` at tests/fail-dep/concurrency/libc_pthread_cond_move.rs:LL:CC note: inside `main` - --> $DIR/libc_pthread_cond_move.rs:LL:CC + --> tests/fail-dep/concurrency/libc_pthread_cond_move.rs:LL:CC | LL | check() | ^^^^^^^ 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 d0ccab4de5b..90e33d58673 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 ef75b03162d..f2ddf9ae92e 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 9cd0a35d36e..d4a9f076bfd 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 39b1c3007cb..d4accdba5d7 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 fc2ab71dff7..0af3600854d 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 e89d7a9f02b..472d07f617e 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 7238dfb40b7..327737a0b3f 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 cbad743ca56..988c33868a6 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 e501a086cca..1dd1cb9f731 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 002498e6c82..b47c0121a3e 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 e27e88dda2d..b04a18561fd 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 f5b687a623f..6a49625d75d 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 6a7b237e5b3..1ada476811e 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 4bc1c82a254..53760b05a31 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 258c5f26c7a..6aa85086a83 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 0a494c53b4b..a79abe65328 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 3675ce49f30..e9961ed413d 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 0328115c637..e3d5da26aea 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 079c1729b60..534cacaed59 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 6723f2c6e77..d9293f938b6 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,4 +1,4 @@ -//@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. 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 4d41141b545..a57d10753d9 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 e474712cfd9..35998c95f6f 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 ed5e27b607a..38f38b4283a 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 46f0c5f8d72..1792c227e13 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 05b35ee3b30..72ad2db75aa 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 5ca6acc3fbe..15f397d4ac2 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 229335c97ce..c12a97a9ca1 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 c3632eca43f..ebc253bf7a6 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 f311934e28b..b38582482b8 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 334c14ebf04..4337475963e 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 2b5886dc163..50b55049050 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 d717b4ec56b..db08496889e 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 686a394f7cb..84c72fd9ba1 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 b8ec2d6d018..97c92e828e6 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 51f00d62b75..3711c1f8dc1 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 a8425e6f81d..4c39ca003ec 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 fa4575bc1d4..f2c19f98103 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 bb90545c503..0a964da82a6 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 e734a62bca8..200477467af 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 7210c6a742a..cfdadbefe4e 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 e96f7fc6803..6a31e972e68 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 5032e98f116..41c189f3efd 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 dffeee2b794..5de70cb38a1 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 957458a7ba0..5b5d35bf195 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 328372b22ef..d59c9423818 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 a964a64284a..d2fccfcc3f0 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 ced6b7a4f61..ca0444a7b43 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 98b09472904..da2a650151d 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 4174751926d..3a985122e22 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 d03c6402d64..ae77d79fcd4 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 099b8dcd106..708192ddccc 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 d6cceaff166..24c1a993652 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 43b3ab09bb2..6d7bb80d8e6 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 73c5e77a1bc..4f463464130 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 2704ff15441..c7bacbacd87 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 3ba99e3db4a..e76ce84e757 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 9a2cd09f083..21559e2e58f 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 c9c22dea655..906311144e8 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 index b51bae79849..540729962a9 100644 --- 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 @@ -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/libx_pthread_rwlock_moved.stderr b/src/tools/miri/tests/fail-dep/concurrency/libx_pthread_rwlock_moved.stderr index 8a5ec4aa98d..ce08fa8159c 100644 --- 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 @@ -1,5 +1,5 @@ error: Undefined Behavior: pthread_rwlock_t can't be moved after first use - --> $DIR/libx_pthread_rwlock_moved.rs:LL:CC + --> 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 @@ -7,7 +7,7 @@ LL | libc::pthread_rwlock_unlock(&mut rw2 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/libx_pthread_rwlock_moved.rs:LL:CC + = 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 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 0e9eb24459c..63e7eb113dd 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 19bfe56395e..947d665b95a 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 532bda20136..e28b0343135 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 12f35fdeb02..23a9f8f9c28 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 a64265ca0ca..4d48e839bb4 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 8d26c35de8a..4e640296dbe 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 c41d1d18018..d7d5c59e1bc 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 38414623ccb..5a226c6a44b 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 9a33cdccd27..0caba9059ef 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 91c67823320..bde7f5b515e 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 a1895feb957..c7d8bacd379 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 f85234f5627..904a1677b80 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 42b7e2b7838..7911133f548 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 e1b1b053bbc..029eeab4044 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 3c62015a051..3ef194c5c71 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 9abe145ea9e..bb7e8cef5dc 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 6d951a3a7b3..2c676f12b4f 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 7a2757557ef..9227bddf5a8 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 624f584a0c8..ff95beb3a9f 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 baa6eb5ad6a..1be2f08dd8c 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 d783967f959..b763121080e 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 0988eefe222..971a2d76053 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 683c55e90e1..81e5034f117 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 37323faf560..9726a1d2a97 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 98ef454c88b..dd2dd346231 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 e4c7aba07e3..980d9810abc 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 fb2426f7b66..03d4b2d6633 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 6f9b988d4ee..59797145c20 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 fb9a23206c6..0212a63bd0f 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 fdd0b4272ca..aff30c81ebd 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 2037a516dea..ed6ad466901 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 f12c0ddfb17..2b606605794 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 6437c9dbeb4..d6337c059ba 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 657262b8d41..6f3d7fa7a4f 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 f03ae33ed9f..6d3ff176c35 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 4bca5a3db07..a4ca205c377 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 6adaaeb3dbf..d7b046c1823 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 b2da332df21..336113e3440 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 1fe637d6ce7..8b34ff4ac2e 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 a9ed58d61bb..ce759f3e17a 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 9d55a493554..53ca14e6e89 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 cec67b6ef84..193c9f1eccc 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 05ac232f5d7..6831734a31b 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 49f2b84baa8..8404aeb5a7a 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 4386dc71af6..58aab14ef1d 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 39825eb27c0..7b1703a968a 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 b6b7b007f2b..be5d372a048 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 3ed117c5a0a..1d73ec95754 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 1a4c9605fe0..2f990b34ab5 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 2639031f1cc..4546185b13e 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 749a61f7396..6f8095dbba1 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 c28a6d966fe..ffa4e36f0f4 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 b5ed72d9f1b..dff332f9992 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 e2fbc0ae4b4..e83197dfc0f 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 7b3a0d27636..0dd89a15c7c 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 cd8422f4afd..b23b90d6fcd 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 f62622e29bf..a92a97cef3b 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 d1731a0f420..3642f3f28ca 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 5d9c2e2fb4c..d12e119bce3 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 6b98f6f75d8..f495d65a8b0 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 d340413d231..f07db3c62c9 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 b661b49c9f3..c913bde04cc 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 32cdfa0d228..9e6ce3d45a7 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 287a1f1a3e3..4c355c511ef 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 82bcb48cbe6..e08a747f7fa 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 965cbc4dd03..6f6c8850603 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 fb3b035b116..17b40fbdcdc 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 9a582b9b4cf..06960380f6c 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 36e78c1b7fb..7d7cee133c6 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 77dcf91d843..03e54088e3b 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 4c783b866c8..8eb71f5ce84 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 69a6c375f47..0a36d3d58b6 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 6903a52f304..d7e7c2bc039 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 0bd196eab1b..c146658d310 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 4f9e6222db2..170027d9f90 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 3aff0a41de2..62ab1c4f872 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 54679d177da..274dc22a7e1 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 d8602a54c64..f3d7a016825 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 b04139f3bd9..a89baa50ff3 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 83191962a3f..ba9197a50d6 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 b3e97c92f1a..bdda7139490 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 b1f1e231e5a..5162368b51f 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 bed0b880c3a..0cffdcd21c4 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 27d987feb57..075df9982c6 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 a9ea7a9e9c4..3dc3f8c6619 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 95cf37c8123..c788e455c8d 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 d2bf4c6a59c..4e5355f5653 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 16e87c4d4eb..bad42343c00 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 71d962a5523..28be7607aa3 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 aaf7c2256a7..c734f257a40 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 3a9faeb80ee..9df441cb956 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 6241c9db0d2..cd415ad6de9 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 16f8a3cbd02..2a517941de5 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 dec2bb6880f..38bc957cc33 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 b5484745c41..e75334508ff 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 2e161ceea88..31599a767cf 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 11edbc3270c..b5df1653289 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 9fa52262f7e..c3b836a8aa7 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 c6666ceac2b..0010ce0e4ed 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 2cf476c837c..b47fb81f5f4 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 64bbbfcd848..cd27bb818e7 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 64bbbfcd848..cd27bb818e7 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 04494b52561..04e5765371e 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 04494b52561..04e5765371e 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 e78807ec1c8..ffc73ee43de 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 0fcfc20e436..4610739739c 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 264503f2f2f..92df9bcbe38 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 5b4ee4a8913..46660d31295 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 35d418f574c..42e30cf10c9 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 d3bc54b7ef3..a9b1b49e385 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 9f545e5687e..f428447230a 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 a344229eeb4..ef1aa74ddf4 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 a4111f6f5cc..0410c2488db 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 321ef39e62b..28fcd1411f9 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 9717dd16b5b..79d3538e920 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 60de8417c10..fffa83a9628 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 57c4a756cf7..108c78abef5 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 97a6efa9f6a..59750d56470 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 dfc99ff7cd2..5aca026cb76 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 f687b3f867f..de63c9609a6 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 e4ebe22b60e..16c2af081ad 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 845838f93d5..d2a727a920d 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 6f4b52fb887..6bc66f24192 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 fa0012f9b26..510e592539f 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 858afa6fb3c..0ac3ed9db35 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 0d19681f637..cc51f4c77ee 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 ab67bb516ff..d8e0f52ff02 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 e7703729251..7a7d8f20fa8 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 22a55f0d37c..38b8758964b 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 a5c6be3f13a..57b4f5fbe2d 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 52ac2184d49..22efda1efae 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 45b3bceb728..2e544583cb2 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 e05ffb3d35e..7e6d057a4b6 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 96c2e39edd2..17c4542e195 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 672682ff294..c01fa2a86c2 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 e7988330589..18d1fb69395 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 697cee52d13..f9cc6003dc6 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 655e682636e..d9de23dc912 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 a5666d52a2f..ca98e81f1f4 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 f3e1796f3c9..62ade0a6793 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 b5b0cbb04e0..c2c6ce987e5 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 d7fa84e0ca1..7613552b4b0 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 7d38a5649a5..032cbccaf9b 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 b9fbadb1f89..076d6880461 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 05e8c95166c..ffb525e3981 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 8f7ba156a93..14dfa43b2d6 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 c2b5d7b23cb..ff39e147573 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 a5c031b9496..99194d6e072 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 ee02c1040c7..2d7456c15b9 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 d989bff4516..09a201983b1 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 eb4482f5cae..82802f02b99 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 c0d989dc1a0..364d193b0c5 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 7d43857b9bf..f3596347f61 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 1b97265eb32..d87a8bc59e9 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 3d75e7a0254..39d861a6388 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 4bfac8f9657..27a437c7483 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 8a774c21bb7..813bcef54f1 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 6ae9f05d173..1056a739a43 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 d5c53e4ad64..c617dfdb3a6 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 2d4fbafd8b7..9061121494d 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 1d8eed3d30a..3e7aac4724d 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 59ed5fe9cf2..e6ee9ce81fd 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 9770684fc52..97b54609ade 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 a1132ed2067..d3d6ed2e311 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 865357cb0ef..ea535ddac4f 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 355ea48f117..fe65eca4bc6 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 500cd09a333..4393cc3c093 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 0b870f13bb2..5a7f90447f0 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 dbbf6bf1ef5..9ee4f16d0d5 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 1b02880b998..1051a1c51f2 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 7f6ba5ee040..23a99ff6c8a 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 a4a22a8d71e..8eb4ebbcf72 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 dbf9acd23b6..1a2b048572a 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 e36376d0c75..ce9719b1d46 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 0c6cd9bbd93..48d974241aa 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 30093735313..077d4588266 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 4c16162fa1f..2b531b6440c 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 686d9b48e53..5d5d1c8cc68 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 776cf7c17b9..03b3c6f8f0b 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 f46eb078a51..51a4c5cea30 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.stderr b/src/tools/miri/tests/fail/data_race/local_variable_read_race.stderr index d14c2fb47ff..3faffd4131e 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.stderr b/src/tools/miri/tests/fail/data_race/local_variable_write_race.stderr index d84db955a3d..24bbe227f9e 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 5b25c666f41..31a798a89b1 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 c6157b87b38..c30b48c1f32 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 37ef46335d4..e97c4a4fdcb 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 e0cabf62a25..d64032db7b3 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 8558db4bfdc..eac5a0c8a6c 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 7ca249a917b..9af78bc79a3 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 b5e6895302f..a358d8da364 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 e031c55ecb1..f47e463dd63 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 86183e1e43f..2d26d4cf68a 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 2aa27cc8c7f..4a991db32d6 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 683acc1abd2..643426aba99 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 37b758ab2a5..2ea54421b89 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 2503a4f4ba8..0cd9de11318 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 d1c9b481807..fe96edf9346 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 019a55bcdcb..3680a84fac2 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 4165d5ea15d..54d9d385e96 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 87b1361c3e5..2129fe66e9c 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 a48a0a993da..4e2b9c03eae 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 5391a9176d0..84618abc6db 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 c9bda00493e..bb3fe1cec73 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 ab036247a31..3528620cb6a 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 22274367074..76f8cbcd289 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 c07b63e0c03..1ed440c7a33 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 c7ab128e2fe..c0bedbbcbf9 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 aa524c06469..067a2a2b643 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 fee3c38c25e..56c3ddd3516 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 3c013a5d15d..1af84e23682 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 609426bb289..d9ab782986f 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 c187d24e5e8..677952b39da 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 2cd9966bbf5..7fd71c60847 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 1c73577f5cd..032bbfa8f18 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 68b7c0307c8..efdd6129d74 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 64888cce613..5746ad1e13d 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 2f24425ed1d..bf1fbb7721f 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 d475801f41c..687d0538b3c 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 ad952804ecc..d778eae64fa 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 3b1df8a9d42..dfec2a86287 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 890fed09e48..6b0692e1c6e 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 2feba7d8e34..e4302ad1d3a 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 0537508babd..9f40c48b338 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 2feba7d8e34..e4302ad1d3a 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 a11a2b95689..5f306cc8ab1 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 12425cc4892..aef45042e8b 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 12425cc4892..aef45042e8b 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 f9e299bf5d2..a81e8226e5a 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 2f561ed88e3..e9e580ffc86 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 d51156b3c33..fb9cc47c7a8 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 69b710b3d3b..1ff9aa36f1e 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 96b483059b0..29c87e8c437 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 e8b766d0b0e..9da2c3589da 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 941470e9295..b009b0901c4 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 715ee330619..6d2cbe9b7cd 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 51cb270dd2e..54f9a7aebd6 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 66ca1027edc..693534be2e0 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 7e527a440d1..520937beaeb 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 b1f2cab031e..a879189d0c1 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 83efc9974e8..db876cb5ce6 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 e98a3abadf5..200f1062a3e 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 2544421c7e8..1d5b331be6c 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 84e01eb4803..32207ffae48 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 4d3cf6e9d3b..937bd4a5951 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 bd400e8824a..28d3d4a6054 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 dc0aca77f9e..9cc81546531 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 2b2a898ce73..521cececc37 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 752e17116d1..20704299257 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 907a8e50c41..3e3d07e1484 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 8ec19db813a..6b92824494a 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 3793590f842..51539b078ae 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 0c533c14173..16a83b8e342 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 2e50d054e77..760826805c7 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 facfe9d31f2..9552250546b 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 ef4b60b83b1..021be890d25 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 f95a62535d8..6112e92c939 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 347afa77053..f2d9933188d 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 b5cee95d66d..f7cc82b80df 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 4370e6d6a29..e0573184282 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 e66ab681860..4ed09683c63 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 db3941a32a5..a36b0fca802 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 7fa6f7b5bfc..eadbd2c0d58 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 b7c92cf4a57..c50c7c1ef43 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 e9ea262caf7..fef5a0a82a0 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 d190f3de6b8..2d0edd4e6cb 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 9889daaa851..5ad3b8ad2a8 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 0f75657e170..d0263ac1e45 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 9f66e63ca5c..e276874ba25 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 ca6125ab899..f133baecfa2 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 306e9bdc238..315417fe8df 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 cbcb093a4e6..42f52540a4c 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 1b903bc97ae..723ed4e49ed 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 feba0c5991c..7579a81e3e1 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 b26b5a37215..8295ec1089f 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 5b24d225026..8ddbd4cc19e 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 cb46aa97a8d..0fde006b3bd 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 2de8f3420b7..bcc8ff667ff 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 53ed208bdee..9ac910c8d2f 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 afda7124c11..b377b701361 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 8ba46de8641..2a0dcdfaeef 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 9f4b2af2167..45be75e2f02 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 a8e56ddb59b..8597dc0b072 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 a966e2e639c..d79004e6429 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 6115b381ebe..6a1d48f4807 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 5db9fb1417c..d77544cb37f 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 3e8dadb79e4..c6f9eb41138 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 cb59974bf45..fc80f1679ce 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 68697060515..01059ed5a73 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 505a6463cd3..f17d502d51c 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 bcfd394686b..9379be3f82f 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 ac6139d7e7d..1c0a0e0e88b 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 e289b4c0fc0..54ff73d5961 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 657c72daa6f..b622867c097 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 2a61b5fe15f..ffb8b0d1743 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 1b4b76ced18..8c5d81e01c2 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 47df8d90c06..237540e2a64 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 c5eb405ee95..d1b9076d14b 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 e7d12a18a2a..bc167cd0693 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 3d8366c725b..60c637b02de 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 eb5a16360ff..947af681bb4 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 8e83d20854f..a846fc5dec3 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 6478dcc2507..16708ec275e 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 84023cf7937..ed7acfaa1e0 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 0e218de0eeb..4e0b8d9a429 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 bf36c54ac78..7ef66390fcd 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 e436f9029d5..a0a8e97e7fa 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 8d37da65061..c87ce321784 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 2cd02bee2ca..78239d50137 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 c4548200f05..4f6b45b897b 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 8041e1542c6..2dd4c943e86 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 ee5aebc6eae..d03c9f870e2 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 43cd80a6d3e..a5f046ec403 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 9b9fe4da139..cb5ddc80dda 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 44d3749d682..b3579758f8f 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 85058b008ee..1144f8cf706 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 dc6b22de492..fdf08e8303f 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 d75fefe1ded..e34ebd3d7f7 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 bc8d0b041d3..ee1c9009610 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 b6c43d34b9d..db76897faed 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 d29d22d8aef..ec136a62ff2 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 aae77edcb6b..aaacb94f458 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 1f978e13bb9..9acb51d8c5f 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 e0c05474831..52b497046d0 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 475067db801..f7dfd0743f1 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 0d6307837de..52259635d21 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 15f01c1c095..20b20412e75 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 262ca202f9f..6062465f36a 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 eae9ec7a44d..f6fe453587f 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 6a0dcfcd227..0fd1e8ff91c 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 9dc4bcaee2f..f7aef4914e2 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 e37d9827c8c..ad7bbaebeec 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 949077ce61d..75de5d2338d 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 f30cf4479e6..fcf6e1aea0c 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 a572f34b92c..c38139e4c29 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 22e0b1a0d9e..e95227fe89f 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 39bfd8a2384..fdd30186c3c 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 604eba99e01..c27bb32c9da 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 67fd60e572e..ffc3a3eae96 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 326c180fadb..71f53a31992 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 7ac65c152e9..ffbbd269216 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 4064d7fe4e9..91f90959550 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 cc343d6431f..9f53de35239 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 d3032255166..89db0f1eb16 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 91166384adc..820e10743bc 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 62171917116..4c60f3be0d2 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 c1eca7866ad..2d8e4dfd8a5 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 751894f1985..e59a028b15b 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 1720cc893ab..7d2952003b2 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 6916c935995..a00c244841e 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 4ca306373a1..1906a68bffe 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 54e104e3513..0ce2e4a0981 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 c08fe5153b1..c152d1a9605 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 0395fe418d9..3e00821796e 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 40f6cf1fc0b..c1cd53e310f 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 6c7cac23bec..c5f04d581ca 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 1eda5449d1b..535cddfd4d4 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 5c7c5e17bee..e74cf342e3f 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 c8104f570f6..3983d169bdd 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 778061490f0..d93062b4bdc 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 367e2ee1f0b..c0a2a30dbe1 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 26afe8830cf..7291f5bce8d 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 fc012af3ad8..24a8d787407 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 375262655d0..14855a723b4 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 8402c7b5e13..2d5b9783098 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.stderr b/src/tools/miri/tests/fail/provenance/int_copy_looses_provenance3.stderr index b50e23da96a..62e3bd2e954 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 1ca35be8cb2..6bc92fffd5a 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 8a1d39effbd..7403f4382de 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 ed38572a5f3..5ed83951c60 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 2e11687175a..3675653cbe7 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 e21872244f6..1b6518612ef 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 bd0a9eb0d29..84347ec7a11 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 35e5c08300f..3910bc4df4b 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 8c61b66ac46..ab7d8db1a31 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 83d85f8adff..0fcb0faf497 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 cba8a9f8439..92179644169 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 3f911c172d4..31d9946c411 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 de2861a019c..cfbf305d3bb 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 159a02f2c03..346cc77df1b 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 504485e3b3a..a8d531c5123 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 523c935762f..7ae9558fad7 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 c1f0ce3d1a8..d79ae1ec414 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 fc270593e63..ff3176a789b 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 2d70733334d..da287e564e3 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 2f27e95297b..e81f0ff4260 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 ec956f83348..e611d6e28f8 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 b40d02ac345..e17fe9019ff 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 966279723c4..5185845568e 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 31a6722ea0c..f4cfa49c156 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 aa26a003f22..2d0209d1a2a 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 5147bcd458c..f107ea2023d 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 6b8465804a5..eebedf842ef 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 201bdcdeb97..861dd75bb22 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 2a841aa0a8d..1a71feee7a1 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 42f042bfad2..0b5b005881e 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 d06584d19d7..ddf8dbea31f 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 2dfb660c53c..bc719f9f205 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 ce3b920c1dc..d1bca88d05b 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 2c81fda1411..6a6701aae19 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 98bfd56cd3c..0d460df3929 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 e3b18e7d4f8..9862d8a1a34 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 415a85bd68c..31c5ad160a9 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 248ae62d5eb..4ae41dd8ee6 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 fd5ed383f1a..fc07c3174ba 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 33fcd11ff7a..18a47bb3462 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 a948c5df166..245bce19938 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 65b4fc5f3fa..595d0ca7588 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 08d9f33a169..6805b359367 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 4ee5ec38539..0134987caf3 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 70e9038bab3..42e088dc075 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 f8bc1667ddb..3d43bf7e6bf 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 a69fc6ff8ba..a7a1521bd63 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 96cdce5a778..5956a3f6753 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 9d707c3f85d..733162acff7 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 0a017e18264..c910a05de1c 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 1fddcaf3dad..58c6cd4c318 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 0d07d154ba5..aa320ea908c 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 47ae4b5d46d..fd5d83211db 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 9fe9fbeda44..87155ebc518 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 78008e92642..760ed783175 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 b9ae34df077..3175e099620 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 7522115c516..2cc3ba2c9a9 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 b5106c9d940..56d9783367b 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 ccea83db857..8ca56afc121 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 f605fa9d3b9..b86a64623ba 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 f341222a664..163ec84281d 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 7d8132b85c8..becd6681eca 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 50c02b3455e..08c2cf2099b 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 7578b89708a..fb48edc5ddd 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 acae479ced2..01e3c60f0fe 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 877cf1d6e47..2b2cd4af3da 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 77bbace4696..99c7f15d9ff 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 a04609805cb..cb37a2a2dab 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 ccc77b1c978..f370c284831 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 07d39cc9d6b..099dd3a1f7e 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 8823ab9b970..db8ab7cb460 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 6384689c563..e1c0fabd03d 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 a49933b7d05..3a45dbfb583 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 e4854328155..512932b3cb8 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 06d71fb4568..24306cca7ff 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 122a8ff8752..fee88cf3486 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 bd969d089c3..1294b52c051 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 87286f1a1a6..b9651e21ece 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 cdfa8a74238..83c506abb2d 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 090ae4507bd..dc4d7c1f7ff 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 dd5d27107fe..6b8e8fc1147 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 715228028bc..39fb956f739 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 87844ff4011..15f257c3d95 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 84fbc91e686..f6da0b8ec52 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 955abd144c7..bb07776da61 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 963e8e5eca9..d81ecff6ccc 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 133a50938f2..03f79fe0a5d 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 a4dc123979e..a9683c9e614 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 0e4517e9010..47341e027d7 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 cbeef90243b..504b8cc0ac7 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 ca8c45d36f9..81fa3262877 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 f3934d4cbe5..bd26b4e36df 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 2a7f69ff202..f6197a2acb3 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 bce8cb011f6..c7d72f70f40 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 7323cd1c5ad..4ecff3ea0e1 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 87589299cb1..b85aac7db76 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 81ecc6145d7..46e3ac2d6ca 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 b07bb84e348..15ad8f1764d 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 ca3d34661d3..8bbb4dfdb60 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 161e8977bf4..a9da740be1d 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 600028337fa..75efa5ff806 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 05e30f833bb..72cded1c079 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 9046502975d..04ecf618fc0 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 0d0057a79ab..da5a34a8dc6 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 318004da601..e0e866b25c8 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 6d62db4d3d5..91df7cf47a7 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 0842ccd6d5b..1e984aa3efd 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 3f7ced0b407..c687d998613 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 938a0375729..9adbd7f8153 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 ae3be1ed3af..90cfb4245c8 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 2b926027498..57ac8553930 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 5ac4e23bf01..d8ab546af6a 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 4de90118b4b..5fe342c9b31 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 72db125074b..1ae8d954882 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 448023a2a3d..d7561c57a8c 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.stderr b/src/tools/miri/tests/fail/uninit/padding-enum.stderr index 312cf6d20fa..66d3092c9ba 100644 --- a/src/tools/miri/tests/fail/uninit/padding-enum.stderr +++ b/src/tools/miri/tests/fail/uninit/padding-enum.stderr @@ -1,5 +1,5 @@ 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); | ^^^^^^^^^ using uninitialized data, but this operation requires initialized memory @@ -7,7 +7,7 @@ LL | let _val = *c.add(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/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 d35934d83d5..f4ce802b157 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 e122249af16..5e9dabd5644 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.stderr b/src/tools/miri/tests/fail/uninit/padding-struct.stderr index 19e3969279b..f27783c17e9 100644 --- a/src/tools/miri/tests/fail/uninit/padding-struct.stderr +++ b/src/tools/miri/tests/fail/uninit/padding-struct.stderr @@ -1,5 +1,5 @@ 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); | ^^^^^^^^^ using uninitialized data, but this operation requires initialized memory @@ -7,7 +7,7 @@ LL | let _val = *c.add(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/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.stderr b/src/tools/miri/tests/fail/uninit/padding-union.stderr index 61a8d1c6ba6..248b06a14fe 100644 --- a/src/tools/miri/tests/fail/uninit/padding-union.stderr +++ b/src/tools/miri/tests/fail/uninit/padding-union.stderr @@ -1,5 +1,5 @@ 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; | ^^ constructing invalid value at [1]: encountered uninitialized memory, but expected an integer @@ -7,7 +7,7 @@ LL | let _val = *c; = help: this indicates a bug in the program: it performed an 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.stderr b/src/tools/miri/tests/fail/uninit/padding-wide-ptr.stderr index 24194c4b02a..219bee45fe8 100644 --- a/src/tools/miri/tests/fail/uninit/padding-wide-ptr.stderr +++ b/src/tools/miri/tests/fail/uninit/padding-wide-ptr.stderr @@ -1,5 +1,5 @@ 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>()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory @@ -7,7 +7,7 @@ LL | let _val = *c.add(mem::size_of::<*const 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 = 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 30306054fbb..7fe88df560c 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 5f3d9bde1f2..ec6ba3fea7d 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 dfe3ed4b522..0996e5d11ef 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 48ce9ae7656..bcde9377c54 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 3917d868289..5da89976b03 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 f6982dc8653..46c956ff77e 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 df54c98bb0e..548f3d66c73 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 f392e9564c7..4fe45b0868a 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 fd67bdf4a90..81837122051 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 f526f77a4f0..9b6b7098e5c 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 35de4535222..a0b7cc7a521 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 81d775f6d7f..6af0e72b9c4 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 7593b8a3998..c02651c7cc9 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 fd4dd502bd5..09634e5ae7b 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 2d45ae68ca4..fe7fe2795ef 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 5ac4f5deffe..fe40aaa122f 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 3ed823dde94..9bed0f716a0 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 b938d29e760..ee84762fe40 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 314416766a5..487e3714b72 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 c761669c6db..5d258176cb6 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 1b5c838cf46..b88f9f77208 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 7706ed97316..9ce1631e67f 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 113eecd9cf7..2d84ef3dda6 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 34babac4dd3..6fd311df5ee 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 30afb5e8087..0736dfb2df1 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 e7997689c51..d2cfa86de86 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 5d27062fbc2..5721cfda932 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 f781ca04f03..a07b5babe1a 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 54781b507e0..85fabc1836b 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 df344311b75..c3f47df12f9 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 ed34d5255a4..5321dc0f4cf 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 a1bfa267cbe..ec607512686 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 2d8238350f3..0375ead8f55 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 2add8434ca5..bbf1f9a73ff 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 2b2fa9b8a20..87ac8c17932 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 d893f7a9e54..30acfef02ff 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 1d9c89c6880..1015d1ec427 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 2abe6c6fdf3..2b0a8f03813 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 bc8a140ac22..1e8b37979b0 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 fcd077daa38..bbb40d1f58f 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 3d7ec44fdb0..a6ca0f40f0d 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 55f3f803ad1..b983832799b 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 fed1cf45874..83af585201a 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 1219f9f88cf..0b5163f711e 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 e3503323b31..4be3fb52bdb 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 44430cd25db..a437ca34258 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 94b4123d345..9e6a6e80418 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 9aa5bc2fa76..816bd323f4c 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 39ac2c91437..26911948eff 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 c532d052245..a7df3e61187 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 e905d7d0391..bf1cfd573b8 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 3c6fda741dd..e54880e97da 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 e27a501ebb9..2cfc062212b 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 2990dfa8975..46eb5778b32 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 378baa7ce98..c896bd8dd34 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 319a10febb3..363298e49d9 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 ed394f76b0e..e47a754d38d 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 6733f2e42c1..ec75b6201c2 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 f1d0ccc7d03..e4b75cccbb5 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 46f0f643a47..d608cec20a4 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 be822bd0285..29150052b30 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 fc090aba5fd..9a71a797dae 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 77160e1870f..b671c53c611 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 4eb4244d747..7e011bfd53b 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 f7408310093..5640bd0b8d6 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 32ba400e025..0114320503b 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 a8a23ee3ce1..f13b355ea45 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 021ca1c4b32..a9bc0eb9d01 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 fcc4220bfce..278af9612d6 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 30f9da5f80e..bbb076b169a 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 660cfba8900..e9b2b5b6652 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 c2b9c37bbfb..0fc432f24c8 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 86a47ba3655..c9c9dc5dfd2 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 399d6df73ff..e84ffee367f 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 52348aad33d..87c8a2e1063 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 3d4f8c5e1c0..fe2d20bb76f 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 5e33617f98a..afcab7a702d 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 bff59591a94..67e77663110 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 1198168795d..9e5627c75a9 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 307906f2583..7dddfa66613 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 87405b02ac3..ca352e0109a 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 0e482ab2601..ff152eaea5c 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 2a5d3dff07f..eb38529ae57 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 647b5e60649..3e448b6ce3c 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; 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 a3567eeb7cb..1e3d486233a 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 3f7f9b18be9..be11f65a1e0 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 619c6db3a29..a35c92636ce 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 088a632427e..ab3fd6733ff 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 5b2bbfbb27d..11809613749 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 a5b944e9d42..f3261eaa43c 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 90dbd888392..c6e8355c3f5 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 71e33522634..e951603639c 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 15e040116de..c3d6af5a1ef 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 5e4bb73e368..c2c87586492 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/libc/libc_pthread_cond_timedwait.rs b/src/tools/miri/tests/pass-dep/libc/libc_pthread_cond_timedwait.rs index d758168c7c3..997fd5cc89f 100644 --- a/src/tools/miri/tests/pass-dep/libc/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/libc/libc_pthread_cond_timedwait_isolated.rs b/src/tools/miri/tests/pass-dep/libc/libc_pthread_cond_timedwait_isolated.rs index f1a3c5dc10d..0479d26af72 100644 --- a/src/tools/miri/tests/pass-dep/libc/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 fd874dbe89e..db305acbf4a 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 14275262128..75848bd44db 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 8be42b50897..a94f960f442 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; diff --git a/src/tools/miri/tests/pass-dep/tempfile.rs b/src/tools/miri/tests/pass-dep/tempfile.rs index c4583ca3f47..a44a7e7d924 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 d14af299cd4..14c27285a6a 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 7dea07c6e7d..96018f34aa5 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 5e63037c8a6..38f2cdde115 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 40b8e23a33c..50e217918b0 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 0af6cde833f..451f5de25d3 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/backtrace/backtrace-api-v0.stderr b/src/tools/miri/tests/pass/backtrace/backtrace-api-v0.stderr index c05950ebdc7..b87063431ad 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 e6644b4453f..8c1bc5c353e 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 b56d983d429..2c729c49ee0 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 11efd2f0752..5c2995e132a 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 b06dd1da3c6..d9414aa6518 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 84bdda59fce..d6d69ee837e 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 7852d495e28..35145fe9bd3 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 2c9fc0192af..898c19d514b 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 0be86ba3731..43df761bd0b 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 55b896c91ad..c8e2498fa5a 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 8f172475418..17f6d5d05a5 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 f61b39493ed..cb74312a83a 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 fe0d16ca78a..9c87489e8db 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 a346d31f645..e066f7dfce1 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 0fde5922c19..9464e76b6c9 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 f690be471ba..ca90e4f4d94 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 a34474ee0d6..21c5b2b0dfe 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 614b0d26a63..aac6d0f48d0 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 4d5103b24c3..01bb713926c 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 8fa683085b9..c42f97458c4 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 70e375b0981..761164a4ba3 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/windows-rand.rs b/src/tools/miri/tests/pass/shims/windows-rand.rs index cfbc1d278a9..1947e6d1356 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 c863ac670b6..29c3fa5d5f3 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 79ac4432dff..4e892e6e3cb 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 0fd4b7c0910..baa984e68d8 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 d4d1b6180a7..47f086f7340 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 3847a80be90..b3c2434c0d2 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 8b8d8880e3b..de1abc81842 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 a40eddde97c..db593063890 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 02f57f4b451..030258f21fa 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 60da88df046..4d5ddd75f38 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 86ac5835a16..6051987f8d4 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 0b3be7f3cbd..10842160abd 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 8cd4e6308e2..7331c6ed0db 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 c87eb518774..30908baa6c1 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 216bb6c76bc..bcb7a65e90f 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,52 @@ 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 program = CommandBuilder::cargo(); + program.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")); + program.args = builder_args.into_iter().map(Into::into).collect(); + let crate_manifest_path = Path::new("test_dependencies").join("Cargo.toml"); // Reset `RUSTFLAGS` to work around . - config.dependency_builder.envs.push(("RUSTFLAGS".into(), None)); + program.envs.push(("RUSTFLAGS".into(), None)); + config.comment_defaults.base().set_custom( + "dependencies", + DependencyBuilder { program, crate_manifest_path, build_std: None }, + ); } config } @@ -140,8 +172,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 +183,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 +200,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,47 +316,28 @@ 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, args: impl Iterator) -> Result<()> { - 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()?; + 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()); + + let build_manager = BuildManager::one_off(config); + let mut cmd = test_config.config.program.build(&test_config.config.out_dir); + // 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) } } From 987702f6b9c1258493378b8d181585c55623041d Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Mon, 16 Sep 2024 21:10:32 +0200 Subject: [PATCH 38/49] Refator DependencyBuilder construction --- src/tools/miri/tests/ui.rs | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/tools/miri/tests/ui.rs b/src/tools/miri/tests/ui.rs index 2c1561ea056..10b29deefad 100644 --- a/src/tools/miri/tests/ui.rs +++ b/src/tools/miri/tests/ui.rs @@ -118,22 +118,23 @@ fn miri_config(target: &str, path: &str, mode: Mode, with_dependencies: bool) -> 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.) - let mut program = CommandBuilder::cargo(); - program.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`. - program.args = builder_args.into_iter().map(Into::into).collect(); - let crate_manifest_path = Path::new("test_dependencies").join("Cargo.toml"); - // Reset `RUSTFLAGS` to work around . - program.envs.push(("RUSTFLAGS".into(), None)); config.comment_defaults.base().set_custom( "dependencies", - DependencyBuilder { program, crate_manifest_path, build_std: None }, + 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 From 4dabcc3ab43e92041547efdc98401f1c2dfe6044 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Mon, 16 Sep 2024 10:26:42 +0200 Subject: [PATCH 39/49] Fix run --dep --- src/tools/miri/miri-script/src/commands.rs | 10 +++++++--- src/tools/miri/tests/ui.rs | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/tools/miri/miri-script/src/commands.rs b/src/tools/miri/miri-script/src/commands.rs index 7348acac5a9..b18c8453d66 100644 --- a/src/tools/miri/miri-script/src/commands.rs +++ b/src/tools/miri/miri-script/src/commands.rs @@ -503,9 +503,13 @@ fn run( // More flags that we will pass before `flags` // (because `flags` may contain `--`). let mut early_flags = Vec::::new(); - if let Some(target) = &target { - early_flags.push("--target".into()); - early_flags.push(target.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()); diff --git a/src/tools/miri/tests/ui.rs b/src/tools/miri/tests/ui.rs index 10b29deefad..d405eb92ad1 100644 --- a/src/tools/miri/tests/ui.rs +++ b/src/tools/miri/tests/ui.rs @@ -337,6 +337,7 @@ fn run_dep_mode(target: String, args: impl Iterator) -> Result< 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(); From e04dc624a708aec084b6817d44261e00d0d70c2c Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Mon, 16 Sep 2024 23:07:18 +0200 Subject: [PATCH 40/49] Automatically add/remove labesl when github review (requests) are used --- src/tools/miri/triagebot.toml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/tools/miri/triagebot.toml b/src/tools/miri/triagebot.toml index addb36418d4..2d93777f61d 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"] From 1b252980bad0416371a1b6b59ff10aa9dfb6820a Mon Sep 17 00:00:00 2001 From: Nicole LeGare Date: Mon, 16 Sep 2024 16:24:01 -0700 Subject: [PATCH 41/49] Update Trusty target maintainers --- src/doc/rustc/src/platform-support/trusty.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/doc/rustc/src/platform-support/trusty.md b/src/doc/rustc/src/platform-support/trusty.md index dec3b96ff64..6b37543b600 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 From 472fef6a70d6621611a20f13f02c16be93589f5c Mon Sep 17 00:00:00 2001 From: Tyler Mandry Date: Mon, 16 Sep 2024 17:11:02 -0700 Subject: [PATCH 42/49] Revert "Rollup merge of #129749 - krasimirgg:llvm-20-lto, r=nikic" This reverts commit 8c7a7e346be4cdf13e77ab4acbfb5ade819a4e60, reversing changes made to a00bd75b6c5c96d0a35afa2dc07ce3155112d278. --- compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp index da27db29c87..c7306b0516f 100644 --- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp @@ -1212,11 +1212,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 @@ -1425,13 +1421,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(); @@ -1614,7 +1610,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); From 6750f042ca571407c8050693412d929ea1097b3f Mon Sep 17 00:00:00 2001 From: matthewpipie Date: Mon, 16 Sep 2024 20:05:15 -0500 Subject: [PATCH 43/49] Update library/alloc/src/sync.rs Co-authored-by: David Tolnay --- library/alloc/src/sync.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs index 496865e303b..63e4af34a57 100644 --- a/library/alloc/src/sync.rs +++ b/library/alloc/src/sync.rs @@ -769,7 +769,7 @@ pub fn new_zeroed_in(alloc: A) -> Arc, A> { /// [`upgrade`]: Weak::upgrade #[cfg(not(no_global_oom_handling))] #[inline] - #[stable(feature = "arc_new_cyclic", since = "1.60.0")] + #[unstable(feature = "allocator_api", issue = "32838")] pub fn new_cyclic_in(data_fn: F, alloc: A) -> Arc where F: FnOnce(&Weak) -> T, From 540b4da0f1000c016276056c4360fb9157b0b87c Mon Sep 17 00:00:00 2001 From: The Miri Cronjob Bot Date: Tue, 17 Sep 2024 04:56:57 +0000 Subject: [PATCH 44/49] Preparing for merge from rustc --- src/tools/miri/rust-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/miri/rust-version b/src/tools/miri/rust-version index eeff9ac8e38..3f4d095fc19 100644 --- a/src/tools/miri/rust-version +++ b/src/tools/miri/rust-version @@ -1 +1 @@ -c16ff44537509ca911ffd3653b17c6187c71831d +e2dc1a1c0f97a90319181a721ab317210307617a From c5f5cfcfbc888ec1807ddd16b82687e5704d23dc Mon Sep 17 00:00:00 2001 From: The Miri Cronjob Bot Date: Tue, 17 Sep 2024 05:05:40 +0000 Subject: [PATCH 45/49] fmt --- src/tools/miri/src/machine.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/tools/miri/src/machine.rs b/src/tools/miri/src/machine.rs index c2b0aedbde1..bde94cec87f 100644 --- a/src/tools/miri/src/machine.rs +++ b/src/tools/miri/src/machine.rs @@ -602,12 +602,8 @@ pub(crate) fn new(config: &MiriConfig, layout_cx: LayoutCx<'tcx>) -> Self { 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 From 143710ff45ab3d82df299c078f2d2c8e7fb57222 Mon Sep 17 00:00:00 2001 From: tiif Date: Tue, 17 Sep 2024 17:46:33 +0800 Subject: [PATCH 46/49] Tokio ICE fix: Changed the type of EpollEventInterest::epfd from i32 to WeakFileDescriptionRef --- src/tools/miri/src/shims/unix/linux/epoll.rs | 13 ++++--- .../pass-dep/libc/libc-epoll-no-blocking.rs | 38 +++++++++++++++++++ 2 files changed, 46 insertions(+), 5 deletions(-) diff --git a/src/tools/miri/src/shims/unix/linux/epoll.rs b/src/tools/miri/src/shims/unix/linux/epoll.rs index d91ce45e101..3d4fe770e99 100644 --- a/src/tools/miri/src/shims/unix/linux/epoll.rs +++ b/src/tools/miri/src/shims/unix/linux/epoll.rs @@ -51,6 +51,9 @@ pub fn new(events: u32, data: u64) -> EpollEventInstance { #[derive(Clone, Debug)] pub struct EpollEventInterest { /// The file descriptor value of the file description registered. + /// 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, @@ -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_num: i32, + /// The epoll file description that this EpollEventInterest is registered under. + weak_epfd: WeakFileDescriptionRef, } /// EpollReadyEvents reflects the readiness of a file description. @@ -343,7 +346,7 @@ fn epoll_ctl( events, data, ready_list: Rc::clone(ready_list), - epfd_num: epfd_value, + weak_epfd: epfd.downgrade(), })); if op == epoll_ctl_add { @@ -553,12 +556,12 @@ fn check_and_update_readiness( 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_num).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() 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 647b5e60649..3b6727f1429 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 @@ -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); +} From ba86cf8686399953e97e82177b201354d808241d Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 17 Sep 2024 15:20:50 +0200 Subject: [PATCH 47/49] update lockfile --- Cargo.lock | 92 ++++++++++++++++++------------------------------------ 1 file changed, 30 insertions(+), 62 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 81aecf1cea7..1497d2d463a 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" @@ -5516,33 +5485,6 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" -[[package]] -name = "ui_test" -version = "0.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaf4bf7c184b8dfc7a4d3b90df789b1eb992ee42811cd115f32a7a1eb781058d" -dependencies = [ - "annotate-snippets 0.9.2", - "anyhow", - "bstr", - "cargo-platform", - "cargo_metadata 0.15.4", - "color-eyre", - "colored", - "comma", - "crossbeam-channel", - "indicatif", - "lazy_static", - "levenshtein", - "prettydiff 0.6.4", - "regex", - "rustc_version", - "rustfix 0.6.1", - "serde", - "serde_json", - "tempfile", -] - [[package]] name = "ui_test" version = "0.25.0" @@ -5561,10 +5503,36 @@ dependencies = [ "indicatif", "lazy_static", "levenshtein", - "prettydiff 0.7.0", + "prettydiff", "regex", "rustc_version", - "rustfix 0.8.1", + "rustfix", + "serde", + "serde_json", + "spanned", +] + +[[package]] +name = "ui_test" +version = "0.26.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32ee4c40e5a5f9fa6864ff976473e5d6a6e9884b6ce68b40690d9f87e1994c83" +dependencies = [ + "annotate-snippets 0.11.4", + "anyhow", + "bstr", + "cargo-platform", + "cargo_metadata 0.18.1", + "color-eyre", + "colored", + "comma", + "crossbeam-channel", + "indicatif", + "levenshtein", + "prettydiff", + "regex", + "rustc_version", + "rustfix", "serde", "serde_json", "spanned", From 0a253246f73eb72f14fb218867b6ace3014e0286 Mon Sep 17 00:00:00 2001 From: Xiretza Date: Fri, 23 Aug 2024 18:09:20 +0000 Subject: [PATCH 48/49] Add test for fluent diagnostics --- .../ui-fulldeps/fluent-messages/many-lines.ftl | 11 +++++++++++ tests/ui-fulldeps/fluent-messages/test.rs | 5 +++++ tests/ui-fulldeps/fluent-messages/test.stderr | 17 ++++++++++++++++- 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 tests/ui-fulldeps/fluent-messages/many-lines.ftl 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 00000000000..43660ebeacd --- /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 7bf1252ccf6..3361ebcef01 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 09d4a384732..139790462f0 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:15:1 + | +15 | no_crate_bar = + | ^^^^^^^^^^^^^^ + | + +error: aborting due to 14 previous errors From 5b3bde953ed70df2f22650f77cf5c13a4dc15836 Mon Sep 17 00:00:00 2001 From: Xiretza Date: Mon, 19 Aug 2024 07:46:17 +0000 Subject: [PATCH 49/49] fluent_macro: fix diagnostics for fluent parse failures This line number calculation was both wrong and unnecessary. --- compiler/rustc_fluent_macro/src/fluent.rs | 17 ----------------- tests/ui-fulldeps/fluent-messages/test.stderr | 10 +++++----- 2 files changed, 5 insertions(+), 22 deletions(-) diff --git a/compiler/rustc_fluent_macro/src/fluent.rs b/compiler/rustc_fluent_macro/src/fluent.rs index ca8bace28f3..37e610a85a6 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/tests/ui-fulldeps/fluent-messages/test.stderr b/tests/ui-fulldeps/fluent-messages/test.stderr index 139790462f0..0b3bb14ce51 100644 --- a/tests/ui-fulldeps/fluent-messages/test.stderr +++ b/tests/ui-fulldeps/fluent-messages/test.stderr @@ -112,11 +112,11 @@ 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:15:1 - | -15 | no_crate_bar = - | ^^^^^^^^^^^^^^ - | + --> ./many-lines.ftl:8:1 + | +8 | no_crate_bar = + | ^^^^^^^^^^^^^^ + | error: aborting due to 14 previous errors