Skip to content

Fix var name in doc for ops.rs #18024

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions src/libcore/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ shr_impl!(uint u8 u16 u32 u64 int i8 i16 i32 i64)
* struct Foo;
*
* impl Index<Foo, Foo> for Foo {
* fn index<'a>(&'a self, _rhs: &Foo) -> &'a Foo {
* fn index<'a>(&'a self, _index: &Foo) -> &'a Foo {
* println!("Indexing!");
* self
* }
Expand Down Expand Up @@ -657,7 +657,7 @@ pub trait Index<Index, Result> {
* struct Foo;
*
* impl IndexMut<Foo, Foo> for Foo {
* fn index_mut<'a>(&'a mut self, _rhs: &Foo) -> &'a mut Foo {
* fn index_mut<'a>(&'a mut self, _index: &Foo) -> &'a mut Foo {
* println!("Indexing!");
* self
* }
Expand Down Expand Up @@ -687,20 +687,20 @@ pub trait IndexMut<Index, Result> {
* ```ignore
* struct Foo;
*
* impl ::core::ops::Slice<Foo, Foo> for Foo {
* impl Slice<Foo, Foo> for Foo {
* fn as_slice_<'a>(&'a self) -> &'a Foo {
* println!("Slicing!");
* self
* }
* fn slice_from_or_fail<'a>(&'a self, from: &Foo) -> &'a Foo {
* fn slice_from_or_fail<'a>(&'a self, _from: &Foo) -> &'a Foo {
* println!("Slicing!");
* self
* }
* fn slice_to_or_fail<'a>(&'a self, to: &Foo) -> &'a Foo {
* fn slice_to_or_fail<'a>(&'a self, _to: &Foo) -> &'a Foo {
* println!("Slicing!");
* self
* }
* fn slice_or_fail<'a>(&'a self, from: &Foo, to: &Foo) -> &'a Foo {
* fn slice_or_fail<'a>(&'a self, _from: &Foo, _to: &Foo) -> &'a Foo {
* println!("Slicing!");
* self
* }
Expand Down Expand Up @@ -736,20 +736,20 @@ pub trait Slice<Idx, Sized? Result> for Sized? {
* ```ignore
* struct Foo;
*
* impl ::core::ops::SliceMut<Foo, Foo> for Foo {
* impl SliceMut<Foo, Foo> for Foo {
* fn as_mut_slice_<'a>(&'a mut self) -> &'a mut Foo {
* println!("Slicing!");
* self
* }
* fn slice_from_or_fail_mut<'a>(&'a mut self, from: &Foo) -> &'a mut Foo {
* fn slice_from_or_fail_mut<'a>(&'a mut self, _from: &Foo) -> &'a mut Foo {
* println!("Slicing!");
* self
* }
* fn slice_to_or_fail_mut<'a>(&'a mut self, to: &Foo) -> &'a mut Foo {
* fn slice_to_or_fail_mut<'a>(&'a mut self, _to: &Foo) -> &'a mut Foo {
* println!("Slicing!");
* self
* }
* fn slice_or_fail_mut<'a>(&'a mut self, from: &Foo, to: &Foo) -> &'a mut Foo {
* fn slice_or_fail_mut<'a>(&'a mut self, _from: &Foo, _to: &Foo) -> &'a mut Foo {
* println!("Slicing!");
* self
* }
Expand Down Expand Up @@ -901,4 +901,3 @@ def_fn_mut!(A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12)
def_fn_mut!(A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13)
def_fn_mut!(A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14)
def_fn_mut!(A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14 A15)