diff options
| author | Ariel Ben-Yehuda <ariel.byd@gmail.com> | 2016-05-18 23:28:31 +0300 |
|---|---|---|
| committer | Ariel Ben-Yehuda <ariel.byd@gmail.com> | 2016-05-18 23:28:31 +0300 |
| commit | b9a201c6dff196fc759fb1f1d3d292691fc5d99a (patch) | |
| tree | 2fa1a379c55395d8c11dac54c65144b19319e0ab | |
| parent | b344c7171e2e798307513393445739390ded6908 (diff) | |
| download | rust-b9a201c6dff196fc759fb1f1d3d292691fc5d99a.tar.gz rust-b9a201c6dff196fc759fb1f1d3d292691fc5d99a.zip | |
address review comments
| -rw-r--r-- | src/libcore/slice.rs | 24 | ||||
| -rw-r--r-- | src/test/compile-fail/on-unimplemented/slice-index.rs (renamed from src/test/compile-fail/on-unimplemented/libcore-index.rs) | 4 |
2 files changed, 14 insertions, 14 deletions
diff --git a/src/libcore/slice.rs b/src/libcore/slice.rs index 969c912128d..542dfcbe628 100644 --- a/src/libcore/slice.rs +++ b/src/libcore/slice.rs @@ -523,7 +523,7 @@ impl<T> 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<T> ops::Index<usize> for [T] { type Output = T; @@ -534,7 +534,7 @@ impl<T> ops::Index<usize> 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<T> ops::IndexMut<usize> 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<T> ops::Index<ops::Range<usize>> for [T] { type Output = [T]; @@ -595,7 +595,7 @@ impl<T> ops::Index<ops::Range<usize>> 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<T> ops::Index<ops::RangeTo<usize>> for [T] { type Output = [T]; @@ -611,7 +611,7 @@ impl<T> ops::Index<ops::RangeTo<usize>> 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<T> ops::Index<ops::RangeFrom<usize>> for [T] { type Output = [T]; @@ -637,7 +637,7 @@ impl<T> ops::Index<RangeFull> 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<T> ops::Index<ops::RangeInclusive<usize>> for [T] { type Output = [T]; @@ -653,7 +653,7 @@ impl<T> ops::Index<ops::RangeInclusive<usize>> 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<T> ops::Index<ops::RangeToInclusive<usize>> for [T] { type Output = [T]; @@ -674,7 +674,7 @@ impl<T> ops::Index<ops::RangeToInclusive<usize>> 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<T> ops::IndexMut<ops::Range<usize>> for [T] { #[inline] fn index_mut(&mut self, index: ops::Range<usize>) -> &mut [T] { @@ -699,7 +699,7 @@ impl<T> ops::IndexMut<ops::Range<usize>> 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<T> ops::IndexMut<ops::RangeTo<usize>> for [T] { #[inline] fn index_mut(&mut self, index: ops::RangeTo<usize>) -> &mut [T] { @@ -713,7 +713,7 @@ impl<T> ops::IndexMut<ops::RangeTo<usize>> 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<T> ops::IndexMut<ops::RangeFrom<usize>> for [T] { #[inline] fn index_mut(&mut self, index: ops::RangeFrom<usize>) -> &mut [T] { @@ -736,7 +736,7 @@ impl<T> ops::IndexMut<RangeFull> 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<T> ops::IndexMut<ops::RangeInclusive<usize>> for [T] { #[inline] fn index_mut(&mut self, index: ops::RangeInclusive<usize>) -> &mut [T] { @@ -750,7 +750,7 @@ impl<T> ops::IndexMut<ops::RangeInclusive<usize>> 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<T> ops::IndexMut<ops::RangeToInclusive<usize>> for [T] { #[inline] fn index_mut(&mut self, index: ops::RangeToInclusive<usize>) -> &mut [T] { diff --git a/src/test/compile-fail/on-unimplemented/libcore-index.rs b/src/test/compile-fail/on-unimplemented/slice-index.rs index 6a8356040d4..6a8f9d471e1 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` } |
