]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #31932 - Manishearth:rollup, r=Manishearth
authorbors <bors@rust-lang.org>
Sat, 27 Feb 2016 08:59:57 +0000 (08:59 +0000)
committerbors <bors@rust-lang.org>
Sat, 27 Feb 2016 08:59:57 +0000 (08:59 +0000)
- Successful merges: #31909, #31918, #31922, #31926, #31928, #31929, #31930
- Failed merges:

RELEASES.md
src/doc/reference.md
src/libcollections/str.rs
src/librustc/middle/subst.rs
src/libstd/primitive_docs.rs

index a247eb2e9555c999f08c6edc2e7eb4b50671d498..d279378a2dd45292e88a61d4d56b07f806260197 100644 (file)
@@ -75,8 +75,8 @@ Libraries
   improved by using `memchr` to search for newlines][1.7m].
 * [`f32::to_degrees` and `f32::to_radians` are stable][1.7f]. The
   `f64` variants were stabilized previously.
-* [`BTreeMap` was rewritten to use less memory improve performance of
-  insertion and iteration, the latter by as much as 5x`][1.7bm].
+* [`BTreeMap` was rewritten to use less memory and improve the performance
+  of insertion and iteration, the latter by as much as 5x`][1.7bm].
 * [`BTreeSet` and its iterators, `Iter`, `IntoIter`, and `Range` are
   covariant over their contained type][1.7bt].
 * [`LinkedList` and its iterators, `Iter` and `IntoIter` are covariant
index 6262618a030a3f7be0bda63d078e717c39281720..913cfcff104af0f87439962c0d5220ccaffe9449 100644 (file)
@@ -3040,7 +3040,7 @@ the case of a `while` loop, the head is the conditional expression controlling
 the loop. In the case of a `for` loop, the head is the call-expression
 controlling the loop. If the label is present, then `continue 'foo` returns
 control to the head of the loop with label `'foo`, which need not be the
-innermost label enclosing the `break` expression, but must enclose it.
+innermost label enclosing the `continue` expression, but must enclose it.
 
 A `continue` expression is only permitted in the body of a loop.
 
index 89b5e5b30755c11c11a531a626231398478b8a53..5f3df398f16ba4802a32a32ae6b53ec9469fc7ac 100644 (file)
@@ -267,9 +267,11 @@ pub fn as_bytes(&self) -> &[u8] {
     /// Converts a string slice to a raw pointer.
     ///
     /// As string slices are a slice of bytes, the raw pointer points to a
-    /// `u8`. This pointer will be pointing to the first byte of the string
+    /// [`u8`]. This pointer will be pointing to the first byte of the string
     /// slice.
     ///
+    /// [`u8`]: primitive.u8.html
+    ///
     /// # Examples
     ///
     /// Basic usage:
@@ -661,7 +663,7 @@ pub fn split_at_mut(&mut self, mid: usize) -> (&mut str, &mut str) {
     /// assert_eq!(None, chars.next());
     /// ```
     ///
-    /// Remember, `char`s may not match your human intuition about characters:
+    /// Remember, [`char`]s may not match your human intuition about characters:
     ///
     /// ```
     /// let y = "y̆";
@@ -678,16 +680,18 @@ pub fn split_at_mut(&mut self, mid: usize) -> (&mut str, &mut str) {
     pub fn chars(&self) -> Chars {
         core_str::StrExt::chars(self)
     }
-    /// Returns an iterator over the `char`s of a string slice, and their
+    /// Returns an iterator over the [`char`]s of a string slice, and their
     /// positions.
     ///
     /// As a string slice consists of valid UTF-8, we can iterate through a
-    /// string slice by `char`. This method returns an iterator of both
-    /// these `char`s, as well as their byte positions.
+    /// string slice by [`char`]. This method returns an iterator of both
+    /// these [`char`]s, as well as their byte positions.
     ///
-    /// The iterator yields tuples. The position is first, the `char` is
+    /// The iterator yields tuples. The position is first, the [`char`] is
     /// second.
     ///
+    /// [`char`]: primitive.char.html
+    ///
     /// # Examples
     ///
     /// Basic usage:
@@ -711,7 +715,7 @@ pub fn chars(&self) -> Chars {
     /// assert_eq!(None, char_indices.next());
     /// ```
     ///
-    /// Remember, `char`s may not match your human intuition about characters:
+    /// Remember, [`char`]s may not match your human intuition about characters:
     ///
     /// ```
     /// let y = "y̆";
@@ -918,12 +922,13 @@ pub fn ends_with<'a, P: Pattern<'a>>(&'a self, pat: P) -> bool
     /// Returns the byte index of the first character of this string slice that
     /// matches the pattern.
     ///
-    /// Returns `None` if the pattern doesn't match.
+    /// Returns [`None`] if the pattern doesn't match.
     ///
     /// The pattern can be a `&str`, [`char`], or a closure that determines if
     /// a character matches.
     ///
     /// [`char`]: primitive.char.html
+    /// [`None`]: option/enum.Option.html#variant.None
     ///
     /// # Examples
     ///
@@ -962,12 +967,13 @@ pub fn find<'a, P: Pattern<'a>>(&'a self, pat: P) -> Option<usize> {
     /// Returns the byte index of the last character of this string slice that
     /// matches the pattern.
     ///
-    /// Returns `None` if the pattern doesn't match.
+    /// Returns [`None`] if the pattern doesn't match.
     ///
     /// The pattern can be a `&str`, [`char`], or a closure that determines if
     /// a character matches.
     ///
     /// [`char`]: primitive.char.html
+    /// [`None`]: option/enum.Option.html#variant.None
     ///
     /// # Examples
     ///
@@ -1187,14 +1193,18 @@ pub fn split_terminator<'a, P: Pattern<'a>>(&'a self, pat: P) -> SplitTerminator
     /// An iterator over substrings of `self`, separated by characters
     /// matched by a pattern and yielded in reverse order.
     ///
-    /// The pattern can be a simple `&str`, `char`, or a closure that
+    /// The pattern can be a simple `&str`, [`char`], or a closure that
     /// determines the split.
     /// Additional libraries might provide more complex patterns like
     /// regular expressions.
     ///
-    /// Equivalent to `split`, except that the trailing substring is
+    /// [`char`]: primitive.char.html
+    ///
+    /// Equivalent to [`split()`], except that the trailing substring is
     /// skipped if empty.
     ///
+    /// [`split()`]: #method.split
+    ///
     /// This method can be used for string data that is _terminated_,
     /// rather than _separated_ by a pattern.
     ///
@@ -1457,7 +1467,7 @@ pub fn match_indices<'a, P: Pattern<'a>>(&'a self, pat: P) -> MatchIndices<'a, P
     /// # Iterator behavior
     ///
     /// The returned iterator requires that the pattern supports a reverse
-    /// search, and it will be a `[DoubleEndedIterator]` if a forward/reverse
+    /// search, and it will be a [`DoubleEndedIterator`] if a forward/reverse
     /// search yields the same elements.
     ///
     /// [`DoubleEndedIterator`]: iter/trait.DoubleEndedIterator.html
@@ -1694,9 +1704,11 @@ pub fn trim_right_matches<'a, P: Pattern<'a>>(&'a self, pat: P) -> &'a str
     ///
     /// # Errors
     ///
-    /// Will return `Err` if it's not possible to parse this string slice into
+    /// Will return [`Err`] if it's not possible to parse this string slice into
     /// the desired type.
     ///
+    /// [`Err`]: str/trait.FromStr.html#associatedtype.Err
+    ///
     /// # Example
     ///
     /// Basic usage
@@ -1707,7 +1719,7 @@ pub fn trim_right_matches<'a, P: Pattern<'a>>(&'a self, pat: P) -> &'a str
     /// assert_eq!(4, four);
     /// ```
     ///
-    /// Using the 'turbofish' instead of annotationg `four`:
+    /// Using the 'turbofish' instead of annotating `four`:
     ///
     /// ```
     /// let four = "4".parse::<u32>();
@@ -1765,11 +1777,13 @@ pub fn replace<'a, P: Pattern<'a>>(&'a self, from: P, to: &str) -> String {
         result
     }
 
-    /// Returns the lowercase equivalent of this string slice, as a new `String`.
+    /// Returns the lowercase equivalent of this string slice, as a new [`String`].
     ///
     /// 'Lowercase' is defined according to the terms of the Unicode Derived Core Property
     /// `Lowercase`.
     ///
+    /// [`String`]: string/struct.String.html
+    ///
     /// # Examples
     ///
     /// Basic usage:
@@ -1839,11 +1853,13 @@ fn case_ignoreable_then_cased<I: Iterator<Item = char>>(iter: I) -> bool {
         }
     }
 
-    /// Returns the uppercase equivalent of this string slice, as a new `String`.
+    /// Returns the uppercase equivalent of this string slice, as a new [`String`].
     ///
     /// 'Uppercase' is defined according to the terms of the Unicode Derived Core Property
     /// `Uppercase`.
     ///
+    /// [`String`]: string/struct.String.html
+    ///
     /// # Examples
     ///
     /// Basic usage:
@@ -1884,7 +1900,9 @@ pub fn escape_unicode(&self) -> String {
         self.chars().flat_map(|c| c.escape_unicode()).collect()
     }
 
-    /// Converts a `Box<str>` into a `String` without copying or allocating.
+    /// Converts a `Box<str>` into a [`String`] without copying or allocating.
+    ///
+    /// [`String`]: string/struct.String.html
     ///
     /// # Examples
     ///
index ddc817ffc023e0ee5c40c8436367334f6ff9cba9..f8c6d3d934123bb0b38f2ac9e18a1fc6fc56be14 100644 (file)
@@ -555,6 +555,11 @@ fn next(&mut self) -> Option<(ParamSpace, usize, &'a T)> {
             None
         }
     }
+
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        let size = self.vec.as_slice().len();
+        (size, Some(size))
+    }
 }
 
 impl<T> IntoIterator for VecPerParamSpace<T> {
index e5819522123c409b7de1b227911afede51bf0c74..839287d13217bed2e7a98da483dc56ceba551d59 100644 (file)
@@ -488,6 +488,9 @@ mod prim_tuple { }
 ///
 /// *[See also the `std::f32` module](f32/index.html).*
 ///
+/// However, please note that examples are shared between the `f64` and `f32`
+/// primitive types. So it's normal if you see usage of `f64` in there.
+///
 mod prim_f32 { }
 
 #[doc(primitive = "f64")]
@@ -496,6 +499,9 @@ mod prim_f32 { }
 ///
 /// *[See also the `std::f64` module](f64/index.html).*
 ///
+/// However, please note that examples are shared between the `f64` and `f32`
+/// primitive types. So it's normal if you see usage of `f32` in there.
+///
 mod prim_f64 { }
 
 #[doc(primitive = "i8")]