@@ -830,28 +830,27 @@ shr_impl_all! { u8 u16 u32 u64 usize i8 i16 i32 i64 isize }
830
830
///
831
831
/// # Example
832
832
///
833
- /// A trivial implementation of `Index`. When `Foo[Foo ]` happens, it ends up
833
+ /// A trivial implementation of `Index`. When `Foo[Bar ]` happens, it ends up
834
834
/// calling `index`, and therefore, `main` prints `Indexing!`.
835
835
///
836
836
/// ```
837
- /// #![feature(associated_types)]
838
- ///
839
837
/// use std::ops::Index;
840
838
///
841
839
/// #[derive(Copy)]
842
840
/// struct Foo;
841
+ /// struct Bar;
843
842
///
844
- /// impl Index<Foo > for Foo {
843
+ /// impl Index<Bar > for Foo {
845
844
/// type Output = Foo;
846
845
///
847
- /// fn index<'a>(&'a self, _index: &Foo ) -> &'a Foo {
846
+ /// fn index<'a>(&'a self, _index: &Bar ) -> &'a Foo {
848
847
/// println!("Indexing!");
849
848
/// self
850
849
/// }
851
850
/// }
852
851
///
853
852
/// fn main() {
854
- /// Foo[Foo ];
853
+ /// Foo[Bar ];
855
854
/// }
856
855
/// ```
857
856
#[ lang="index" ]
@@ -867,28 +866,27 @@ pub trait Index<Index: ?Sized> {
867
866
///
868
867
/// # Example
869
868
///
870
- /// A trivial implementation of `IndexMut`. When `Foo[Foo ]` happens, it ends up
869
+ /// A trivial implementation of `IndexMut`. When `Foo[Bar ]` happens, it ends up
871
870
/// calling `index_mut`, and therefore, `main` prints `Indexing!`.
872
871
///
873
872
/// ```
874
- /// #![feature(associated_types)]
875
- ///
876
873
/// use std::ops::IndexMut;
877
874
///
878
875
/// #[derive(Copy)]
879
876
/// struct Foo;
877
+ /// struct Bar;
880
878
///
881
- /// impl IndexMut<Foo > for Foo {
879
+ /// impl IndexMut<Bar > for Foo {
882
880
/// type Output = Foo;
883
881
///
884
- /// fn index_mut<'a>(&'a mut self, _index: &Foo ) -> &'a mut Foo {
882
+ /// fn index_mut<'a>(&'a mut self, _index: &Bar ) -> &'a mut Foo {
885
883
/// println!("Indexing!");
886
884
/// self
887
885
/// }
888
886
/// }
889
887
///
890
888
/// fn main() {
891
- /// &mut Foo[Foo ];
889
+ /// &mut Foo[Bar ];
892
890
/// }
893
891
/// ```
894
892
#[ lang="index_mut" ]
0 commit comments