diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2017-06-06 19:32:43 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2017-06-19 22:25:05 -0700 |
| commit | be7ebdd512e8b4de29c0e0cf5aabf486e988867b (patch) | |
| tree | bb4cfa3e4d8b47883518fc1fd6a34b613b63aae7 /src/libcore/slice | |
| parent | 04145943a25c3b8c7e7d7fe8c2efb04f259c25fb (diff) | |
| download | rust-be7ebdd512e8b4de29c0e0cf5aabf486e988867b.tar.gz rust-be7ebdd512e8b4de29c0e0cf5aabf486e988867b.zip | |
Bump version and stage0 compiler
Diffstat (limited to 'src/libcore/slice')
| -rw-r--r-- | src/libcore/slice/mod.rs | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/src/libcore/slice/mod.rs b/src/libcore/slice/mod.rs index b13e19c0306..ce5da9ec2d5 100644 --- a/src/libcore/slice/mod.rs +++ b/src/libcore/slice/mod.rs @@ -1030,47 +1030,38 @@ impl<T> SliceIndex<[T]> for ops::RangeInclusive<usize> { } } -#[cfg(stage0)] // The bootstrap compiler has a different `...` desugar -fn inclusive(start: usize, end: usize) -> ops::RangeInclusive<usize> { - ops::RangeInclusive { start, end } -} -#[cfg(not(stage0))] -fn inclusive(start: usize, end: usize) -> ops::RangeInclusive<usize> { - start...end -} - #[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")] impl<T> SliceIndex<[T]> for ops::RangeToInclusive<usize> { type Output = [T]; #[inline] fn get(self, slice: &[T]) -> Option<&[T]> { - inclusive(0, self.end).get(slice) + (0...self.end).get(slice) } #[inline] fn get_mut(self, slice: &mut [T]) -> Option<&mut [T]> { - inclusive(0, self.end).get_mut(slice) + (0...self.end).get_mut(slice) } #[inline] unsafe fn get_unchecked(self, slice: &[T]) -> &[T] { - inclusive(0, self.end).get_unchecked(slice) + (0...self.end).get_unchecked(slice) } #[inline] unsafe fn get_unchecked_mut(self, slice: &mut [T]) -> &mut [T] { - inclusive(0, self.end).get_unchecked_mut(slice) + (0...self.end).get_unchecked_mut(slice) } #[inline] fn index(self, slice: &[T]) -> &[T] { - inclusive(0, self.end).index(slice) + (0...self.end).index(slice) } #[inline] fn index_mut(self, slice: &mut [T]) -> &mut [T] { - inclusive(0, self.end).index_mut(slice) + (0...self.end).index_mut(slice) } } |
