From 6a90eca8fce7edc34b3b11145781fd413c609ce5 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Mon, 26 Jan 2015 20:33:07 +0530 Subject: [PATCH] Add on_unimplemented note to Index --- src/libcore/ops.rs | 2 ++ 1 file changed, 2 insertions(+) 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 { type Output: ?Sized; @@ -933,6 +934,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;