diff --git a/src/libcore/ops.rs b/src/libcore/ops.rs index e7eb307689f..7d41c3fc5a5 100644 --- a/src/libcore/ops.rs +++ b/src/libcore/ops.rs @@ -830,28 +830,27 @@ shr_impl_all! { u8 u16 u32 u64 usize i8 i16 i32 i64 isize } /// /// # Example /// -/// A trivial implementation of `Index`. When `Foo[Foo]` happens, it ends up +/// A trivial implementation of `Index`. When `Foo[Bar]` happens, it ends up /// calling `index`, and therefore, `main` prints `Indexing!`. /// /// ``` -/// #![feature(associated_types)] -/// /// use std::ops::Index; /// /// #[derive(Copy)] /// struct Foo; +/// struct Bar; /// -/// impl Index for Foo { +/// impl Index for Foo { /// type Output = Foo; /// -/// fn index<'a>(&'a self, _index: &Foo) -> &'a Foo { +/// fn index<'a>(&'a self, _index: &Bar) -> &'a Foo { /// println!("Indexing!"); /// self /// } /// } /// /// fn main() { -/// Foo[Foo]; +/// Foo[Bar]; /// } /// ``` #[lang="index"] @@ -867,28 +866,27 @@ pub trait Index { /// /// # Example /// -/// A trivial implementation of `IndexMut`. When `Foo[Foo]` happens, it ends up +/// A trivial implementation of `IndexMut`. When `Foo[Bar]` happens, it ends up /// calling `index_mut`, and therefore, `main` prints `Indexing!`. /// /// ``` -/// #![feature(associated_types)] -/// /// use std::ops::IndexMut; /// /// #[derive(Copy)] /// struct Foo; +/// struct Bar; /// -/// impl IndexMut for Foo { +/// impl IndexMut for Foo { /// type Output = Foo; /// -/// fn index_mut<'a>(&'a mut self, _index: &Foo) -> &'a mut Foo { +/// fn index_mut<'a>(&'a mut self, _index: &Bar) -> &'a mut Foo { /// println!("Indexing!"); /// self /// } /// } /// /// fn main() { -/// &mut Foo[Foo]; +/// &mut Foo[Bar]; /// } /// ``` #[lang="index_mut"]