Add doc(hidden) to all __iterator_get_unchecked

This method on the Iterator trait is doc(hidden), and about half of
implementations were doc(hidden). This adds the attribute to the
remaining implementations.
This commit is contained in:
Jacob Hoffman-Andrews
2021-06-11 22:16:44 -07:00
parent bff4f073c8
commit 910c7fa767
14 changed files with 15 additions and 0 deletions

View File

@@ -38,6 +38,7 @@ impl<T> Iterator for IntoIter<T> {
}
#[inline]
#[doc(hidden)]
unsafe fn __iterator_get_unchecked(&mut self, idx: usize) -> Self::Item
where
Self: TrustedRandomAccess,

View File

@@ -103,6 +103,7 @@ impl<'a, T> Iterator for Iter<'a, T> {
}
#[inline]
#[doc(hidden)]
unsafe fn __iterator_get_unchecked(&mut self, idx: usize) -> Self::Item
where
Self: TrustedRandomAccess,

View File

@@ -89,6 +89,7 @@ impl<'a, T> Iterator for IterMut<'a, T> {
}
#[inline]
#[doc(hidden)]
unsafe fn __iterator_get_unchecked(&mut self, idx: usize) -> Self::Item
where
Self: TrustedRandomAccess,

View File

@@ -163,6 +163,7 @@ impl<T, A: Allocator> Iterator for IntoIter<T, A> {
self.len()
}
#[doc(hidden)]
unsafe fn __iterator_get_unchecked(&mut self, i: usize) -> Self::Item
where
Self: TrustedRandomAccess,

View File

@@ -132,6 +132,7 @@ impl<T, const N: usize> Iterator for IntoIter<T, N> {
}
#[inline]
#[doc(hidden)]
unsafe fn __iterator_get_unchecked(&mut self, idx: usize) -> Self::Item
where
Self: TrustedRandomAccess,

View File

@@ -58,6 +58,7 @@ where
self.it.map(T::clone).fold(init, f)
}
#[doc(hidden)]
unsafe fn __iterator_get_unchecked(&mut self, idx: usize) -> T
where
Self: TrustedRandomAccess,

View File

@@ -74,6 +74,7 @@ where
self.it.count()
}
#[doc(hidden)]
unsafe fn __iterator_get_unchecked(&mut self, idx: usize) -> T
where
Self: TrustedRandomAccess,

View File

@@ -111,6 +111,7 @@ where
}
#[rustc_inherit_overflow_checks]
#[doc(hidden)]
unsafe fn __iterator_get_unchecked(&mut self, idx: usize) -> <Self as Iterator>::Item
where
Self: TrustedRandomAccess,

View File

@@ -114,6 +114,7 @@ where
}
#[inline]
#[doc(hidden)]
unsafe fn __iterator_get_unchecked(&mut self, idx: usize) -> Self::Item
where
Self: TrustedRandomAccess,

View File

@@ -122,6 +122,7 @@ where
self.iter.fold(init, map_fold(self.f, g))
}
#[doc(hidden)]
unsafe fn __iterator_get_unchecked(&mut self, idx: usize) -> B
where
Self: TrustedRandomAccess,

View File

@@ -88,6 +88,7 @@ where
}
#[inline]
#[doc(hidden)]
unsafe fn __iterator_get_unchecked(&mut self, idx: usize) -> Self::Item
where
Self: TrustedRandomAccess,

View File

@@ -667,6 +667,7 @@ impl<A: Step> Iterator for ops::Range<A> {
}
#[inline]
#[doc(hidden)]
unsafe fn __iterator_get_unchecked(&mut self, idx: usize) -> Self::Item
where
Self: TrustedRandomAccess,

View File

@@ -2148,6 +2148,7 @@ impl<'a, T, const N: usize> Iterator for ArrayChunks<'a, T, N> {
self.iter.last()
}
#[doc(hidden)]
unsafe fn __iterator_get_unchecked(&mut self, i: usize) -> &'a [T; N] {
// SAFETY: The safety guarantees of `__iterator_get_unchecked` are
// transferred to the caller.
@@ -2260,6 +2261,7 @@ impl<'a, T, const N: usize> Iterator for ArrayChunksMut<'a, T, N> {
self.iter.last()
}
#[doc(hidden)]
unsafe fn __iterator_get_unchecked(&mut self, i: usize) -> &'a mut [T; N] {
// SAFETY: The safety guarantees of `__iterator_get_unchecked` are transferred to
// the caller.

View File

@@ -295,6 +295,7 @@ impl Iterator for Bytes<'_> {
}
#[inline]
#[doc(hidden)]
unsafe fn __iterator_get_unchecked(&mut self, idx: usize) -> u8 {
// SAFETY: the caller must uphold the safety contract
// for `Iterator::__iterator_get_unchecked`.