Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions library/alloc/src/alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,11 @@ unsafe extern "Rust" {
pub struct Global;

#[unstable(feature = "allocator_ext", issue = "163177", implied_by = "allocator_api")]
// SAFETY: All clones of `Global` refer to the same global allocator.
unsafe impl core::alloc::AllocatorClone for Global {}

#[unstable(feature = "allocator_ext", issue = "163177", implied_by = "allocator_api")]
// SAFETY: `Global` allocations remain active unless deallocated.
unsafe impl core::alloc::StaticAllocator for Global {}

/// Allocates memory with the global allocator.
Expand Down Expand Up @@ -568,6 +570,8 @@ impl Global {

#[stable(feature = "allocator_api", since = "1.100.0")]
#[rustc_const_unstable(feature = "const_heap", issue = "79597")]
// SAFETY: The specific requirements of `Allocator` are too much to explain here,
// but we do cover all of them for `Global`.
const unsafe impl Allocator for Global {
#[inline]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
Expand Down
3 changes: 3 additions & 0 deletions library/alloc/src/borrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,12 +359,15 @@ impl<B: ?Sized + ToOwned> Deref for Cow<'_, B>
// `str` (`String as Borrow<str>` is trusted) and `[T]` (`Vec<T> as Borrow<[T]>` is trusted).
// In the future, a `BorrowPure<T>` trait analogous to `DerefPure` might generalize this.
#[unstable(feature = "deref_pure_trait", issue = "87121")]
// SAFETY: This falls back to the `&T as Borrow<T>` implementation, which we can trust to be stable.
unsafe impl<T: Clone> DerefPure for Cow<'_, T> {}
#[cfg(not(no_global_oom_handling))]
#[unstable(feature = "deref_pure_trait", issue = "87121")]
// SAFETY: This falls back to the `&String as Borrow<str>` implementation, which we can trust to be stable.
unsafe impl DerefPure for Cow<'_, str> {}
#[cfg(not(no_global_oom_handling))]
#[unstable(feature = "deref_pure_trait", issue = "87121")]
// SAFETY: This falls back to the `&Vec<T> as Borrow<[T]>` implementation, which we can trust to be stable.
unsafe impl<T: Clone> DerefPure for Cow<'_, [T]> {}

#[stable(feature = "rust1", since = "1.0.0")]
Expand Down
6 changes: 5 additions & 1 deletion library/alloc/src/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1974,6 +1974,7 @@ impl<T: ?Sized, A: Allocator> Box<T, A> {
}

#[stable(feature = "rust1", since = "1.0.0")]
// SAFETY: We explicitly do not read the `T` inside the `Box` when dropping.
unsafe impl<#[may_dangle] T: ?Sized, A: Allocator> Drop for Box<T, A> {
#[inline]
fn drop(&mut self) {
Expand Down Expand Up @@ -2301,6 +2302,7 @@ impl<T: ?Sized, A: Allocator> DerefMut for Box<T, A> {
}

#[unstable(feature = "deref_pure_trait", issue = "87121")]
// SAFETY: We always return the address of the allocated pointer, which is stable.
unsafe impl<T: ?Sized, A: Allocator> DerefPure for Box<T, A> {}

#[unstable(feature = "legacy_receiver_trait", issue = "none")]
Expand Down Expand Up @@ -2361,6 +2363,8 @@ impl<Args: Tuple, F: AsyncFn<Args> + ?Sized, A: Allocator> AsyncFn<Args> for Box
#[unstable(feature = "coerce_unsized", issue = "18598")]
impl<T: ?Sized + Unsize<U>, U: ?Sized, A: Allocator> CoerceUnsized<Box<U, A>> for Box<T, A> {}

#[unstable(feature = "pin_coerce_unsized_trait", issue = "150112")]
// SAFETY:
// A pointer can only be pin safe if it does not implement certain safe traits
// maliciously. Since `Box` is fundamental, downstream crates may be able to
// implement those traits for `Box<LocalType>`, so we must carefully check that
Expand All @@ -2380,7 +2384,6 @@ impl<T: ?Sized + Unsize<U>, U: ?Sized, A: Allocator> CoerceUnsized<Box<U, A>> fo
// `Clone` for `Box<LocalType>`, it is not problematic for the cloned box to be
// wrapped in `Pin`, since the same conversion could have been carried out
// safely as `Box::pin((*p).clone())`.
#[unstable(feature = "pin_coerce_unsized_trait", issue = "150112")]
unsafe impl<T: ?Sized, A: StaticAllocator> PinSafePointer for Box<T, A> {}

// It is quite crucial that we only allow the `Global` allocator here.
Expand Down Expand Up @@ -2491,6 +2494,7 @@ impl<E: Error, A: Allocator> Error for Box<E, A> {
}

#[stable(feature = "allocator_api", since = "1.100.0")]
// SAFETY: This just forwards to the inner allocator, whose implementation must be correct.
unsafe impl<T: ?Sized + Allocator, A: Allocator> Allocator for Box<T, A> {
#[inline]
fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError> {
Expand Down
1 change: 1 addition & 0 deletions library/alloc/src/boxed/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ impl<T, const N: usize, A: Allocator> ExactSizeIterator for BoxedArrayIntoIter<T
impl<T, const N: usize, A: Allocator> FusedIterator for BoxedArrayIntoIter<T, N, A> {}

#[stable(feature = "boxed_array_value_iter", since = "1.99.0")]
// SAFETY: We just forward to `vec::IntoIter`, which has a trustable length.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We actually just take the raw length of the array here (see library/alloc/src/boxed/iter.rs:254)

unsafe impl<T, const N: usize, A: Allocator> TrustedLen for BoxedArrayIntoIter<T, N, A> {}

#[cfg(not(no_global_oom_handling))]
Expand Down
4 changes: 2 additions & 2 deletions library/alloc/src/boxed/thin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ pub struct ThinBox<T: ?Sized> {
_marker: PhantomData<T>,
}

/// `ThinBox<T>` is `Send` if `T` is `Send` because the data is owned.
#[unstable(feature = "thin_box", issue = "92791")]
// SAFETY: `ThinBox<T>` is `Send` if `T` is `Send` because the data is owned.
unsafe impl<T: ?Sized + Send> Send for ThinBox<T> {}

/// `ThinBox<T>` is `Sync` if `T` is `Sync` because the data is owned.
#[unstable(feature = "thin_box", issue = "92791")]
// SAFETY: `ThinBox<T>` is `Sync` if `T` is `Sync` because the data is owned.
unsafe impl<T: ?Sized + Sync> Sync for ThinBox<T> {}

#[unstable(feature = "thin_box", issue = "92791")]
Expand Down
1 change: 1 addition & 0 deletions library/alloc/src/bstr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ impl DerefMut for ByteString {
}

#[unstable(feature = "deref_pure_trait", issue = "87121")]
// SAFETY: This type just wraps `Vec`, whose `Deref` implementation is stable.
unsafe impl DerefPure for ByteString {}

#[unstable(feature = "bstr", issue = "134915")]
Expand Down
6 changes: 6 additions & 0 deletions library/alloc/src/collections/binary_heap/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1748,6 +1748,7 @@ impl<T, A: Allocator> FusedIterator for IntoIter<T, A> {}

#[doc(hidden)]
#[unstable(issue = "none", feature = "trusted_fused")]
// SAFETY: We just forward to `vec::IntoIter`, which is always fused.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only safety req on the trait is that the impl isn't lifetime-dependent (library/core/src/iter/traits/marker.rs:8)

unsafe impl<T, A: Allocator> TrustedFused for IntoIter<T, A> {}

#[stable(feature = "default_iters", since = "1.70.0")]
Expand All @@ -1768,6 +1769,7 @@ impl<T> Default for IntoIter<T> {
// also refer to the vec::in_place_collect module documentation to get an overview
#[unstable(issue = "none", feature = "inplace_iteration")]
#[doc(hidden)]
// ignore-tidy-undocumented-unsafe
unsafe impl<T, A: Allocator> SourceIter for IntoIter<T, A> {
type Source = IntoIter<T, A>;

Expand All @@ -1779,12 +1781,14 @@ unsafe impl<T, A: Allocator> SourceIter for IntoIter<T, A> {

#[unstable(issue = "none", feature = "inplace_iteration")]
#[doc(hidden)]
// ignore-tidy-undocumented-unsafe
unsafe impl<I, A: Allocator> InPlaceIterable for IntoIter<I, A> {
const EXPAND_BY: Option<NonZero<usize>> = NonZero::new(1);
const MERGE_BY: Option<NonZero<usize>> = NonZero::new(1);
}

#[cfg(not(test))]
// SAFETY: We don't mutate the contained data when returning it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The trait bounds here are kinda underspecified but I read the safety req (library/alloc/src/vec/in_place_collect.rs:428) as being something like "The internals of IntoIter promise never to mutate the data or create a reference to the entire allocation"

unsafe impl<I> AsVecIntoIter for IntoIter<I> {
type Item = I;

Expand Down Expand Up @@ -1834,6 +1838,7 @@ impl<T: Ord, A: Allocator> ExactSizeIterator for IntoIterSorted<T, A> {}
impl<T: Ord, A: Allocator> FusedIterator for IntoIterSorted<T, A> {}

#[unstable(feature = "trusted_len", issue = "37572")]
// SAFETY: We just forward to `vec::IntoIter`, which has a trustable length.
unsafe impl<T: Ord, A: Allocator> TrustedLen for IntoIterSorted<T, A> {}

/// A draining iterator over the elements of a `BinaryHeap`.
Expand Down Expand Up @@ -1960,6 +1965,7 @@ impl<T: Ord, A: Allocator> ExactSizeIterator for DrainSorted<'_, T, A> {}
impl<T: Ord, A: Allocator> FusedIterator for DrainSorted<'_, T, A> {}

#[unstable(feature = "trusted_len", issue = "37572")]
// SAFETY: The length of the underlying heap is always correct.
unsafe impl<T: Ord, A: Allocator> TrustedLen for DrainSorted<'_, T, A> {}

#[stable(feature = "binary_heap_extras_15", since = "1.5.0")]
Expand Down
2 changes: 2 additions & 0 deletions library/alloc/src/collections/btree/borrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ pub(super) struct DormantMutRef<'a, T> {
_marker: PhantomData<&'a mut T>,
}

// ignore-tidy-undocumented-unsafe
unsafe impl<'a, T> Sync for DormantMutRef<'a, T> where &'a mut T: Sync {}
// ignore-tidy-undocumented-unsafe
unsafe impl<'a, T> Send for DormantMutRef<'a, T> where &'a mut T: Send {}

impl<'a, T> DormantMutRef<'a, T> {
Expand Down
9 changes: 9 additions & 0 deletions library/alloc/src/collections/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ pub struct BTreeMap<
}

#[stable(feature = "btree_drop", since = "1.7.0")]
// ignore-tidy-undocumented-unsafe
unsafe impl<#[may_dangle] K, #[may_dangle] V, A: AllocatorClone> Drop for BTreeMap<K, V, A> {
fn drop(&mut self) {
// Skip `into_iter` for an empty map: `dying_next` is too costly to inline, so the
Expand Down Expand Up @@ -1799,6 +1800,7 @@ impl<K, V> ExactSizeIterator for Iter<'_, K, V> {
}

#[unstable(feature = "trusted_len", issue = "37572")]
// ignore-tidy-undocumented-unsafe
unsafe impl<K, V> TrustedLen for Iter<'_, K, V> {}

#[stable(feature = "rust1", since = "1.0.0")]
Expand Down Expand Up @@ -1876,6 +1878,7 @@ impl<K, V> ExactSizeIterator for IterMut<'_, K, V> {
}

#[unstable(feature = "trusted_len", issue = "37572")]
// ignore-tidy-undocumented-unsafe
unsafe impl<K, V> TrustedLen for IterMut<'_, K, V> {}

#[stable(feature = "fused", since = "1.26.0")]
Expand Down Expand Up @@ -2004,6 +2007,7 @@ impl<K, V, A: AllocatorClone> ExactSizeIterator for IntoIter<K, V, A> {
}

#[unstable(feature = "trusted_len", issue = "37572")]
// ignore-tidy-undocumented-unsafe
unsafe impl<K, V, A: AllocatorClone> TrustedLen for IntoIter<K, V, A> {}

#[stable(feature = "fused", since = "1.26.0")]
Expand Down Expand Up @@ -2055,6 +2059,7 @@ impl<K, V> ExactSizeIterator for Keys<'_, K, V> {
}

#[unstable(feature = "trusted_len", issue = "37572")]
// ignore-tidy-undocumented-unsafe
unsafe impl<K, V> TrustedLen for Keys<'_, K, V> {}

#[stable(feature = "fused", since = "1.26.0")]
Expand Down Expand Up @@ -2113,6 +2118,7 @@ impl<K, V> ExactSizeIterator for Values<'_, K, V> {
}

#[unstable(feature = "trusted_len", issue = "37572")]
// ignore-tidy-undocumented-unsafe
unsafe impl<K, V> TrustedLen for Values<'_, K, V> {}

#[stable(feature = "fused", since = "1.26.0")]
Expand Down Expand Up @@ -2358,6 +2364,7 @@ impl<K, V> ExactSizeIterator for ValuesMut<'_, K, V> {
}

#[unstable(feature = "trusted_len", issue = "37572")]
// ignore-tidy-undocumented-unsafe
unsafe impl<K, V> TrustedLen for ValuesMut<'_, K, V> {}

#[stable(feature = "fused", since = "1.26.0")]
Expand Down Expand Up @@ -2423,6 +2430,7 @@ impl<K, V, A: AllocatorClone> ExactSizeIterator for IntoKeys<K, V, A> {
}

#[unstable(feature = "trusted_len", issue = "37572")]
// ignore-tidy-undocumented-unsafe
unsafe impl<K, V, A: AllocatorClone> TrustedLen for IntoKeys<K, V, A> {}

#[stable(feature = "map_into_keys_values", since = "1.54.0")]
Expand Down Expand Up @@ -2477,6 +2485,7 @@ impl<K, V, A: AllocatorClone> ExactSizeIterator for IntoValues<K, V, A> {
}

#[unstable(feature = "trusted_len", issue = "37572")]
// ignore-tidy-undocumented-unsafe
unsafe impl<K, V, A: AllocatorClone> TrustedLen for IntoValues<K, V, A> {}

#[stable(feature = "map_into_keys_values", since = "1.54.0")]
Expand Down
6 changes: 6 additions & 0 deletions library/alloc/src/collections/btree/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,18 @@ impl<'a, K: 'a, V: 'a, Type> Clone for NodeRef<marker::Immut<'a>, K, V, Type> {
}
}

// ignore-tidy-undocumented-unsafe
unsafe impl<BorrowType, K: Sync, V: Sync, Type> Sync for NodeRef<BorrowType, K, V, Type> {}

// ignore-tidy-undocumented-unsafe
unsafe impl<K: Sync, V: Sync, Type> Send for NodeRef<marker::Immut<'_>, K, V, Type> {}
// ignore-tidy-undocumented-unsafe
unsafe impl<K: Send, V: Send, Type> Send for NodeRef<marker::Mut<'_>, K, V, Type> {}
// ignore-tidy-undocumented-unsafe
unsafe impl<K: Send, V: Send, Type> Send for NodeRef<marker::ValMut<'_>, K, V, Type> {}
// ignore-tidy-undocumented-unsafe
unsafe impl<K: Send, V: Send, Type> Send for NodeRef<marker::Owned, K, V, Type> {}
// ignore-tidy-undocumented-unsafe
unsafe impl<K: Send, V: Send, Type> Send for NodeRef<marker::Dying, K, V, Type> {}

impl<K, V> NodeRef<marker::Owned, K, V, marker::Leaf> {
Expand Down
2 changes: 2 additions & 0 deletions library/alloc/src/collections/btree/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1803,6 +1803,7 @@ impl<T> ExactSizeIterator for Iter<'_, T> {
}

#[unstable(feature = "trusted_len", issue = "37572")]
// ignore-tidy-undocumented-unsafe
unsafe impl<T> TrustedLen for Iter<'_, T> {}

#[stable(feature = "fused", since = "1.26.0")]
Expand Down Expand Up @@ -1850,6 +1851,7 @@ impl<T, A: AllocatorClone> ExactSizeIterator for IntoIter<T, A> {
}

#[unstable(feature = "trusted_len", issue = "37572")]
// ignore-tidy-undocumented-unsafe
unsafe impl<T, A: AllocatorClone> TrustedLen for IntoIter<T, A> {}

#[stable(feature = "fused", since = "1.26.0")]
Expand Down
14 changes: 14 additions & 0 deletions library/alloc/src/collections/linked_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1190,6 +1190,7 @@ impl<T, A: Allocator> LinkedList<T, A> {
}

#[stable(feature = "rust1", since = "1.0.0")]
// ignore-tidy-undocumented-unsafe
unsafe impl<#[may_dangle] T, A: Allocator> Drop for LinkedList<T, A> {
fn drop(&mut self) {
struct DropGuard<'a, T, A: Allocator>(&'a mut LinkedList<T, A>);
Expand Down Expand Up @@ -1268,6 +1269,7 @@ impl<T> ExactSizeIterator for Iter<'_, T> {}
impl<T> FusedIterator for Iter<'_, T> {}

#[unstable(feature = "trusted_len", issue = "37572")]
// ignore-tidy-undocumented-unsafe
unsafe impl<T> TrustedLen for Iter<'_, T> {}

#[stable(feature = "default_iters", since = "1.70.0")]
Expand Down Expand Up @@ -1343,6 +1345,7 @@ impl<T> ExactSizeIterator for IterMut<'_, T> {}
impl<T> FusedIterator for IterMut<'_, T> {}

#[unstable(feature = "trusted_len", issue = "37572")]
// ignore-tidy-undocumented-unsafe
unsafe impl<T> TrustedLen for IterMut<'_, T> {}

#[stable(feature = "default_iters", since = "1.70.0")]
Expand Down Expand Up @@ -2082,6 +2085,7 @@ impl<T, A: Allocator> ExactSizeIterator for IntoIter<T, A> {}
impl<T, A: Allocator> FusedIterator for IntoIter<T, A> {}

#[unstable(feature = "trusted_len", issue = "37572")]
// ignore-tidy-undocumented-unsafe
unsafe impl<T, A: Allocator> TrustedLen for IntoIter<T, A> {}

#[stable(feature = "default_iters", since = "1.70.0")]
Expand Down Expand Up @@ -2283,31 +2287,41 @@ fn assert_covariance() {
}

#[stable(feature = "rust1", since = "1.0.0")]
// ignore-tidy-undocumented-unsafe
unsafe impl<T: Send, A: Allocator + Send> Send for LinkedList<T, A> {}

#[stable(feature = "rust1", since = "1.0.0")]
// ignore-tidy-undocumented-unsafe
unsafe impl<T: Sync, A: Allocator + Sync> Sync for LinkedList<T, A> {}

#[stable(feature = "rust1", since = "1.0.0")]
// ignore-tidy-undocumented-unsafe
unsafe impl<T: Sync> Send for Iter<'_, T> {}

#[stable(feature = "rust1", since = "1.0.0")]
// ignore-tidy-undocumented-unsafe
unsafe impl<T: Sync> Sync for Iter<'_, T> {}

#[stable(feature = "rust1", since = "1.0.0")]
// ignore-tidy-undocumented-unsafe
unsafe impl<T: Send> Send for IterMut<'_, T> {}

#[stable(feature = "rust1", since = "1.0.0")]
// ignore-tidy-undocumented-unsafe
unsafe impl<T: Sync> Sync for IterMut<'_, T> {}

#[unstable(feature = "linked_list_cursors", issue = "58533")]
// ignore-tidy-undocumented-unsafe
unsafe impl<T: Sync, A: Allocator + Sync> Send for Cursor<'_, T, A> {}

#[unstable(feature = "linked_list_cursors", issue = "58533")]
// ignore-tidy-undocumented-unsafe
unsafe impl<T: Sync, A: Allocator + Sync> Sync for Cursor<'_, T, A> {}

#[unstable(feature = "linked_list_cursors", issue = "58533")]
// ignore-tidy-undocumented-unsafe
unsafe impl<T: Send, A: Allocator + Send> Send for CursorMut<'_, T, A> {}

#[unstable(feature = "linked_list_cursors", issue = "58533")]
// ignore-tidy-undocumented-unsafe
unsafe impl<T: Sync, A: Allocator + Sync> Sync for CursorMut<'_, T, A> {}
2 changes: 2 additions & 0 deletions library/alloc/src/collections/vec_deque/drain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,10 @@ impl<T: fmt::Debug, A: Allocator> fmt::Debug for Drain<'_, T, A> {
}

#[stable(feature = "drain", since = "1.6.0")]
// ignore-tidy-undocumented-unsafe
unsafe impl<T: Sync, A: Allocator + Sync> Sync for Drain<'_, T, A> {}
#[stable(feature = "drain", since = "1.6.0")]
// ignore-tidy-undocumented-unsafe
unsafe impl<T: Send, A: Allocator + Send> Send for Drain<'_, T, A> {}

#[stable(feature = "drain", since = "1.6.0")]
Expand Down
1 change: 1 addition & 0 deletions library/alloc/src/collections/vec_deque/into_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,4 +258,5 @@ impl<T, A: Allocator> ExactSizeIterator for IntoIter<T, A> {
impl<T, A: Allocator> FusedIterator for IntoIter<T, A> {}

#[unstable(feature = "trusted_len", issue = "37572")]
// ignore-tidy-undocumented-unsafe
unsafe impl<T, A: Allocator> TrustedLen for IntoIter<T, A> {}
3 changes: 3 additions & 0 deletions library/alloc/src/collections/vec_deque/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,14 +219,17 @@ impl<T> ExactSizeIterator for Iter<'_, T> {
impl<T> FusedIterator for Iter<'_, T> {}

#[unstable(feature = "trusted_len", issue = "37572")]
// ignore-tidy-undocumented-unsafe
unsafe impl<T> TrustedLen for Iter<'_, T> {}

#[doc(hidden)]
#[unstable(feature = "trusted_random_access", issue = "none")]
// ignore-tidy-undocumented-unsafe
unsafe impl<T> TrustedRandomAccess for Iter<'_, T> {}

#[doc(hidden)]
#[unstable(feature = "trusted_random_access", issue = "none")]
// ignore-tidy-undocumented-unsafe
unsafe impl<T> TrustedRandomAccessNoCoerce for Iter<'_, T> {
const MAY_HAVE_SIDE_EFFECT: bool = false;
}
3 changes: 3 additions & 0 deletions library/alloc/src/collections/vec_deque/iter_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,14 +283,17 @@ impl<T> ExactSizeIterator for IterMut<'_, T> {
impl<T> FusedIterator for IterMut<'_, T> {}

#[unstable(feature = "trusted_len", issue = "37572")]
// ignore-tidy-undocumented-unsafe
unsafe impl<T> TrustedLen for IterMut<'_, T> {}

#[doc(hidden)]
#[unstable(feature = "trusted_random_access", issue = "none")]
// ignore-tidy-undocumented-unsafe
unsafe impl<T> TrustedRandomAccess for IterMut<'_, T> {}

#[doc(hidden)]
#[unstable(feature = "trusted_random_access", issue = "none")]
// ignore-tidy-undocumented-unsafe
unsafe impl<T> TrustedRandomAccessNoCoerce for IterMut<'_, T> {
const MAY_HAVE_SIDE_EFFECT: bool = false;
}
Loading
Loading