Skip to content

Rollup of 5 pull requests #26272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jun 13, 2015
2 changes: 1 addition & 1 deletion src/doc/trpl/associated-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ trait Graph {
Now, our clients can be abstract over a given `Graph`:

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

No need to deal with the `E`dge type here!
Expand Down
11 changes: 5 additions & 6 deletions src/doc/trpl/iterators.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,7 @@ has no side effect on the original iterator. Let's try it out with our infinite
iterator from before:

```rust
# #![feature(step_by)]
for i in (1..).step_by(5).take(5) {
for i in (1..).take(5) {
println!("{}", i);
}
```
Expand All @@ -295,10 +294,10 @@ This will print

```text
1
6
11
16
21
2
3
4
5
```

`filter()` is an adapter that takes a closure as an argument. This closure
Expand Down
2 changes: 1 addition & 1 deletion src/doc/trpl/lifetimes.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ fn substr<'a>(s: &'a str, until: u32) -> &'a str; // expanded
fn get_str() -> &str; // ILLEGAL, no inputs

fn frob(s: &str, t: &str) -> &str; // ILLEGAL, two inputs
fn frob<'a, 'b>(s: &'a str, t: &'b str) -> &str; // Expanded: Output lifetime is unclear
fn frob<'a, 'b>(s: &'a str, t: &'b str) -> &str; // Expanded: Output lifetime is ambiguous

fn get_mut(&mut self) -> &mut T; // elided
fn get_mut<'a>(&'a mut self) -> &'a mut T; // expanded
Expand Down
26 changes: 16 additions & 10 deletions src/librustc_unicode/char.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,22 +187,16 @@ impl char {
/// # Examples
///
/// ```
/// for i in '❤'.escape_unicode() {
/// println!("{}", i);
/// for c in '❤'.escape_unicode() {
/// print!("{}", c);
/// }
/// println!("");
/// ```
///
/// This prints:
///
/// ```text
/// \
/// u
/// {
/// 2
/// 7
/// 6
/// 4
/// }
/// \u{2764}
/// ```
///
/// Collecting into a `String`:
Expand Down Expand Up @@ -467,6 +461,12 @@ impl char {
/// Returns an iterator which yields the characters corresponding to the
/// lowercase equivalent of the character. If no conversion is possible then
/// an iterator with just the input character is returned.
///
/// # Examples
///
/// ```
/// assert_eq!(Some('c'), 'C'.to_lowercase().next());
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
pub fn to_lowercase(self) -> ToLowercase {
Expand Down Expand Up @@ -515,6 +515,12 @@ impl char {
/// [`SpecialCasing.txt`]: ftp://ftp.unicode.org/Public/UNIDATA/SpecialCasing.txt
///
/// [2]: http://www.unicode.org/versions/Unicode7.0.0/ch03.pdf#G33992
///
/// # Examples
///
/// ```
/// assert_eq!(Some('C'), 'c'.to_uppercase().next());
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
pub fn to_uppercase(self) -> ToUppercase {
Expand Down