From 118b975c805533bab31f8155ad0af29b3635d3fc Mon Sep 17 00:00:00 2001
From: Nathan Kleyn <nathan@nathankleyn.com>
Date: Tue, 8 Mar 2016 23:27:24 +0000
Subject: [PATCH 01/11] Add missing documentation examples for BinaryHeap.

As part of the ongoing effort to document all methods with examples,
this commit adds the missing examples for the `BinaryHeap` collection
type.

This is part of issue #29348.
---
 src/libcollections/binary_heap.rs | 106 ++++++++++++++++++++++++++++++
 1 file changed, 106 insertions(+)

diff --git a/src/libcollections/binary_heap.rs b/src/libcollections/binary_heap.rs
index bd329949618e5..efd56bdb264f2 100644
--- a/src/libcollections/binary_heap.rs
+++ b/src/libcollections/binary_heap.rs
@@ -167,6 +167,49 @@ use vec::{self, Vec};
 /// item's ordering relative to any other item, as determined by the `Ord`
 /// trait, changes while it is in the heap. This is normally only possible
 /// through `Cell`, `RefCell`, global state, I/O, or unsafe code.
+///
+/// # Examples
+///
+/// ```
+/// use std::collections::BinaryHeap;
+///
+/// // type inference lets us omit an explicit type signature (which
+/// // would be `BinaryHeap<i32>` in this example).
+/// let mut heap = BinaryHeap::new();
+///
+/// // We can use peek to look at the next item in the heap. In this case,
+/// // there's no items in there yet so we get None.
+/// assert_eq!(heap.peek(), None);
+///
+/// // Let's add some scores...
+/// heap.push(1);
+/// heap.push(5);
+/// heap.push(2);
+///
+/// // Now peek shows the most important item in the heap.
+/// assert_eq!(heap.peek(), Some(&5));
+///
+/// // We can check the length of a heap.
+/// assert_eq!(heap.len(), 3);
+///
+/// // We can iterate over the items in the heap, although they are returned in
+/// // a random order.
+/// for x in heap.iter() {
+///     println!("{}", x);
+/// }
+///
+/// // If we instead pop these scores, they should come back in order.
+/// assert_eq!(heap.pop(), Some(5));
+/// assert_eq!(heap.pop(), Some(2));
+/// assert_eq!(heap.pop(), Some(1));
+/// assert_eq!(heap.pop(), None);
+///
+/// // We can clear the heap of any remaining items.
+/// heap.clear();
+///
+/// // The heap should now be empty.
+/// assert!(heap.is_empty())
+/// ```
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct BinaryHeap<T> {
     data: Vec<T>,
@@ -331,6 +374,17 @@ impl<T: Ord> BinaryHeap<T> {
     }
 
     /// Discards as much additional capacity as possible.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use std::collections::BinaryHeap;
+    /// let mut heap: BinaryHeap<i32> = BinaryHeap::with_capacity(100);
+    ///
+    /// assert!(heap.capacity() >= 100);
+    /// heap.shrink_to_fit();
+    /// assert!(heap.capacity() == 0);
+    /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn shrink_to_fit(&mut self) {
         self.data.shrink_to_fit();
@@ -571,12 +625,36 @@ impl<T: Ord> BinaryHeap<T> {
     }
 
     /// Returns the length of the binary heap.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use std::collections::BinaryHeap;
+    /// let mut heap = BinaryHeap::from(vec![1, 3]);
+    ///
+    /// assert_eq!(heap.len(), 2);
+    /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn len(&self) -> usize {
         self.data.len()
     }
 
     /// Checks if the binary heap is empty.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use std::collections::BinaryHeap;
+    /// let mut heap = BinaryHeap::new();
+    ///
+    /// assert!(heap.is_empty());
+    ///
+    /// heap.push(3);
+    /// heap.push(5);
+    /// heap.push(1);
+    ///
+    /// assert!(!heap.is_empty());
+    /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn is_empty(&self) -> bool {
         self.len() == 0
@@ -585,6 +663,21 @@ impl<T: Ord> BinaryHeap<T> {
     /// Clears the binary heap, returning an iterator over the removed elements.
     ///
     /// The elements are removed in arbitrary order.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use std::collections::BinaryHeap;
+    /// let mut heap = BinaryHeap::from(vec![1, 3]);
+    ///
+    /// assert!(!heap.is_empty());
+    ///
+    /// for x in heap.drain() {
+    ///     println!("{}", x);
+    /// }
+    ///
+    /// assert!(heap.is_empty());
+    /// ```
     #[inline]
     #[stable(feature = "drain", since = "1.6.0")]
     pub fn drain(&mut self) -> Drain<T> {
@@ -592,6 +685,19 @@ impl<T: Ord> BinaryHeap<T> {
     }
 
     /// Drops all items from the binary heap.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use std::collections::BinaryHeap;
+    /// let mut heap = BinaryHeap::from(vec![1, 3]);
+    ///
+    /// assert!(!heap.is_empty());
+    ///
+    /// heap.clear();
+    ///
+    /// assert!(heap.is_empty());
+    /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn clear(&mut self) {
         self.drain();

From 04436fb65b7efa81793f0f89cf375d0fadf99f89 Mon Sep 17 00:00:00 2001
From: Nathan Kleyn <nathan@nathankleyn.com>
Date: Wed, 9 Mar 2016 16:18:31 +0000
Subject: [PATCH 02/11] Address review comments to add "basic usage" sections
 to docs.

---
 src/libcollections/binary_heap.rs | 38 +++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/src/libcollections/binary_heap.rs b/src/libcollections/binary_heap.rs
index efd56bdb264f2..29258180c67ba 100644
--- a/src/libcollections/binary_heap.rs
+++ b/src/libcollections/binary_heap.rs
@@ -246,6 +246,8 @@ impl<T: Ord> BinaryHeap<T> {
     ///
     /// # Examples
     ///
+    /// Basic usage:
+    ///
     /// ```
     /// use std::collections::BinaryHeap;
     /// let mut heap = BinaryHeap::new();
@@ -263,6 +265,8 @@ impl<T: Ord> BinaryHeap<T> {
     ///
     /// # Examples
     ///
+    /// Basic usage:
+    ///
     /// ```
     /// use std::collections::BinaryHeap;
     /// let mut heap = BinaryHeap::with_capacity(10);
@@ -278,6 +282,8 @@ impl<T: Ord> BinaryHeap<T> {
     ///
     /// # Examples
     ///
+    /// Basic usage:
+    ///
     /// ```
     /// use std::collections::BinaryHeap;
     /// let heap = BinaryHeap::from(vec![1, 2, 3, 4]);
@@ -296,6 +302,8 @@ impl<T: Ord> BinaryHeap<T> {
     ///
     /// # Examples
     ///
+    /// Basic usage:
+    ///
     /// ```
     /// use std::collections::BinaryHeap;
     /// let mut heap = BinaryHeap::new();
@@ -316,6 +324,8 @@ impl<T: Ord> BinaryHeap<T> {
     ///
     /// # Examples
     ///
+    /// Basic usage:
+    ///
     /// ```
     /// use std::collections::BinaryHeap;
     /// let mut heap = BinaryHeap::with_capacity(100);
@@ -340,6 +350,8 @@ impl<T: Ord> BinaryHeap<T> {
     ///
     /// # Examples
     ///
+    /// Basic usage:
+    ///
     /// ```
     /// use std::collections::BinaryHeap;
     /// let mut heap = BinaryHeap::new();
@@ -361,6 +373,8 @@ impl<T: Ord> BinaryHeap<T> {
     ///
     /// # Examples
     ///
+    /// Basic usage:
+    ///
     /// ```
     /// use std::collections::BinaryHeap;
     /// let mut heap = BinaryHeap::new();
@@ -377,6 +391,8 @@ impl<T: Ord> BinaryHeap<T> {
     ///
     /// # Examples
     ///
+    /// Basic usage:
+    ///
     /// ```
     /// use std::collections::BinaryHeap;
     /// let mut heap: BinaryHeap<i32> = BinaryHeap::with_capacity(100);
@@ -395,6 +411,8 @@ impl<T: Ord> BinaryHeap<T> {
     ///
     /// # Examples
     ///
+    /// Basic usage:
+    ///
     /// ```
     /// use std::collections::BinaryHeap;
     /// let mut heap = BinaryHeap::from(vec![1, 3]);
@@ -418,6 +436,8 @@ impl<T: Ord> BinaryHeap<T> {
     ///
     /// # Examples
     ///
+    /// Basic usage:
+    ///
     /// ```
     /// use std::collections::BinaryHeap;
     /// let mut heap = BinaryHeap::new();
@@ -440,6 +460,8 @@ impl<T: Ord> BinaryHeap<T> {
     ///
     /// # Examples
     ///
+    /// Basic usage:
+    ///
     /// ```
     /// #![feature(binary_heap_extras)]
     ///
@@ -478,6 +500,8 @@ impl<T: Ord> BinaryHeap<T> {
     ///
     /// # Examples
     ///
+    /// Basic usage:
+    ///
     /// ```
     /// #![feature(binary_heap_extras)]
     ///
@@ -508,6 +532,8 @@ impl<T: Ord> BinaryHeap<T> {
     ///
     /// # Examples
     ///
+    /// Basic usage:
+    ///
     /// ```
     /// use std::collections::BinaryHeap;
     /// let heap = BinaryHeap::from(vec![1, 2, 3, 4, 5, 6, 7]);
@@ -528,6 +554,8 @@ impl<T: Ord> BinaryHeap<T> {
     ///
     /// # Examples
     ///
+    /// Basic usage:
+    ///
     /// ```
     /// use std::collections::BinaryHeap;
     ///
@@ -628,6 +656,8 @@ impl<T: Ord> BinaryHeap<T> {
     ///
     /// # Examples
     ///
+    /// Basic usage:
+    ///
     /// ```
     /// use std::collections::BinaryHeap;
     /// let mut heap = BinaryHeap::from(vec![1, 3]);
@@ -643,6 +673,8 @@ impl<T: Ord> BinaryHeap<T> {
     ///
     /// # Examples
     ///
+    /// Basic usage:
+    ///
     /// ```
     /// use std::collections::BinaryHeap;
     /// let mut heap = BinaryHeap::new();
@@ -666,6 +698,8 @@ impl<T: Ord> BinaryHeap<T> {
     ///
     /// # Examples
     ///
+    /// Basic usage:
+    ///
     /// ```
     /// use std::collections::BinaryHeap;
     /// let mut heap = BinaryHeap::from(vec![1, 3]);
@@ -688,6 +722,8 @@ impl<T: Ord> BinaryHeap<T> {
     ///
     /// # Examples
     ///
+    /// Basic usage:
+    ///
     /// ```
     /// use std::collections::BinaryHeap;
     /// let mut heap = BinaryHeap::from(vec![1, 3]);
@@ -915,6 +951,8 @@ impl<T: Ord> IntoIterator for BinaryHeap<T> {
     ///
     /// # Examples
     ///
+    /// Basic usage:
+    ///
     /// ```
     /// use std::collections::BinaryHeap;
     /// let heap = BinaryHeap::from(vec![1, 2, 3, 4]);

From da4fda44e742671c9451b0b0fd811a5626828041 Mon Sep 17 00:00:00 2001
From: Nathan Kleyn <nathan@nathankleyn.com>
Date: Thu, 10 Mar 2016 11:40:31 +0000
Subject: [PATCH 03/11] Remove unnecessary mut in docs causing test failures.

---
 src/libcollections/binary_heap.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libcollections/binary_heap.rs b/src/libcollections/binary_heap.rs
index 29258180c67ba..ba317334cfa0b 100644
--- a/src/libcollections/binary_heap.rs
+++ b/src/libcollections/binary_heap.rs
@@ -660,7 +660,7 @@ impl<T: Ord> BinaryHeap<T> {
     ///
     /// ```
     /// use std::collections::BinaryHeap;
-    /// let mut heap = BinaryHeap::from(vec![1, 3]);
+    /// let heap = BinaryHeap::from(vec![1, 3]);
     ///
     /// assert_eq!(heap.len(), 2);
     /// ```

From 3d163218700364a67c1120aa437d7b8f229f0663 Mon Sep 17 00:00:00 2001
From: "Craig M. Brandenburg" <c.m.brandenburg@gmail.com>
Date: Thu, 10 Mar 2016 05:14:00 -0700
Subject: [PATCH 04/11] Spell fixes for std::ffi doc comments

---
 src/libstd/ffi/os_str.rs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/libstd/ffi/os_str.rs b/src/libstd/ffi/os_str.rs
index cf4f4bdf291bc..d979aa264af81 100644
--- a/src/libstd/ffi/os_str.rs
+++ b/src/libstd/ffi/os_str.rs
@@ -22,7 +22,7 @@ use sys::os_str::{Buf, Slice};
 use sys_common::{AsInner, IntoInner, FromInner};
 
 /// A type that can represent owned, mutable platform-native strings, but is
-/// cheaply interconvertable with Rust strings.
+/// cheaply inter-convertible with Rust strings.
 ///
 /// The need for this type arises from the fact that:
 ///
@@ -272,7 +272,7 @@ impl OsStr {
         unsafe { mem::transmute(inner) }
     }
 
-    /// Yields a `&str` slice if the `OsStr` is valid unicode.
+    /// Yields a `&str` slice if the `OsStr` is valid Unicode.
     ///
     /// This conversion may entail doing a check for UTF-8 validity.
     #[stable(feature = "rust1", since = "1.0.0")]
@@ -301,7 +301,7 @@ impl OsStr {
     /// On Unix systems, this is a no-op.
     ///
     /// On Windows systems, this returns `None` unless the `OsStr` is
-    /// valid unicode, in which case it produces UTF-8-encoded
+    /// valid Unicode, in which case it produces UTF-8-encoded
     /// data. This may entail checking validity.
     #[unstable(feature = "convert", reason = "recently added", issue = "27704")]
     #[rustc_deprecated(reason = "RFC was closed, hides subtle Windows semantics",

From 4d476693f0ccebeb1ca101d5915b1210de4e6246 Mon Sep 17 00:00:00 2001
From: Noah <nba4191@gmail.com>
Date: Thu, 10 Mar 2016 11:34:42 -0600
Subject: [PATCH 05/11] Update getting-started.md

In `rustc 1.7.0` the message that is displayed is now `Rust is ready to roll.`
---
 src/doc/book/getting-started.md | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/src/doc/book/getting-started.md b/src/doc/book/getting-started.md
index 31ee385a928d6..b0d4c6d6dd242 100644
--- a/src/doc/book/getting-started.md
+++ b/src/doc/book/getting-started.md
@@ -119,19 +119,7 @@ This will download a script, and start the installation. If it all goes well,
 you’ll see this appear:
 
 ```text
-Welcome to Rust.
-
-This script will download the Rust compiler and its package manager, Cargo, and
-install them to /usr/local. You may install elsewhere by running this script
-with the --prefix=<path> option.
-
-The installer will run under ‘sudo’ and may ask you for your password. If you do
-not want the script to run ‘sudo’ then pass it the --disable-sudo flag.
-
-You may uninstall later by running /usr/local/lib/rustlib/uninstall.sh,
-or by running this script again with the --uninstall flag.
-
-Continue? (y/N)
+Rust is ready to roll.
 ```
 
 From here, press `y` for ‘yes’, and then follow the rest of the prompts.

From bf50bd4befd862c6ac18af2b1a4f3b9ada7774dd Mon Sep 17 00:00:00 2001
From: srinivasreddy <thatiparthysreenivas@gmail.com>
Date: Fri, 11 Mar 2016 00:05:53 +0530
Subject: [PATCH 06/11] Removed integer suffixes in libsyntax crate

---
 src/libsyntax/ast.rs            | 6 +++---
 src/libsyntax/errors/emitter.rs | 2 +-
 src/libsyntax/print/pp.rs       | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index a8bea2da83349..f7621b0131ad4 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -927,7 +927,7 @@ pub enum ExprKind {
     Binary(BinOp, P<Expr>, P<Expr>),
     /// A unary operation (For example: `!x`, `*x`)
     Unary(UnOp, P<Expr>),
-    /// A literal (For example: `1u8`, `"foo"`)
+    /// A literal (For example: `1`, `"foo"`)
     Lit(P<Lit>),
     /// A cast (`foo as f64`)
     Cast(P<Expr>, P<Ty>),
@@ -1016,7 +1016,7 @@ pub enum ExprKind {
 
     /// An array literal constructed from one repeated element.
     ///
-    /// For example, `[1u8; 5]`. The first expression is the element
+    /// For example, `[1; 5]`. The first expression is the element
     /// to be repeated; the second is the number of times to repeat it.
     Repeat(P<Expr>, P<Expr>),
 
@@ -1288,7 +1288,7 @@ pub enum LitKind {
     Byte(u8),
     /// A character literal (`'a'`)
     Char(char),
-    /// An integer literal (`1u8`)
+    /// An integer literal (`1`)
     Int(u64, LitIntType),
     /// A float literal (`1f64` or `1E10f64`)
     Float(InternedString, FloatTy),
diff --git a/src/libsyntax/errors/emitter.rs b/src/libsyntax/errors/emitter.rs
index 4272f281edb44..dd8abedef7dec 100644
--- a/src/libsyntax/errors/emitter.rs
+++ b/src/libsyntax/errors/emitter.rs
@@ -663,7 +663,7 @@ fn stderr_isatty() -> bool {
     type DWORD = u32;
     type BOOL = i32;
     type HANDLE = *mut u8;
-    const STD_ERROR_HANDLE: DWORD = -12i32 as DWORD;
+    const STD_ERROR_HANDLE: DWORD = -12 as DWORD;
     extern "system" {
         fn GetStdHandle(which: DWORD) -> HANDLE;
         fn GetConsoleMode(hConsoleHandle: HANDLE,
diff --git a/src/libsyntax/print/pp.rs b/src/libsyntax/print/pp.rs
index cbbd5289a5a2d..c1d922ea665b1 100644
--- a/src/libsyntax/print/pp.rs
+++ b/src/libsyntax/print/pp.rs
@@ -168,8 +168,8 @@ pub fn mk_printer<'a>(out: Box<io::Write+'a>, linewidth: usize) -> Printer<'a> {
     let n: usize = 3 * linewidth;
     debug!("mk_printer {}", linewidth);
     let token = vec![Token::Eof; n];
-    let size = vec![0_isize; n];
-    let scan_stack = vec![0_usize; n];
+    let size = vec![0; n];
+    let scan_stack = vec![0; n];
     Printer {
         out: out,
         buf_len: n,

From 266c41707147ea66f06b0ef8e3086c01f9791447 Mon Sep 17 00:00:00 2001
From: srinivasreddy <thatiparthysreenivas@gmail.com>
Date: Fri, 11 Mar 2016 00:41:25 +0530
Subject: [PATCH 07/11] removed integer constants in librustc_typeck

---
 src/librustc_typeck/diagnostics.rs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs
index cfe76206b0290..f376b42fbf968 100644
--- a/src/librustc_typeck/diagnostics.rs
+++ b/src/librustc_typeck/diagnostics.rs
@@ -379,7 +379,7 @@ impl Test {
 
 fn main() {
     let x = Test;
-    let v = &[0i32];
+    let v = &[0];
 
     x.method::<i32, i32>(v); // error: only one type parameter is expected!
 }
@@ -398,7 +398,7 @@ impl Test {
 
 fn main() {
     let x = Test;
-    let v = &[0i32];
+    let v = &[0];
 
     x.method::<i32>(v); // OK, we're good!
 }
@@ -901,7 +901,7 @@ Example of erroneous code:
 ```compile_fail
 enum Foo { FirstValue(i32) };
 
-let u = Foo::FirstValue { value: 0i32 }; // error: Foo::FirstValue
+let u = Foo::FirstValue { value: 0 }; // error: Foo::FirstValue
                                          // isn't a structure!
 // or even simpler, if the name doesn't refer to a structure at all.
 let t = u32 { value: 4 }; // error: `u32` does not name a structure.

From fe541b168e4122844dc4b7ebb7a1de1613958c34 Mon Sep 17 00:00:00 2001
From: srinivasreddy <thatiparthysreenivas@gmail.com>
Date: Fri, 11 Mar 2016 01:32:03 +0530
Subject: [PATCH 08/11] removed suffixes for librustc_front

---
 src/librustc_front/hir.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/librustc_front/hir.rs b/src/librustc_front/hir.rs
index ece62364376fc..cc7c0f7865ea5 100644
--- a/src/librustc_front/hir.rs
+++ b/src/librustc_front/hir.rs
@@ -737,7 +737,7 @@ pub enum Expr_ {
     ExprBinary(BinOp, P<Expr>, P<Expr>),
     /// A unary operation (For example: `!x`, `*x`)
     ExprUnary(UnOp, P<Expr>),
-    /// A literal (For example: `1u8`, `"foo"`)
+    /// A literal (For example: `1`, `"foo"`)
     ExprLit(P<Lit>),
     /// A cast (`foo as f64`)
     ExprCast(P<Expr>, P<Ty>),
@@ -804,7 +804,7 @@ pub enum Expr_ {
 
     /// A vector literal constructed from one repeated element.
     ///
-    /// For example, `[1u8; 5]`. The first expression is the element
+    /// For example, `[1; 5]`. The first expression is the element
     /// to be repeated; the second is the number of times to repeat it.
     ExprRepeat(P<Expr>, P<Expr>),
 }

From bfffe6d9d25d52f75705b5ebcc741b6844c2aa81 Mon Sep 17 00:00:00 2001
From: Ulrik Sverdrup <bluss@users.noreply.github.com>
Date: Thu, 10 Mar 2016 21:36:43 +0100
Subject: [PATCH 09/11] Clarify doc for slice slicing (Index impls)

This is a follow up for PR #32099 and #32057
---
 src/libcore/slice.rs | 58 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)

diff --git a/src/libcore/slice.rs b/src/libcore/slice.rs
index 8acd0c8f2cf06..823acf68001c7 100644
--- a/src/libcore/slice.rs
+++ b/src/libcore/slice.rs
@@ -535,6 +535,16 @@ fn slice_index_order_fail(index: usize, end: usize) -> ! {
 
 // FIXME implement indexing with inclusive ranges
 
+/// Implements slicing with syntax `&self[begin .. end]`.
+///
+/// Returns a slice of self for the index range [`begin`..`end`).
+///
+/// This operation is `O(1)`.
+///
+/// # Panics
+///
+/// Requires that `begin <= end` and `end <= self.len()`,
+/// otherwise slicing will panic.
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T> ops::Index<ops::Range<usize>> for [T] {
     type Output = [T];
@@ -554,6 +564,13 @@ impl<T> ops::Index<ops::Range<usize>> for [T] {
         }
     }
 }
+
+/// Implements slicing with syntax `&self[.. end]`.
+///
+/// Returns a slice of self from the beginning until but not including
+/// the index `end`.
+///
+/// Equivalent to `&self[0 .. end]`
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T> ops::Index<ops::RangeTo<usize>> for [T] {
     type Output = [T];
@@ -563,6 +580,12 @@ impl<T> ops::Index<ops::RangeTo<usize>> for [T] {
         self.index(0 .. index.end)
     }
 }
+
+/// Implements slicing with syntax `&self[begin ..]`.
+///
+/// Returns a slice of self from and including the index `begin` until the end.
+///
+/// Equivalent to `&self[begin .. self.len()]`
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T> ops::Index<ops::RangeFrom<usize>> for [T] {
     type Output = [T];
@@ -572,6 +595,12 @@ impl<T> ops::Index<ops::RangeFrom<usize>> for [T] {
         self.index(index.start .. self.len())
     }
 }
+
+/// Implements slicing with syntax `&self[..]`.
+///
+/// Returns a slice of the whole slice. This operation can not panic.
+///
+/// Equivalent to `&self[0 .. self.len()]`
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T> ops::Index<RangeFull> for [T] {
     type Output = [T];
@@ -608,6 +637,16 @@ impl<T> ops::Index<ops::RangeToInclusive<usize>> for [T] {
     }
 }
 
+/// Implements mutable slicing with syntax `&mut self[begin .. end]`.
+///
+/// Returns a slice of self for the index range [`begin`..`end`).
+///
+/// This operation is `O(1)`.
+///
+/// # Panics
+///
+/// Requires that `begin <= end` and `end <= self.len()`,
+/// otherwise slicing will panic.
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T> ops::IndexMut<ops::Range<usize>> for [T] {
     #[inline]
@@ -625,6 +664,13 @@ impl<T> ops::IndexMut<ops::Range<usize>> for [T] {
         }
     }
 }
+
+/// Implements mutable slicing with syntax `&mut self[.. end]`.
+///
+/// Returns a slice of self from the beginning until but not including
+/// the index `end`.
+///
+/// Equivalent to `&mut self[0 .. end]`
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T> ops::IndexMut<ops::RangeTo<usize>> for [T] {
     #[inline]
@@ -632,6 +678,12 @@ impl<T> ops::IndexMut<ops::RangeTo<usize>> for [T] {
         self.index_mut(0 .. index.end)
     }
 }
+
+/// Implements mutable slicing with syntax `&mut self[begin ..]`.
+///
+/// Returns a slice of self from and including the index `begin` until the end.
+///
+/// Equivalent to `&mut self[begin .. self.len()]`
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T> ops::IndexMut<ops::RangeFrom<usize>> for [T] {
     #[inline]
@@ -640,6 +692,12 @@ impl<T> ops::IndexMut<ops::RangeFrom<usize>> for [T] {
         self.index_mut(index.start .. len)
     }
 }
+
+/// Implements mutable slicing with syntax `&mut self[..]`.
+///
+/// Returns a slice of the whole slice. This operation can not panic.
+///
+/// Equivalent to `&mut self[0 .. self.len()]`
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T> ops::IndexMut<RangeFull> for [T] {
     #[inline]

From e1cc628549020207e07ce8271478f7baff602757 Mon Sep 17 00:00:00 2001
From: srinivasreddy <thatiparthysreenivas@gmail.com>
Date: Fri, 11 Mar 2016 08:36:36 +0530
Subject: [PATCH 10/11] cleanup int suffixes in libcoretest

---
 src/libcoretest/fmt/builders.rs   | 20 ++++++++++----------
 src/libcoretest/iter.rs           |  8 ++++----
 src/libcoretest/num/int_macros.rs |  8 ++++----
 src/libcoretest/num/mod.rs        |  4 ++--
 src/libcoretest/option.rs         |  6 +++---
 5 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/src/libcoretest/fmt/builders.rs b/src/libcoretest/fmt/builders.rs
index 885ee3f9c3be2..e71e61bda5efd 100644
--- a/src/libcoretest/fmt/builders.rs
+++ b/src/libcoretest/fmt/builders.rs
@@ -53,7 +53,7 @@ mod debug_struct {
             fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
                 fmt.debug_struct("Foo")
                     .field("bar", &true)
-                    .field("baz", &format_args!("{}/{}", 10i32, 20i32))
+                    .field("baz", &format_args!("{}/{}", 10, 20))
                     .finish()
             }
         }
@@ -75,7 +75,7 @@ mod debug_struct {
             fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
                 fmt.debug_struct("Foo")
                     .field("bar", &true)
-                    .field("baz", &format_args!("{}/{}", 10i32, 20i32))
+                    .field("baz", &format_args!("{}/{}", 10, 20))
                     .finish()
             }
         }
@@ -150,7 +150,7 @@ mod debug_tuple {
             fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
                 fmt.debug_tuple("Foo")
                     .field(&true)
-                    .field(&format_args!("{}/{}", 10i32, 20i32))
+                    .field(&format_args!("{}/{}", 10, 20))
                     .finish()
             }
         }
@@ -172,7 +172,7 @@ mod debug_tuple {
             fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
                 fmt.debug_tuple("Foo")
                     .field(&true)
-                    .field(&format_args!("{}/{}", 10i32, 20i32))
+                    .field(&format_args!("{}/{}", 10, 20))
                     .finish()
             }
         }
@@ -247,7 +247,7 @@ mod debug_map {
             fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
                 fmt.debug_map()
                     .entry(&"bar", &true)
-                    .entry(&10i32, &format_args!("{}/{}", 10i32, 20i32))
+                    .entry(&10, &format_args!("{}/{}", 10, 20))
                     .finish()
             }
         }
@@ -269,7 +269,7 @@ mod debug_map {
             fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
                 fmt.debug_map()
                     .entry(&"bar", &true)
-                    .entry(&10i32, &format_args!("{}/{}", 10i32, 20i32))
+                    .entry(&10, &format_args!("{}/{}", 10, 20))
                     .finish()
             }
         }
@@ -348,7 +348,7 @@ mod debug_set {
             fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
                 fmt.debug_set()
                     .entry(&true)
-                    .entry(&format_args!("{}/{}", 10i32, 20i32))
+                    .entry(&format_args!("{}/{}", 10, 20))
                     .finish()
             }
         }
@@ -370,7 +370,7 @@ mod debug_set {
             fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
                 fmt.debug_set()
                     .entry(&true)
-                    .entry(&format_args!("{}/{}", 10i32, 20i32))
+                    .entry(&format_args!("{}/{}", 10, 20))
                     .finish()
             }
         }
@@ -445,7 +445,7 @@ mod debug_list {
             fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
                 fmt.debug_list()
                     .entry(&true)
-                    .entry(&format_args!("{}/{}", 10i32, 20i32))
+                    .entry(&format_args!("{}/{}", 10, 20))
                     .finish()
             }
         }
@@ -467,7 +467,7 @@ mod debug_list {
             fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
                 fmt.debug_list()
                     .entry(&true)
-                    .entry(&format_args!("{}/{}", 10i32, 20i32))
+                    .entry(&format_args!("{}/{}", 10, 20))
                     .finish()
             }
         }
diff --git a/src/libcoretest/iter.rs b/src/libcoretest/iter.rs
index acdced6492816..6c0cb03b5f775 100644
--- a/src/libcoretest/iter.rs
+++ b/src/libcoretest/iter.rs
@@ -677,7 +677,7 @@ fn test_rev() {
 
 #[test]
 fn test_cloned() {
-    let xs = [2u8, 4, 6, 8];
+    let xs = [2, 4, 6, 8];
 
     let mut it = xs.iter().cloned();
     assert_eq!(it.len(), 4);
@@ -861,8 +861,8 @@ fn test_range() {
     assert_eq!((-10..-1).size_hint(), (9, Some(9)));
     assert_eq!((-1..-10).size_hint(), (0, Some(0)));
 
-    assert_eq!((-70..58i8).size_hint(), (128, Some(128)));
-    assert_eq!((-128..127i8).size_hint(), (255, Some(255)));
+    assert_eq!((-70..58).size_hint(), (128, Some(128)));
+    assert_eq!((-128..127).size_hint(), (255, Some(255)));
     assert_eq!((-2..isize::MAX).size_hint(),
                (isize::MAX as usize + 2, Some(isize::MAX as usize + 2)));
 }
@@ -1013,7 +1013,7 @@ fn bench_max_by_key2(b: &mut Bencher) {
         array.iter().enumerate().max_by_key(|&(_, item)| item).unwrap().0
     }
 
-    let mut data = vec![0i32; 1638];
+    let mut data = vec![0; 1638];
     data[514] = 9999;
 
     b.iter(|| max_index_iter(&data));
diff --git a/src/libcoretest/num/int_macros.rs b/src/libcoretest/num/int_macros.rs
index afcf836ad10f5..8d791283ab87e 100644
--- a/src/libcoretest/num/int_macros.rs
+++ b/src/libcoretest/num/int_macros.rs
@@ -208,11 +208,11 @@ mod tests {
     fn test_pow() {
         let mut r = 2 as $T;
 
-        assert_eq!(r.pow(2u32), 4 as $T);
-        assert_eq!(r.pow(0u32), 1 as $T);
+        assert_eq!(r.pow(2), 4 as $T);
+        assert_eq!(r.pow(0), 1 as $T);
         r = -2 as $T;
-        assert_eq!(r.pow(2u32), 4 as $T);
-        assert_eq!(r.pow(3u32), -8 as $T);
+        assert_eq!(r.pow(2), 4 as $T);
+        assert_eq!(r.pow(3), -8 as $T);
     }
 }
 
diff --git a/src/libcoretest/num/mod.rs b/src/libcoretest/num/mod.rs
index fba56db32bb4c..11c1bd667fb36 100644
--- a/src/libcoretest/num/mod.rs
+++ b/src/libcoretest/num/mod.rs
@@ -99,8 +99,8 @@ mod tests {
 
     #[test]
     fn test_leading_plus() {
-        assert_eq!("+127".parse::<u8>().ok(), Some(127u8));
-        assert_eq!("+9223372036854775807".parse::<i64>().ok(), Some(9223372036854775807i64));
+        assert_eq!("+127".parse::<u8>().ok(), Some(127));
+        assert_eq!("+9223372036854775807".parse::<i64>().ok(), Some(9223372036854775807));
     }
 
     #[test]
diff --git a/src/libcoretest/option.rs b/src/libcoretest/option.rs
index 3e564cf197061..51b0655f680f6 100644
--- a/src/libcoretest/option.rs
+++ b/src/libcoretest/option.rs
@@ -251,7 +251,7 @@ fn test_collect() {
 
 #[test]
 fn test_cloned() {
-    let val = 1u32;
+    let val = 1;
     let val_ref = &val;
     let opt_none: Option<&'static u32> = None;
     let opt_ref = Some(&val);
@@ -263,10 +263,10 @@ fn test_cloned() {
 
     // Immutable ref works
     assert_eq!(opt_ref.clone(), Some(&val));
-    assert_eq!(opt_ref.cloned(), Some(1u32));
+    assert_eq!(opt_ref.cloned(), Some(1));
 
     // Double Immutable ref works
     assert_eq!(opt_ref_ref.clone(), Some(&val_ref));
     assert_eq!(opt_ref_ref.clone().cloned(), Some(&val));
-    assert_eq!(opt_ref_ref.cloned().cloned(), Some(1u32));
+    assert_eq!(opt_ref_ref.cloned().cloned(), Some(1));
 }

From 47a1b0d264f467b5fa47446f5cabe56ebe6de0fe Mon Sep 17 00:00:00 2001
From: srinivasreddy <thatiparthysreenivas@gmail.com>
Date: Fri, 11 Mar 2016 08:55:54 +0530
Subject: [PATCH 11/11] removed int suffixes

---
 src/libterm/win.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libterm/win.rs b/src/libterm/win.rs
index d36b182710b97..79e07c4dc60b0 100644
--- a/src/libterm/win.rs
+++ b/src/libterm/win.rs
@@ -108,7 +108,7 @@ impl<T: Write + Send + 'static> WinConsole<T> {
             // terminal! Admittedly, this is fragile, since stderr could be
             // redirected to a different console. This is good enough for
             // rustc though. See #13400.
-            let out = GetStdHandle(-11i32 as DWORD);
+            let out = GetStdHandle(-11 as DWORD);
             SetConsoleTextAttribute(out, accum);
         }
     }
@@ -120,7 +120,7 @@ impl<T: Write + Send + 'static> WinConsole<T> {
         let bg;
         unsafe {
             let mut buffer_info = ::std::mem::uninitialized();
-            if GetConsoleScreenBufferInfo(GetStdHandle(-11i32 as DWORD), &mut buffer_info) != 0 {
+            if GetConsoleScreenBufferInfo(GetStdHandle(-11 as DWORD), &mut buffer_info) != 0 {
                 fg = bits_to_color(buffer_info.wAttributes);
                 bg = bits_to_color(buffer_info.wAttributes >> 4);
             } else {