Skip to content
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

Rollup of 5 pull requests #40286

Closed
wants to merge 12 commits into from
Closed

Rollup of 5 pull requests #40286

wants to merge 12 commits into from

Commits on Feb 28, 2017

  1. Configuration menu
    Copy the full SHA
    3aa6f18 View commit details
    Browse the repository at this point in the history

Commits on Mar 2, 2017

  1. fix link

    steveklabnik committed Mar 2, 2017
    Configuration menu
    Copy the full SHA
    ae2c9d2 View commit details
    Browse the repository at this point in the history

Commits on Mar 4, 2017

  1. Clean up "pattern doesn't bind x" messages

    Group "missing variable bind" spans in `or` matches and clarify wording
    for the two possible cases: when a variable from the first pattern is
    not in any of the subsequent patterns, and when a variable in any of the
    other patterns is not in the first one.
    
    Before:
    
    ```
    error[E0408]: variable `a` from pattern #1 is not bound in pattern rust-lang#2
      --> file.rs:10:23
       |
    10 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
       |                       ^^^^^^^^^^^ pattern doesn't bind `a`
    
    error[E0408]: variable `b` from pattern rust-lang#2 is not bound in pattern #1
      --> file.rs:10:32
       |
    10 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
       |                                ^ pattern doesn't bind `b`
    
    error[E0408]: variable `a` from pattern #1 is not bound in pattern rust-lang#3
      --> file.rs:10:37
       |
    10 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
       |                                     ^^^^^^^^ pattern doesn't bind `a`
    
    error[E0408]: variable `d` from pattern #1 is not bound in pattern rust-lang#3
      --> file.rs:10:37
       |
    10 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
       |                                     ^^^^^^^^ pattern doesn't bind `d`
    
    error[E0408]: variable `c` from pattern rust-lang#3 is not bound in pattern #1
      --> file.rs:10:43
       |
    10 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
       |                                           ^ pattern doesn't bind `c`
    
    error[E0408]: variable `d` from pattern #1 is not bound in pattern rust-lang#4
      --> file.rs:10:48
       |
    10 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
       |                                                ^^^^^^^^ pattern doesn't bind `d`
    
    error: aborting due to 6 previous errors
    ```
    
    After:
    
    ```
    error[E0408]: variable `a` is not bound in all patterns
      --> file.rs:20:37
       |
    20 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => {
    intln!("{:?}", a); }
       |               -       ^^^^^^^^^^^   ^^^^^^^^         - variable
    t in all patterns
       |               |       |             |
       |               |       |             pattern doesn't bind `a`
       |               |       pattern doesn't bind `a`
       |               variable not in all patterns
    
    error[E0408]: variable `d` is not bound in all patterns
      --> file.rs:20:37
       |
    20 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => {
    intln!("{:?}", a); }
       |                  -          -       ^^^^^^^^   ^^^^^^^^ pattern
    esn't bind `d`
       |                  |          |       |
       |                  |          |       pattern doesn't bind `d`
       |                  |          variable not in all patterns
       |                  variable not in all patterns
    
    error[E0408]: variable `b` is not bound in all patterns
      --> file.rs:20:37
       |
    20 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => {
    intln!("{:?}", a); }
       |         ^^^^^^^^^^^            -    ^^^^^^^^   ^^^^^^^^ pattern
    esn't bind `b`
       |         |                      |    |
       |         |                      |    pattern doesn't bind `b`
       |         |                      variable not in all patterns
       |         pattern doesn't bind `b`
    
    error[E0408]: variable `c` is not bound in all patterns
      --> file.rs:20:48
       |
    20 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => {
    intln!("{:?}", a); }
       |         ^^^^^^^^^^^   ^^^^^^^^^^^         -    ^^^^^^^^ pattern
    esn't bind `c`
       |         |             |                   |
       |         |             |                   variable not in all
    tterns
       |         |             pattern doesn't bind `c`
       |         pattern doesn't bind `c`
    
    error: aborting due to 4 previous errors
    ```
    
    * Have only one presentation for binding consistency errors
    * Point to same binding in multiple patterns when possible
    * Check inconsistent bindings in all arms
    * Simplify wording of diagnostic message
    * Sort emition and spans of binding errors for deterministic output
    estebank committed Mar 4, 2017
    Configuration menu
    Copy the full SHA
    b0d0272 View commit details
    Browse the repository at this point in the history

Commits on Mar 5, 2017

  1. Point to enclosing block/fn on nested unsafe

    When declaring nested unsafe blocks (`unsafe {unsafe {}}`) that trigger
    the "unnecessary `unsafe` block" error, point out the enclosing `unsafe
    block` or `unsafe fn` that makes it unnecessary.
    estebank committed Mar 5, 2017
    Configuration menu
    Copy the full SHA
    3a9560a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    780bea5 View commit details
    Browse the repository at this point in the history

Commits on Mar 6, 2017

  1. Fix ICE: don't use struct_variant on enums

    Fix rust-lang#40221 and add unittest.
    estebank committed Mar 6, 2017
    Configuration menu
    Copy the full SHA
    168122f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    86bad49 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#39202 - estebank:nested-unsafe, r=jonathand…

    …turner
    
    Point to enclosing block/fn on nested unsafe
    
    When declaring nested unsafe blocks (`unsafe {unsafe {}}`) that trigger
    the "unnecessary `unsafe` block" error, point out the enclosing `unsafe
    block` or `unsafe fn` that makes it unnecessary.
    
    <img width="621" alt="" src="https://cloud.githubusercontent.com/assets/1606434/22139922/26ad468a-de9e-11e6-8884-2945be882ea8.png">
    
    Fixes rust-lang#39144.
    frewsxcv committed Mar 6, 2017
    Configuration menu
    Copy the full SHA
    e6ec06a View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#39713 - estebank:issue-39698, r=jonathandtu…

    …rner
    
    Clean up "pattern doesn't bind x" messages
    
    Group "missing variable bind" spans in `or` matches and clarify wording
    for the two possible cases: when a variable from the first pattern is
    not in any of the subsequent patterns, and when a variable in any of the
    other patterns is not in the first one.
    
    Before:
    
    ```rust
    error[E0408]: variable `a` from pattern #1 is not bound in pattern rust-lang#2
      --> file.rs:10:23
       |
    10 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
       |                       ^^^^^^^^^^^ pattern doesn't bind `a`
    
    error[E0408]: variable `b` from pattern rust-lang#2 is not bound in pattern #1
      --> file.rs:10:32
       |
    10 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
       |                                ^ pattern doesn't bind `b`
    
    error[E0408]: variable `a` from pattern #1 is not bound in pattern rust-lang#3
      --> file.rs:10:37
       |
    10 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
       |                                     ^^^^^^^^ pattern doesn't bind `a`
    
    error[E0408]: variable `d` from pattern #1 is not bound in pattern rust-lang#3
      --> file.rs:10:37
       |
    10 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
       |                                     ^^^^^^^^ pattern doesn't bind `d`
    
    error[E0408]: variable `c` from pattern rust-lang#3 is not bound in pattern #1
      --> file.rs:10:43
       |
    10 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
       |                                           ^ pattern doesn't bind `c`
    
    error[E0408]: variable `d` from pattern #1 is not bound in pattern rust-lang#4
      --> file.rs:10:48
       |
    10 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
       |                                                ^^^^^^^^ pattern doesn't bind `d`
    
    error: aborting due to 6 previous errors
    ```
    
    After:
    
    ```rust
    error[E0408]: variable `d` is not bound in all patterns
      --> $DIR/issue-39698.rs:20:37
       |
    20 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
       |                  -          -       ^^^^^^^^   ^^^^^^^^ pattern doesn't bind `d`
       |                  |          |       |
       |                  |          |       pattern doesn't bind `d`
       |                  |          variable not in all patterns
       |                  variable not in all patterns
    
    error[E0408]: variable `c` is not bound in all patterns
      --> $DIR/issue-39698.rs:20:48
       |
    20 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
       |         ^^^^^^^^^^^   ^^^^^^^^^^^         -    ^^^^^^^^ pattern doesn't bind `c`
       |         |             |                   |
       |         |             |                   variable not in all patterns
       |         |             pattern doesn't bind `c`
       |         pattern doesn't bind `c`
    
    error[E0408]: variable `a` is not bound in all patterns
      --> $DIR/issue-39698.rs:20:37
       |
    20 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
       |               -       ^^^^^^^^^^^   ^^^^^^^^         - variable not in all patterns
       |               |       |             |
       |               |       |             pattern doesn't bind `a`
       |               |       pattern doesn't bind `a`
       |               variable not in all patterns
    
    error[E0408]: variable `b` is not bound in all patterns
      --> $DIR/issue-39698.rs:20:37
       |
    20 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
       |         ^^^^^^^^^^^            -    ^^^^^^^^   ^^^^^^^^ pattern doesn't bind `b`
       |         |                      |    |
       |         |                      |    pattern doesn't bind `b`
       |         |                      variable not in all patterns
       |         pattern doesn't bind `b`
    
    error: aborting due to 4 previous errors
    ```
    
    Fixes rust-lang#39698.
    frewsxcv committed Mar 6, 2017
    Configuration menu
    Copy the full SHA
    ec16d70 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#40154 - steveklabnik:link-unstable-book, r=…

    …frewsxcv
    
    add unstable book to the bookshelf
    
    r? @frewsxcv @GuillaumeGomez
    frewsxcv committed Mar 6, 2017
    Configuration menu
    Copy the full SHA
    52cbe70 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#40226 - jdhorwitz:master, r=frewsxcv

    Issue rust-lang#39688 - Help people find String::as_bytes() for UTF-8
    
    Added in links for the inverse functions so people will know that as_bytes() is the inverse of from_utf8() and vice versa.
    ?r @steveklabnik
    frewsxcv committed Mar 6, 2017
    Configuration menu
    Copy the full SHA
    5f3ecd5 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#40285 - estebank:issue-40221, r=arielb1

    Fix ICE: don't use `struct_variant` on enums
    
    Fix rust-lang#40221 and add unittest.
    frewsxcv committed Mar 6, 2017
    Configuration menu
    Copy the full SHA
    1d6ec96 View commit details
    Browse the repository at this point in the history