diff --git a/src/libcore/slice/mod.rs b/src/libcore/slice/mod.rs index 0df3088c1ff28..6851f68afda3d 100644 --- a/src/libcore/slice/mod.rs +++ b/src/libcore/slice/mod.rs @@ -2009,37 +2009,31 @@ pub trait SliceIndex: private_slice_index::Sealed { /// Returns a shared reference to the output at this location, if in /// bounds. #[unstable(feature = "slice_index_methods", issue = "0")] - #[doc(hidden)] fn get(self, slice: &T) -> Option<&Self::Output>; /// Returns a mutable reference to the output at this location, if in /// bounds. #[unstable(feature = "slice_index_methods", issue = "0")] - #[doc(hidden)] fn get_mut(self, slice: &mut T) -> Option<&mut Self::Output>; /// Returns a shared reference to the output at this location, without /// performing any bounds checking. #[unstable(feature = "slice_index_methods", issue = "0")] - #[doc(hidden)] unsafe fn get_unchecked(self, slice: &T) -> &Self::Output; /// Returns a mutable reference to the output at this location, without /// performing any bounds checking. #[unstable(feature = "slice_index_methods", issue = "0")] - #[doc(hidden)] unsafe fn get_unchecked_mut(self, slice: &mut T) -> &mut Self::Output; /// Returns a shared reference to the output at this location, panicking /// if out of bounds. #[unstable(feature = "slice_index_methods", issue = "0")] - #[doc(hidden)] fn index(self, slice: &T) -> &Self::Output; /// Returns a mutable reference to the output at this location, panicking /// if out of bounds. #[unstable(feature = "slice_index_methods", issue = "0")] - #[doc(hidden)] fn index_mut(self, slice: &mut T) -> &mut Self::Output; } @@ -2048,7 +2042,6 @@ impl SliceIndex<[T]> for usize { type Output = T; #[inline] - #[doc(hidden)] fn get(self, slice: &[T]) -> Option<&T> { if self < slice.len() { unsafe { @@ -2060,7 +2053,6 @@ impl SliceIndex<[T]> for usize { } #[inline] - #[doc(hidden)] fn get_mut(self, slice: &mut [T]) -> Option<&mut T> { if self < slice.len() { unsafe { @@ -2072,26 +2064,22 @@ impl SliceIndex<[T]> for usize { } #[inline] - #[doc(hidden)] unsafe fn get_unchecked(self, slice: &[T]) -> &T { &*slice.as_ptr().offset(self as isize) } #[inline] - #[doc(hidden)] unsafe fn get_unchecked_mut(self, slice: &mut [T]) -> &mut T { &mut *slice.as_mut_ptr().offset(self as isize) } #[inline] - #[doc(hidden)] fn index(self, slice: &[T]) -> &T { // NB: use intrinsic indexing &(*slice)[self] } #[inline] - #[doc(hidden)] fn index_mut(self, slice: &mut [T]) -> &mut T { // NB: use intrinsic indexing &mut (*slice)[self] @@ -2103,7 +2091,6 @@ impl SliceIndex<[T]> for ops::Range { type Output = [T]; #[inline] - #[doc(hidden)] fn get(self, slice: &[T]) -> Option<&[T]> { if self.start > self.end || self.end > slice.len() { None @@ -2115,7 +2102,6 @@ impl SliceIndex<[T]> for ops::Range { } #[inline] - #[doc(hidden)] fn get_mut(self, slice: &mut [T]) -> Option<&mut [T]> { if self.start > self.end || self.end > slice.len() { None @@ -2127,19 +2113,16 @@ impl SliceIndex<[T]> for ops::Range { } #[inline] - #[doc(hidden)] unsafe fn get_unchecked(self, slice: &[T]) -> &[T] { from_raw_parts(slice.as_ptr().offset(self.start as isize), self.end - self.start) } #[inline] - #[doc(hidden)] unsafe fn get_unchecked_mut(self, slice: &mut [T]) -> &mut [T] { from_raw_parts_mut(slice.as_mut_ptr().offset(self.start as isize), self.end - self.start) } #[inline] - #[doc(hidden)] fn index(self, slice: &[T]) -> &[T] { if self.start > self.end { slice_index_order_fail(self.start, self.end); @@ -2152,7 +2135,6 @@ impl SliceIndex<[T]> for ops::Range { } #[inline] - #[doc(hidden)] fn index_mut(self, slice: &mut [T]) -> &mut [T] { if self.start > self.end { slice_index_order_fail(self.start, self.end); @@ -2170,37 +2152,31 @@ impl SliceIndex<[T]> for ops::RangeTo { type Output = [T]; #[inline] - #[doc(hidden)] fn get(self, slice: &[T]) -> Option<&[T]> { (0..self.end).get(slice) } #[inline] - #[doc(hidden)] fn get_mut(self, slice: &mut [T]) -> Option<&mut [T]> { (0..self.end).get_mut(slice) } #[inline] - #[doc(hidden)] unsafe fn get_unchecked(self, slice: &[T]) -> &[T] { (0..self.end).get_unchecked(slice) } #[inline] - #[doc(hidden)] unsafe fn get_unchecked_mut(self, slice: &mut [T]) -> &mut [T] { (0..self.end).get_unchecked_mut(slice) } #[inline] - #[doc(hidden)] fn index(self, slice: &[T]) -> &[T] { (0..self.end).index(slice) } #[inline] - #[doc(hidden)] fn index_mut(self, slice: &mut [T]) -> &mut [T] { (0..self.end).index_mut(slice) } @@ -2211,37 +2187,31 @@ impl SliceIndex<[T]> for ops::RangeFrom { type Output = [T]; #[inline] - #[doc(hidden)] fn get(self, slice: &[T]) -> Option<&[T]> { (self.start..slice.len()).get(slice) } #[inline] - #[doc(hidden)] fn get_mut(self, slice: &mut [T]) -> Option<&mut [T]> { (self.start..slice.len()).get_mut(slice) } #[inline] - #[doc(hidden)] unsafe fn get_unchecked(self, slice: &[T]) -> &[T] { (self.start..slice.len()).get_unchecked(slice) } #[inline] - #[doc(hidden)] unsafe fn get_unchecked_mut(self, slice: &mut [T]) -> &mut [T] { (self.start..slice.len()).get_unchecked_mut(slice) } #[inline] - #[doc(hidden)] fn index(self, slice: &[T]) -> &[T] { (self.start..slice.len()).index(slice) } #[inline] - #[doc(hidden)] fn index_mut(self, slice: &mut [T]) -> &mut [T] { (self.start..slice.len()).index_mut(slice) } @@ -2252,37 +2222,31 @@ impl SliceIndex<[T]> for ops::RangeFull { type Output = [T]; #[inline] - #[doc(hidden)] fn get(self, slice: &[T]) -> Option<&[T]> { Some(slice) } #[inline] - #[doc(hidden)] fn get_mut(self, slice: &mut [T]) -> Option<&mut [T]> { Some(slice) } #[inline] - #[doc(hidden)] unsafe fn get_unchecked(self, slice: &[T]) -> &[T] { slice } #[inline] - #[doc(hidden)] unsafe fn get_unchecked_mut(self, slice: &mut [T]) -> &mut [T] { slice } #[inline] - #[doc(hidden)] fn index(self, slice: &[T]) -> &[T] { slice } #[inline] - #[doc(hidden)] fn index_mut(self, slice: &mut [T]) -> &mut [T] { slice } @@ -2294,40 +2258,34 @@ impl SliceIndex<[T]> for ops::RangeInclusive { type Output = [T]; #[inline] - #[doc(hidden)] fn get(self, slice: &[T]) -> Option<&[T]> { if self.end == usize::max_value() { None } else { (self.start..self.end + 1).get(slice) } } #[inline] - #[doc(hidden)] fn get_mut(self, slice: &mut [T]) -> Option<&mut [T]> { if self.end == usize::max_value() { None } else { (self.start..self.end + 1).get_mut(slice) } } #[inline] - #[doc(hidden)] unsafe fn get_unchecked(self, slice: &[T]) -> &[T] { (self.start..self.end + 1).get_unchecked(slice) } #[inline] - #[doc(hidden)] unsafe fn get_unchecked_mut(self, slice: &mut [T]) -> &mut [T] { (self.start..self.end + 1).get_unchecked_mut(slice) } #[inline] - #[doc(hidden)] fn index(self, slice: &[T]) -> &[T] { if self.end == usize::max_value() { slice_index_overflow_fail(); } (self.start..self.end + 1).index(slice) } #[inline] - #[doc(hidden)] fn index_mut(self, slice: &mut [T]) -> &mut [T] { if self.end == usize::max_value() { slice_index_overflow_fail(); } (self.start..self.end + 1).index_mut(slice) @@ -2339,37 +2297,31 @@ impl SliceIndex<[T]> for ops::RangeToInclusive { type Output = [T]; #[inline] - #[doc(hidden)] fn get(self, slice: &[T]) -> Option<&[T]> { (0..=self.end).get(slice) } #[inline] - #[doc(hidden)] fn get_mut(self, slice: &mut [T]) -> Option<&mut [T]> { (0..=self.end).get_mut(slice) } #[inline] - #[doc(hidden)] unsafe fn get_unchecked(self, slice: &[T]) -> &[T] { (0..=self.end).get_unchecked(slice) } #[inline] - #[doc(hidden)] unsafe fn get_unchecked_mut(self, slice: &mut [T]) -> &mut [T] { (0..=self.end).get_unchecked_mut(slice) } #[inline] - #[doc(hidden)] fn index(self, slice: &[T]) -> &[T] { (0..=self.end).index(slice) } #[inline] - #[doc(hidden)] fn index_mut(self, slice: &mut [T]) -> &mut [T] { (0..=self.end).index_mut(slice) }