diff --git a/src/libcore/ops.rs b/src/libcore/ops.rs index 49936396b8c..130db7d8ce6 100644 --- a/src/libcore/ops.rs +++ b/src/libcore/ops.rs @@ -893,6 +893,7 @@ shr_impl_all! { u8 u16 u32 u64 usize i8 i16 i32 i64 isize } /// } /// ``` #[lang="index"] +#[rustc_on_unimplemented = "the type `{Self}` cannot be indexed by `{Index}`"] #[stable] pub trait Index { type Output: ?Sized; @@ -931,6 +932,7 @@ pub trait Index { /// } /// ``` #[lang="index_mut"] +#[rustc_on_unimplemented = "the type `{Self}` cannot be mutably indexed by `{Index}`"] #[stable] pub trait IndexMut { type Output: ?Sized;