Skip to content

Commit b850046

Browse files
committed
Auto merge of #26272 - Manishearth:rollup, r=Manishearth
- Successful merges: #26255, #26256, #26257, #26259, #26260 - Failed merges:
2 parents a279826 + 023f661 commit b850046

File tree

4 files changed

+23
-18
lines changed

4 files changed

+23
-18
lines changed

src/doc/trpl/associated-types.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ trait Graph {
4343
Now, our clients can be abstract over a given `Graph`:
4444

4545
```rust,ignore
46-
fn distance<G: Graph>(graph: &G, start: &G::N, end: &G::N) -> usize { ... }
46+
fn distance<G: Graph>(graph: &G, start: &G::N, end: &G::N) -> u32 { ... }
4747
```
4848

4949
No need to deal with the `E`dge type here!

src/doc/trpl/iterators.md

+5-6
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,7 @@ has no side effect on the original iterator. Let's try it out with our infinite
285285
iterator from before:
286286

287287
```rust
288-
# #![feature(step_by)]
289-
for i in (1..).step_by(5).take(5) {
288+
for i in (1..).take(5) {
290289
println!("{}", i);
291290
}
292291
```
@@ -295,10 +294,10 @@ This will print
295294

296295
```text
297296
1
298-
6
299-
11
300-
16
301-
21
297+
2
298+
3
299+
4
300+
5
302301
```
303302

304303
`filter()` is an adapter that takes a closure as an argument. This closure

src/doc/trpl/lifetimes.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ fn substr<'a>(s: &'a str, until: u32) -> &'a str; // expanded
305305
fn get_str() -> &str; // ILLEGAL, no inputs
306306
307307
fn frob(s: &str, t: &str) -> &str; // ILLEGAL, two inputs
308-
fn frob<'a, 'b>(s: &'a str, t: &'b str) -> &str; // Expanded: Output lifetime is unclear
308+
fn frob<'a, 'b>(s: &'a str, t: &'b str) -> &str; // Expanded: Output lifetime is ambiguous
309309
310310
fn get_mut(&mut self) -> &mut T; // elided
311311
fn get_mut<'a>(&'a mut self) -> &'a mut T; // expanded

src/librustc_unicode/char.rs

+16-10
Original file line numberDiff line numberDiff line change
@@ -187,22 +187,16 @@ impl char {
187187
/// # Examples
188188
///
189189
/// ```
190-
/// for i in '❤'.escape_unicode() {
191-
/// println!("{}", i);
190+
/// for c in '❤'.escape_unicode() {
191+
/// print!("{}", c);
192192
/// }
193+
/// println!("");
193194
/// ```
194195
///
195196
/// This prints:
196197
///
197198
/// ```text
198-
/// \
199-
/// u
200-
/// {
201-
/// 2
202-
/// 7
203-
/// 6
204-
/// 4
205-
/// }
199+
/// \u{2764}
206200
/// ```
207201
///
208202
/// Collecting into a `String`:
@@ -467,6 +461,12 @@ impl char {
467461
/// Returns an iterator which yields the characters corresponding to the
468462
/// lowercase equivalent of the character. If no conversion is possible then
469463
/// an iterator with just the input character is returned.
464+
///
465+
/// # Examples
466+
///
467+
/// ```
468+
/// assert_eq!(Some('c'), 'C'.to_lowercase().next());
469+
/// ```
470470
#[stable(feature = "rust1", since = "1.0.0")]
471471
#[inline]
472472
pub fn to_lowercase(self) -> ToLowercase {
@@ -515,6 +515,12 @@ impl char {
515515
/// [`SpecialCasing.txt`]: ftp://ftp.unicode.org/Public/UNIDATA/SpecialCasing.txt
516516
///
517517
/// [2]: http://www.unicode.org/versions/Unicode7.0.0/ch03.pdf#G33992
518+
///
519+
/// # Examples
520+
///
521+
/// ```
522+
/// assert_eq!(Some('C'), 'c'.to_uppercase().next());
523+
/// ```
518524
#[stable(feature = "rust1", since = "1.0.0")]
519525
#[inline]
520526
pub fn to_uppercase(self) -> ToUppercase {

0 commit comments

Comments
 (0)