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