about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-10-18 06:22:15 +0000
committerbors <bors@rust-lang.org>2014-10-18 06:22:15 +0000
commit4480caf2a4999e2b7249049e7bfb6eb13a60e6b5 (patch)
treecb0f12e27edca14086d069b4bfd6a076149af187
parent2c0f87610d8fdcb6a90cd8dd1a372fe0ccc8a418 (diff)
parentd9da3471e8e074f3780e6dffe869852719f46bac (diff)
downloadrust-4480caf2a4999e2b7249049e7bfb6eb13a60e6b5.tar.gz
rust-4480caf2a4999e2b7249049e7bfb6eb13a60e6b5.zip
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`
-rw-r--r--src/libcore/ops.rs21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/libcore/ops.rs b/src/libcore/ops.rs
index f7cfa4c1baf..6de5f31c6d1 100644
--- a/src/libcore/ops.rs
+++ b/src/libcore/ops.rs
@@ -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
  *     }
@@ -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
  *     }
@@ -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
  *     }
@@ -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
  *     }
@@ -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)
-