Skip to content

Commit 0e6ebad

Browse files
committed
Rollup merge of rust-lang#21658 - Manishearth:index_on_unimplemented, r=Gankro
Helps issues like [these](http://www.reddit.com/r/rust/comments/2tpefm/unable_to_access_array_elements/) r? @gankro rollup-worthy
2 parents 77879df + 6a90eca commit 0e6ebad

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/libcore/ops.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -893,6 +893,7 @@ shr_impl_all! { u8 u16 u32 u64 usize i8 i16 i32 i64 isize }
893893
/// }
894894
/// ```
895895
#[lang="index"]
896+
#[rustc_on_unimplemented = "the type `{Self}` cannot be indexed by `{Index}`"]
896897
#[stable]
897898
pub trait Index<Index: ?Sized> {
898899
type Output: ?Sized;
@@ -931,6 +932,7 @@ pub trait Index<Index: ?Sized> {
931932
/// }
932933
/// ```
933934
#[lang="index_mut"]
935+
#[rustc_on_unimplemented = "the type `{Self}` cannot be mutably indexed by `{Index}`"]
934936
#[stable]
935937
pub trait IndexMut<Index: ?Sized> {
936938
type Output: ?Sized;

0 commit comments

Comments
 (0)