about summary refs log tree commit diff
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2015-01-28 04:32:20 +0530
committerManish Goregaokar <manishsmail@gmail.com>2015-01-28 04:32:20 +0530
commit28b0271f89272ae66912d6b805d67a54baadb50b (patch)
tree8b10f345d528aaad6550f095e5680d1afc51e8aa
parent335e8af98ad40aa1a426edae5b20851abf6c9c2a (diff)
parent6a90eca8fce7edc34b3b11145781fd413c609ce5 (diff)
downloadrust-28b0271f89272ae66912d6b805d67a54baadb50b.tar.gz
rust-28b0271f89272ae66912d6b805d67a54baadb50b.zip
Rollup merge of #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
-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 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<Index: ?Sized> {
     type Output: ?Sized;
@@ -931,6 +932,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;