diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2016-01-23 06:44:38 +0100 |
|---|---|---|
| committer | ggomez <guillaume1.gomez@gmail.com> | 2016-05-11 13:22:01 +0200 |
| commit | b8fad79a07ef287a80959ec8c4f82e7e6803b053 (patch) | |
| tree | e774b9770c39f14f2d6e6fe6451f6f18e6c70d58 /src/libcore | |
| parent | e9797d4be51e1118773877a078859f997c4191b2 (diff) | |
| download | rust-b8fad79a07ef287a80959ec8c4f82e7e6803b053.tar.gz rust-b8fad79a07ef287a80959ec8c4f82e7e6803b053.zip | |
Improve error message for Index trait on slices
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/slice.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libcore/slice.rs b/src/libcore/slice.rs index 07f76aca14d..e4b98ed6445 100644 --- a/src/libcore/slice.rs +++ b/src/libcore/slice.rs @@ -523,6 +523,8 @@ impl<T> SliceExt for [T] { } #[stable(feature = "rust1", since = "1.0.0")] +#[allow(unused_attributes)] +#[rustc_on_unimplemented = "a usize is required to index into a slice"] impl<T> ops::Index<usize> for [T] { type Output = T; @@ -533,6 +535,8 @@ impl<T> ops::Index<usize> for [T] { } #[stable(feature = "rust1", since = "1.0.0")] +#[allow(unused_attributes)] +#[rustc_on_unimplemented = "a usize is required to index into a slice"] impl<T> ops::IndexMut<usize> for [T] { #[inline] fn index_mut(&mut self, index: usize) -> &mut T { |
