]> git.lizzy.rs Git - rust.git/commitdiff
Add on_unimplemented note to Index
authorManish Goregaokar <manishsmail@gmail.com>
Mon, 26 Jan 2015 15:03:07 +0000 (20:33 +0530)
committerManish Goregaokar <manishsmail@gmail.com>
Mon, 26 Jan 2015 20:49:52 +0000 (02:19 +0530)
src/libcore/ops.rs

index 372596cdd44ecfb3c30c5be0e7ec974f00c80c39..002c04f852ac2475f0d6c3935b6d417c0b19d721 100644 (file)
@@ -895,6 +895,7 @@ macro_rules! shr_impl_all {
 /// }
 /// ```
 #[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;