Skip to content

Commit acdd3b9

Browse files
committed
Auto merge of #31932 - Manishearth:rollup, r=Manishearth
- Successful merges: #31909, #31918, #31922, #31926, #31928, #31929, #31930 - Failed merges:
2 parents 80dee36 + 7f59c21 commit acdd3b9

File tree

5 files changed

+49
-20
lines changed

5 files changed

+49
-20
lines changed

RELEASES.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ Libraries
7575
improved by using `memchr` to search for newlines][1.7m].
7676
* [`f32::to_degrees` and `f32::to_radians` are stable][1.7f]. The
7777
`f64` variants were stabilized previously.
78-
* [`BTreeMap` was rewritten to use less memory improve performance of
79-
insertion and iteration, the latter by as much as 5x`][1.7bm].
78+
* [`BTreeMap` was rewritten to use less memory and improve the performance
79+
of insertion and iteration, the latter by as much as 5x`][1.7bm].
8080
* [`BTreeSet` and its iterators, `Iter`, `IntoIter`, and `Range` are
8181
covariant over their contained type][1.7bt].
8282
* [`LinkedList` and its iterators, `Iter` and `IntoIter` are covariant

src/doc/reference.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3040,7 +3040,7 @@ the case of a `while` loop, the head is the conditional expression controlling
30403040
the loop. In the case of a `for` loop, the head is the call-expression
30413041
controlling the loop. If the label is present, then `continue 'foo` returns
30423042
control to the head of the loop with label `'foo`, which need not be the
3043-
innermost label enclosing the `break` expression, but must enclose it.
3043+
innermost label enclosing the `continue` expression, but must enclose it.
30443044

30453045
A `continue` expression is only permitted in the body of a loop.
30463046

src/libcollections/str.rs

+35-17
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,11 @@ impl str {
267267
/// Converts a string slice to a raw pointer.
268268
///
269269
/// As string slices are a slice of bytes, the raw pointer points to a
270-
/// `u8`. This pointer will be pointing to the first byte of the string
270+
/// [`u8`]. This pointer will be pointing to the first byte of the string
271271
/// slice.
272272
///
273+
/// [`u8`]: primitive.u8.html
274+
///
273275
/// # Examples
274276
///
275277
/// Basic usage:
@@ -661,7 +663,7 @@ impl str {
661663
/// assert_eq!(None, chars.next());
662664
/// ```
663665
///
664-
/// Remember, `char`s may not match your human intuition about characters:
666+
/// Remember, [`char`]s may not match your human intuition about characters:
665667
///
666668
/// ```
667669
/// let y = "y̆";
@@ -678,16 +680,18 @@ impl str {
678680
pub fn chars(&self) -> Chars {
679681
core_str::StrExt::chars(self)
680682
}
681-
/// Returns an iterator over the `char`s of a string slice, and their
683+
/// Returns an iterator over the [`char`]s of a string slice, and their
682684
/// positions.
683685
///
684686
/// As a string slice consists of valid UTF-8, we can iterate through a
685-
/// string slice by `char`. This method returns an iterator of both
686-
/// these `char`s, as well as their byte positions.
687+
/// string slice by [`char`]. This method returns an iterator of both
688+
/// these [`char`]s, as well as their byte positions.
687689
///
688-
/// The iterator yields tuples. The position is first, the `char` is
690+
/// The iterator yields tuples. The position is first, the [`char`] is
689691
/// second.
690692
///
693+
/// [`char`]: primitive.char.html
694+
///
691695
/// # Examples
692696
///
693697
/// Basic usage:
@@ -711,7 +715,7 @@ impl str {
711715
/// assert_eq!(None, char_indices.next());
712716
/// ```
713717
///
714-
/// Remember, `char`s may not match your human intuition about characters:
718+
/// Remember, [`char`]s may not match your human intuition about characters:
715719
///
716720
/// ```
717721
/// let y = "y̆";
@@ -918,12 +922,13 @@ impl str {
918922
/// Returns the byte index of the first character of this string slice that
919923
/// matches the pattern.
920924
///
921-
/// Returns `None` if the pattern doesn't match.
925+
/// Returns [`None`] if the pattern doesn't match.
922926
///
923927
/// The pattern can be a `&str`, [`char`], or a closure that determines if
924928
/// a character matches.
925929
///
926930
/// [`char`]: primitive.char.html
931+
/// [`None`]: option/enum.Option.html#variant.None
927932
///
928933
/// # Examples
929934
///
@@ -962,12 +967,13 @@ impl str {
962967
/// Returns the byte index of the last character of this string slice that
963968
/// matches the pattern.
964969
///
965-
/// Returns `None` if the pattern doesn't match.
970+
/// Returns [`None`] if the pattern doesn't match.
966971
///
967972
/// The pattern can be a `&str`, [`char`], or a closure that determines if
968973
/// a character matches.
969974
///
970975
/// [`char`]: primitive.char.html
976+
/// [`None`]: option/enum.Option.html#variant.None
971977
///
972978
/// # Examples
973979
///
@@ -1187,14 +1193,18 @@ impl str {
11871193
/// An iterator over substrings of `self`, separated by characters
11881194
/// matched by a pattern and yielded in reverse order.
11891195
///
1190-
/// The pattern can be a simple `&str`, `char`, or a closure that
1196+
/// The pattern can be a simple `&str`, [`char`], or a closure that
11911197
/// determines the split.
11921198
/// Additional libraries might provide more complex patterns like
11931199
/// regular expressions.
11941200
///
1195-
/// Equivalent to `split`, except that the trailing substring is
1201+
/// [`char`]: primitive.char.html
1202+
///
1203+
/// Equivalent to [`split()`], except that the trailing substring is
11961204
/// skipped if empty.
11971205
///
1206+
/// [`split()`]: #method.split
1207+
///
11981208
/// This method can be used for string data that is _terminated_,
11991209
/// rather than _separated_ by a pattern.
12001210
///
@@ -1457,7 +1467,7 @@ impl str {
14571467
/// # Iterator behavior
14581468
///
14591469
/// The returned iterator requires that the pattern supports a reverse
1460-
/// search, and it will be a `[DoubleEndedIterator]` if a forward/reverse
1470+
/// search, and it will be a [`DoubleEndedIterator`] if a forward/reverse
14611471
/// search yields the same elements.
14621472
///
14631473
/// [`DoubleEndedIterator`]: iter/trait.DoubleEndedIterator.html
@@ -1694,9 +1704,11 @@ impl str {
16941704
///
16951705
/// # Errors
16961706
///
1697-
/// Will return `Err` if it's not possible to parse this string slice into
1707+
/// Will return [`Err`] if it's not possible to parse this string slice into
16981708
/// the desired type.
16991709
///
1710+
/// [`Err`]: str/trait.FromStr.html#associatedtype.Err
1711+
///
17001712
/// # Example
17011713
///
17021714
/// Basic usage
@@ -1707,7 +1719,7 @@ impl str {
17071719
/// assert_eq!(4, four);
17081720
/// ```
17091721
///
1710-
/// Using the 'turbofish' instead of annotationg `four`:
1722+
/// Using the 'turbofish' instead of annotating `four`:
17111723
///
17121724
/// ```
17131725
/// let four = "4".parse::<u32>();
@@ -1765,11 +1777,13 @@ impl str {
17651777
result
17661778
}
17671779

1768-
/// Returns the lowercase equivalent of this string slice, as a new `String`.
1780+
/// Returns the lowercase equivalent of this string slice, as a new [`String`].
17691781
///
17701782
/// 'Lowercase' is defined according to the terms of the Unicode Derived Core Property
17711783
/// `Lowercase`.
17721784
///
1785+
/// [`String`]: string/struct.String.html
1786+
///
17731787
/// # Examples
17741788
///
17751789
/// Basic usage:
@@ -1839,11 +1853,13 @@ impl str {
18391853
}
18401854
}
18411855

1842-
/// Returns the uppercase equivalent of this string slice, as a new `String`.
1856+
/// Returns the uppercase equivalent of this string slice, as a new [`String`].
18431857
///
18441858
/// 'Uppercase' is defined according to the terms of the Unicode Derived Core Property
18451859
/// `Uppercase`.
18461860
///
1861+
/// [`String`]: string/struct.String.html
1862+
///
18471863
/// # Examples
18481864
///
18491865
/// Basic usage:
@@ -1884,7 +1900,9 @@ impl str {
18841900
self.chars().flat_map(|c| c.escape_unicode()).collect()
18851901
}
18861902

1887-
/// Converts a `Box<str>` into a `String` without copying or allocating.
1903+
/// Converts a `Box<str>` into a [`String`] without copying or allocating.
1904+
///
1905+
/// [`String`]: string/struct.String.html
18881906
///
18891907
/// # Examples
18901908
///

src/librustc/middle/subst.rs

+5
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,11 @@ impl<'a,T> Iterator for EnumeratedItems<'a,T> {
555555
None
556556
}
557557
}
558+
559+
fn size_hint(&self) -> (usize, Option<usize>) {
560+
let size = self.vec.as_slice().len();
561+
(size, Some(size))
562+
}
558563
}
559564

560565
impl<T> IntoIterator for VecPerParamSpace<T> {

src/libstd/primitive_docs.rs

+6
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,9 @@ mod prim_tuple { }
488488
///
489489
/// *[See also the `std::f32` module](f32/index.html).*
490490
///
491+
/// However, please note that examples are shared between the `f64` and `f32`
492+
/// primitive types. So it's normal if you see usage of `f64` in there.
493+
///
491494
mod prim_f32 { }
492495

493496
#[doc(primitive = "f64")]
@@ -496,6 +499,9 @@ mod prim_f32 { }
496499
///
497500
/// *[See also the `std::f64` module](f64/index.html).*
498501
///
502+
/// However, please note that examples are shared between the `f64` and `f32`
503+
/// primitive types. So it's normal if you see usage of `f32` in there.
504+
///
499505
mod prim_f64 { }
500506

501507
#[doc(primitive = "i8")]

0 commit comments

Comments
 (0)