|
16 | 16 |
|
17 | 17 | #![stable(feature = "rust1", since = "1.0.0")]
|
18 | 18 |
|
19 |
| -// FIXME: replace remaining ... by ..= after next stage0 |
20 |
| -// Silence warning: "... is being replaced by ..=" |
21 |
| -#![cfg_attr(not(stage0), allow(warnings))] |
| 19 | +// FIXME: after next stage0, change RangeInclusive { ... } back to ..= |
| 20 | +use ops::RangeInclusive; |
22 | 21 |
|
23 | 22 | // How this module is organized.
|
24 | 23 | //
|
@@ -1048,32 +1047,32 @@ impl<T> SliceIndex<[T]> for ops::RangeToInclusive<usize> {
|
1048 | 1047 |
|
1049 | 1048 | #[inline]
|
1050 | 1049 | fn get(self, slice: &[T]) -> Option<&[T]> {
|
1051 |
| - (0...self.end).get(slice) |
| 1050 | + (RangeInclusive { start: 0, end: self.end }).get(slice) |
1052 | 1051 | }
|
1053 | 1052 |
|
1054 | 1053 | #[inline]
|
1055 | 1054 | fn get_mut(self, slice: &mut [T]) -> Option<&mut [T]> {
|
1056 |
| - (0...self.end).get_mut(slice) |
| 1055 | + (RangeInclusive { start: 0, end: self.end }).get_mut(slice) |
1057 | 1056 | }
|
1058 | 1057 |
|
1059 | 1058 | #[inline]
|
1060 | 1059 | unsafe fn get_unchecked(self, slice: &[T]) -> &[T] {
|
1061 |
| - (0...self.end).get_unchecked(slice) |
| 1060 | + (RangeInclusive { start: 0, end: self.end }).get_unchecked(slice) |
1062 | 1061 | }
|
1063 | 1062 |
|
1064 | 1063 | #[inline]
|
1065 | 1064 | unsafe fn get_unchecked_mut(self, slice: &mut [T]) -> &mut [T] {
|
1066 |
| - (0...self.end).get_unchecked_mut(slice) |
| 1065 | + (RangeInclusive { start: 0, end: self.end }).get_unchecked_mut(slice) |
1067 | 1066 | }
|
1068 | 1067 |
|
1069 | 1068 | #[inline]
|
1070 | 1069 | fn index(self, slice: &[T]) -> &[T] {
|
1071 |
| - (0...self.end).index(slice) |
| 1070 | + (RangeInclusive { start: 0, end: self.end }).index(slice) |
1072 | 1071 | }
|
1073 | 1072 |
|
1074 | 1073 | #[inline]
|
1075 | 1074 | fn index_mut(self, slice: &mut [T]) -> &mut [T] {
|
1076 |
| - (0...self.end).index_mut(slice) |
| 1075 | + (RangeInclusive { start: 0, end: self.end }).index_mut(slice) |
1077 | 1076 | }
|
1078 | 1077 | }
|
1079 | 1078 |
|
|
0 commit comments