|
1 | 1 | use crate::cmp; |
2 | | -use crate::iter::{ |
3 | | - adapters::zip::try_get_unchecked, adapters::SourceIter, FusedIterator, InPlaceIterable, |
4 | | - TrustedLen, TrustedRandomAccess, |
5 | | -}; |
| 2 | +use crate::iter::{adapters::SourceIter, FusedIterator, InPlaceIterable, TrustedLen}; |
6 | 3 | use crate::ops::{ControlFlow, Try}; |
7 | 4 |
|
8 | 5 | /// An iterator that only iterates over the first `n` iterations of `iter`. |
@@ -114,15 +111,6 @@ where |
114 | 111 |
|
115 | 112 | self.try_fold(init, ok(fold)).unwrap() |
116 | 113 | } |
117 | | - |
118 | | - unsafe fn __iterator_get_unchecked(&mut self, idx: usize) -> <I as Iterator>::Item |
119 | | - where |
120 | | - Self: TrustedRandomAccess, |
121 | | - { |
122 | | - // SAFETY: the caller must uphold the contract for |
123 | | - // `Iterator::__iterator_get_unchecked`. |
124 | | - unsafe { try_get_unchecked(&mut self.iter, idx) } |
125 | | - } |
126 | 114 | } |
127 | 115 |
|
128 | 116 | #[unstable(issue = "none", feature = "inplace_iteration")] |
@@ -219,12 +207,3 @@ impl<I> FusedIterator for Take<I> where I: FusedIterator {} |
219 | 207 |
|
220 | 208 | #[unstable(feature = "trusted_len", issue = "37572")] |
221 | 209 | unsafe impl<I: TrustedLen> TrustedLen for Take<I> {} |
222 | | - |
223 | | -#[doc(hidden)] |
224 | | -#[unstable(feature = "trusted_random_access", issue = "none")] |
225 | | -unsafe impl<I> TrustedRandomAccess for Take<I> |
226 | | -where |
227 | | - I: TrustedRandomAccess, |
228 | | -{ |
229 | | - const MAY_HAVE_SIDE_EFFECT: bool = I::MAY_HAVE_SIDE_EFFECT; |
230 | | -} |
0 commit comments