about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libcore/ops.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libcore/ops.rs b/src/libcore/ops.rs
index 372596cdd44..002c04f852a 100644
--- a/src/libcore/ops.rs
+++ b/src/libcore/ops.rs
@@ -895,6 +895,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<Index: ?Sized> {
     type Output: ?Sized;
@@ -933,6 +934,7 @@ pub trait Index<Index: ?Sized> {
 /// }
 /// ```
 #[lang="index_mut"]
+#[rustc_on_unimplemented = "the type `{Self}` cannot be mutably indexed by `{Index}`"]
 #[stable]
 pub trait IndexMut<Index: ?Sized> {
     type Output: ?Sized;