Skip to content

Commit 6a90eca

Browse files
committed
Add on_unimplemented note to Index
1 parent 59dcba5 commit 6a90eca

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/libcore/ops.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -895,6 +895,7 @@ shr_impl_all! { u8 u16 u32 u64 usize i8 i16 i32 i64 isize }
895895
/// }
896896
/// ```
897897
#[lang="index"]
898+
#[rustc_on_unimplemented = "the type `{Self}` cannot be indexed by `{Index}`"]
898899
#[stable]
899900
pub trait Index<Index: ?Sized> {
900901
type Output: ?Sized;
@@ -933,6 +934,7 @@ pub trait Index<Index: ?Sized> {
933934
/// }
934935
/// ```
935936
#[lang="index_mut"]
937+
#[rustc_on_unimplemented = "the type `{Self}` cannot be mutably indexed by `{Index}`"]
936938
#[stable]
937939
pub trait IndexMut<Index: ?Sized> {
938940
type Output: ?Sized;

0 commit comments

Comments
 (0)