Skip to content

Commit 4480caf

Browse files
committed
auto merge of #18024 : phungleson/rust/fix-var-name-in-doc, r=brson
Make the doc more consistent & runnable. * Use `_index` instead of `_rhs` when appropriate. * Use `_from` and `_to` to avoid warning. * Remove unnecessary `::core::ops`
2 parents 2c0f876 + d9da347 commit 4480caf

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

src/libcore/ops.rs

+10-11
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ shr_impl!(uint u8 u16 u32 u64 int i8 i16 i32 i64)
626626
* struct Foo;
627627
*
628628
* impl Index<Foo, Foo> for Foo {
629-
* fn index<'a>(&'a self, _rhs: &Foo) -> &'a Foo {
629+
* fn index<'a>(&'a self, _index: &Foo) -> &'a Foo {
630630
* println!("Indexing!");
631631
* self
632632
* }
@@ -657,7 +657,7 @@ pub trait Index<Index, Result> {
657657
* struct Foo;
658658
*
659659
* impl IndexMut<Foo, Foo> for Foo {
660-
* fn index_mut<'a>(&'a mut self, _rhs: &Foo) -> &'a mut Foo {
660+
* fn index_mut<'a>(&'a mut self, _index: &Foo) -> &'a mut Foo {
661661
* println!("Indexing!");
662662
* self
663663
* }
@@ -687,20 +687,20 @@ pub trait IndexMut<Index, Result> {
687687
* ```ignore
688688
* struct Foo;
689689
*
690-
* impl ::core::ops::Slice<Foo, Foo> for Foo {
690+
* impl Slice<Foo, Foo> for Foo {
691691
* fn as_slice_<'a>(&'a self) -> &'a Foo {
692692
* println!("Slicing!");
693693
* self
694694
* }
695-
* fn slice_from_or_fail<'a>(&'a self, from: &Foo) -> &'a Foo {
695+
* fn slice_from_or_fail<'a>(&'a self, _from: &Foo) -> &'a Foo {
696696
* println!("Slicing!");
697697
* self
698698
* }
699-
* fn slice_to_or_fail<'a>(&'a self, to: &Foo) -> &'a Foo {
699+
* fn slice_to_or_fail<'a>(&'a self, _to: &Foo) -> &'a Foo {
700700
* println!("Slicing!");
701701
* self
702702
* }
703-
* fn slice_or_fail<'a>(&'a self, from: &Foo, to: &Foo) -> &'a Foo {
703+
* fn slice_or_fail<'a>(&'a self, _from: &Foo, _to: &Foo) -> &'a Foo {
704704
* println!("Slicing!");
705705
* self
706706
* }
@@ -736,20 +736,20 @@ pub trait Slice<Idx, Sized? Result> for Sized? {
736736
* ```ignore
737737
* struct Foo;
738738
*
739-
* impl ::core::ops::SliceMut<Foo, Foo> for Foo {
739+
* impl SliceMut<Foo, Foo> for Foo {
740740
* fn as_mut_slice_<'a>(&'a mut self) -> &'a mut Foo {
741741
* println!("Slicing!");
742742
* self
743743
* }
744-
* fn slice_from_or_fail_mut<'a>(&'a mut self, from: &Foo) -> &'a mut Foo {
744+
* fn slice_from_or_fail_mut<'a>(&'a mut self, _from: &Foo) -> &'a mut Foo {
745745
* println!("Slicing!");
746746
* self
747747
* }
748-
* fn slice_to_or_fail_mut<'a>(&'a mut self, to: &Foo) -> &'a mut Foo {
748+
* fn slice_to_or_fail_mut<'a>(&'a mut self, _to: &Foo) -> &'a mut Foo {
749749
* println!("Slicing!");
750750
* self
751751
* }
752-
* fn slice_or_fail_mut<'a>(&'a mut self, from: &Foo, to: &Foo) -> &'a mut Foo {
752+
* fn slice_or_fail_mut<'a>(&'a mut self, _from: &Foo, _to: &Foo) -> &'a mut Foo {
753753
* println!("Slicing!");
754754
* self
755755
* }
@@ -901,4 +901,3 @@ def_fn_mut!(A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12)
901901
def_fn_mut!(A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13)
902902
def_fn_mut!(A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14)
903903
def_fn_mut!(A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14 A15)
904-

0 commit comments

Comments
 (0)