|
2 | 2 |
|
3 | 3 | use crate::{ |
4 | 4 | fmt, |
5 | | - iter::{self, ExactSizeIterator, FusedIterator, TrustedLen, TrustedRandomAccess}, |
| 5 | + iter::{self, ExactSizeIterator, FusedIterator, TrustedLen}, |
6 | 6 | mem::{self, MaybeUninit}, |
7 | 7 | ops::Range, |
8 | 8 | ptr, |
@@ -130,19 +130,6 @@ impl<T, const N: usize> Iterator for IntoIter<T, N> { |
130 | 130 | fn last(mut self) -> Option<Self::Item> { |
131 | 131 | self.next_back() |
132 | 132 | } |
133 | | - |
134 | | - #[inline] |
135 | | - #[doc(hidden)] |
136 | | - unsafe fn __iterator_get_unchecked(&mut self, idx: usize) -> Self::Item |
137 | | - where |
138 | | - Self: TrustedRandomAccess, |
139 | | - { |
140 | | - // SAFETY: Callers are only allowed to pass an index that is in bounds |
141 | | - // Additionally Self: TrustedRandomAccess is only implemented for T: Copy which means even |
142 | | - // multiple repeated reads of the same index would be safe and the |
143 | | - // values are !Drop, thus won't suffer from double drops. |
144 | | - unsafe { self.data.get_unchecked(self.alive.start + idx).assume_init_read() } |
145 | | - } |
146 | 133 | } |
147 | 134 |
|
148 | 135 | #[stable(feature = "array_value_iter_impls", since = "1.40.0")] |
@@ -197,17 +184,6 @@ impl<T, const N: usize> FusedIterator for IntoIter<T, N> {} |
197 | 184 | #[stable(feature = "array_value_iter_impls", since = "1.40.0")] |
198 | 185 | unsafe impl<T, const N: usize> TrustedLen for IntoIter<T, N> {} |
199 | 186 |
|
200 | | -#[doc(hidden)] |
201 | | -#[unstable(feature = "trusted_random_access", issue = "none")] |
202 | | -// T: Copy as approximation for !Drop since get_unchecked does not update the pointers |
203 | | -// and thus we can't implement drop-handling |
204 | | -unsafe impl<T, const N: usize> TrustedRandomAccess for IntoIter<T, N> |
205 | | -where |
206 | | - T: Copy, |
207 | | -{ |
208 | | - const MAY_HAVE_SIDE_EFFECT: bool = false; |
209 | | -} |
210 | | - |
211 | 187 | #[stable(feature = "array_value_iter_impls", since = "1.40.0")] |
212 | 188 | impl<T: Clone, const N: usize> Clone for IntoIter<T, N> { |
213 | 189 | fn clone(&self) -> Self { |
|
0 commit comments