diff --git a/src/libcore/slice.rs b/src/libcore/slice.rs index 969c912128d06..542dfcbe6284f 100644 --- a/src/libcore/slice.rs +++ b/src/libcore/slice.rs @@ -523,7 +523,7 @@ impl SliceExt for [T] { } #[stable(feature = "rust1", since = "1.0.0")] -#[rustc_on_unimplemented = "slice indices are of type usize"] +#[rustc_on_unimplemented = "slice indices are of type `usize`"] impl ops::Index for [T] { type Output = T; @@ -534,7 +534,7 @@ impl ops::Index for [T] { } #[stable(feature = "rust1", since = "1.0.0")] -#[rustc_on_unimplemented = "slice indices are of type usize"] +#[rustc_on_unimplemented = "slice indices are of type `usize`"] impl ops::IndexMut for [T] { #[inline] fn index_mut(&mut self, index: usize) -> &mut T { @@ -568,7 +568,7 @@ fn slice_index_order_fail(index: usize, end: usize) -> ! { /// Requires that `begin <= end` and `end <= self.len()`, /// otherwise slicing will panic. #[stable(feature = "rust1", since = "1.0.0")] -#[rustc_on_unimplemented = "slice indices are of type usize"] +#[rustc_on_unimplemented = "slice indices are of type `usize`"] impl ops::Index> for [T] { type Output = [T]; @@ -595,7 +595,7 @@ impl ops::Index> for [T] { /// /// Equivalent to `&self[0 .. end]` #[stable(feature = "rust1", since = "1.0.0")] -#[rustc_on_unimplemented = "slice indices are of type usize"] +#[rustc_on_unimplemented = "slice indices are of type `usize`"] impl ops::Index> for [T] { type Output = [T]; @@ -611,7 +611,7 @@ impl ops::Index> for [T] { /// /// Equivalent to `&self[begin .. self.len()]` #[stable(feature = "rust1", since = "1.0.0")] -#[rustc_on_unimplemented = "slice indices are of type usize"] +#[rustc_on_unimplemented = "slice indices are of type `usize`"] impl ops::Index> for [T] { type Output = [T]; @@ -637,7 +637,7 @@ impl ops::Index for [T] { } #[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")] -#[rustc_on_unimplemented = "slice indices are of type usize"] +#[rustc_on_unimplemented = "slice indices are of type `usize`"] impl ops::Index> for [T] { type Output = [T]; @@ -653,7 +653,7 @@ impl ops::Index> for [T] { } } #[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")] -#[rustc_on_unimplemented = "slice indices are of type usize"] +#[rustc_on_unimplemented = "slice indices are of type `usize`"] impl ops::Index> for [T] { type Output = [T]; @@ -674,7 +674,7 @@ impl ops::Index> for [T] { /// Requires that `begin <= end` and `end <= self.len()`, /// otherwise slicing will panic. #[stable(feature = "rust1", since = "1.0.0")] -#[rustc_on_unimplemented = "slice indices are of type usize"] +#[rustc_on_unimplemented = "slice indices are of type `usize`"] impl ops::IndexMut> for [T] { #[inline] fn index_mut(&mut self, index: ops::Range) -> &mut [T] { @@ -699,7 +699,7 @@ impl ops::IndexMut> for [T] { /// /// Equivalent to `&mut self[0 .. end]` #[stable(feature = "rust1", since = "1.0.0")] -#[rustc_on_unimplemented = "slice indices are of type usize"] +#[rustc_on_unimplemented = "slice indices are of type `usize`"] impl ops::IndexMut> for [T] { #[inline] fn index_mut(&mut self, index: ops::RangeTo) -> &mut [T] { @@ -713,7 +713,7 @@ impl ops::IndexMut> for [T] { /// /// Equivalent to `&mut self[begin .. self.len()]` #[stable(feature = "rust1", since = "1.0.0")] -#[rustc_on_unimplemented = "slice indices are of type usize"] +#[rustc_on_unimplemented = "slice indices are of type `usize`"] impl ops::IndexMut> for [T] { #[inline] fn index_mut(&mut self, index: ops::RangeFrom) -> &mut [T] { @@ -736,7 +736,7 @@ impl ops::IndexMut for [T] { } #[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")] -#[rustc_on_unimplemented = "slice indices are of type usize"] +#[rustc_on_unimplemented = "slice indices are of type `usize`"] impl ops::IndexMut> for [T] { #[inline] fn index_mut(&mut self, index: ops::RangeInclusive) -> &mut [T] { @@ -750,7 +750,7 @@ impl ops::IndexMut> for [T] { } } #[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")] -#[rustc_on_unimplemented = "slice indices are of type usize"] +#[rustc_on_unimplemented = "slice indices are of type `usize`"] impl ops::IndexMut> for [T] { #[inline] fn index_mut(&mut self, index: ops::RangeToInclusive) -> &mut [T] { diff --git a/src/test/compile-fail/on-unimplemented/libcore-index.rs b/src/test/compile-fail/on-unimplemented/slice-index.rs similarity index 85% rename from src/test/compile-fail/on-unimplemented/libcore-index.rs rename to src/test/compile-fail/on-unimplemented/slice-index.rs index 6a8356040d4b4..6a8f9d471e169 100644 --- a/src/test/compile-fail/on-unimplemented/libcore-index.rs +++ b/src/test/compile-fail/on-unimplemented/slice-index.rs @@ -18,7 +18,7 @@ use std::ops::Index; fn main() { let x = &[1, 2, 3] as &[i32]; x[1i32]; //~ ERROR E0277 - //~| NOTE slice indices are of type usize + //~| NOTE slice indices are of type `usize` x[..1i32]; //~ ERROR E0277 - //~| NOTE slice indices are of type usize + //~| NOTE slice indices are of type `usize` }