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 8 pull requests #100516

Merged
merged 22 commits into from
Aug 14, 2022
Merged

Rollup of 8 pull requests #100516

merged 22 commits into from
Aug 14, 2022

Commits on Aug 10, 2022

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

Commits on Aug 11, 2022

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

Commits on Aug 12, 2022

  1. Configuration menu
    Copy the full SHA
    48c0341 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b821ce6 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6925f41 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    20121fa View commit details
    Browse the repository at this point in the history
  5. And for closures

    compiler-errors committed Aug 12, 2022
    Configuration menu
    Copy the full SHA
    262644d View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    237cbe9 View commit details
    Browse the repository at this point in the history
  7. Address nit

    compiler-errors committed Aug 12, 2022
    Configuration menu
    Copy the full SHA
    c608918 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    de8dedb View commit details
    Browse the repository at this point in the history

Commits on Aug 13, 2022

  1. Configuration menu
    Copy the full SHA
    d47df26 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b0cd1e1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    aa1a07f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    752b0e0 View commit details
    Browse the repository at this point in the history

Commits on Aug 14, 2022

  1. Rollup merge of rust-lang#99646 - compiler-errors:arg-mismatch-single…

    …-arg-label, r=estebank
    
    Only point out a single function parameter if we have a single arg incompatibility
    
    Fixes rust-lang#99635
    compiler-errors authored Aug 14, 2022
    Configuration menu
    Copy the full SHA
    2af3445 View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#100299 - compiler-errors:issue-100283, r=no…

    …triddle
    
    make `clean::Item::span` return `Option` instead of dummy span
    
    Fixes rust-lang#100283
    compiler-errors authored Aug 14, 2022
    Configuration menu
    Copy the full SHA
    d496c4e View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#100335 - aDotInTheVoid:rdj-resolved-path, r…

    …=GuillaumeGomez
    
    Rustdoc-Json: Add `Path` type for traits.
    
    Avoids using `Type` for trait fields, as a trait must always be a path, and not any other kind of type.
    
    ``@rustbot`` modify labels: +A-rustdoc-json +T-rustdoc
    
    Closes rust-lang#100106
    compiler-errors authored Aug 14, 2022
    Configuration menu
    Copy the full SHA
    4989f6a View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#100367 - fmease:fix-100365, r=compiler-errors

    Suggest the path separator when a dot is used on a trait
    
    Fixes rust-lang#100365.
    
    `@rustbot` label A-diagnostics
    r? diagnostics
    compiler-errors authored Aug 14, 2022
    Configuration menu
    Copy the full SHA
    e248c7f View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#100431 - compiler-errors:enum-ctor-variant-…

    …stab, r=estebank
    
    Enum variant ctor inherits the stability of the enum variant
    
    Fixes rust-lang#100399
    Fixes rust-lang#100420
    
    Context rust-lang#71481 for why enum variants don't need stability
    compiler-errors authored Aug 14, 2022
    Configuration menu
    Copy the full SHA
    d46451c View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#100446 - TaKO8Ki:suggest-removing-semicolon…

    …-after-impl-trait-items, r=compiler-errors
    
    Suggest removing a semicolon after impl/trait items
    
    fixes rust-lang#99822
    compiler-errors authored Aug 14, 2022
    Configuration menu
    Copy the full SHA
    86e1d1e View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#100468 - cuviper:lazy-x, r=jyn514

    Use an extensionless `x` script for non-Windows
    
    rust-lang#99992 added `x.sh` and `x.ps1`, but this broke my lazy `./xTAB` habit that used to get me to `./x.py`. If we rename `x.sh` to `x`, then I can adjust to `./xSPACE` for the same number of characters typed.
    
    r? `@jyn514`
    compiler-errors authored Aug 14, 2022
    Configuration menu
    Copy the full SHA
    809fc86 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#100479 - compiler-errors:argument-type-erro…

    …r-improvements, r=lcnr
    
    Argument type error improvements
    
    Motivated by this interesting code snippet:
    
    ```rust
    #[derive(Copy, Clone)]
    struct Wrapper<T>(T);
    
    fn foo(_: fn(i32), _: Wrapper<i32>) {}
    
    fn f(_: u32) {}
    
    fn main() {
        let w = Wrapper::<isize>(1isize);
        foo(f, w);
    }
    ```
    
    Which currently errors like:
    ```
    error[E0308]: arguments to this function are incorrect
      --> src/main.rs:10:5
       |
    10 |     foo(f, w);
       |     ^^^ -  - expected `i32`, found `isize`
       |         |
       |         expected `i32`, found `u32`
       |
       = note: expected fn pointer `fn(i32)`
                     found fn item `fn(u32) {f}`
       = note: expected struct `Wrapper<i32>`
                  found struct `Wrapper<isize>`
    note: function defined here
      --> src/main.rs:4:4
       |
    4  | fn foo(_: fn(i32), _: Wrapper<i32>) {}
       |    ^^^ ----------  ---------------
    ```
    
    Specifically, that double `expected .. found ..` which is very difficult to correlate to the types in the arguments. Also, the fact that "expected `i32`, found `isize`" and the other argument mismatch label don't even really explain what's going on here.
    
    After this PR:
    ```
    error[E0308]: arguments to this function are incorrect
      --> $DIR/two-mismatch-notes.rs:10:5
       |
    LL |     foo(f, w);
       |     ^^^
       |
    note: expected fn pointer, found fn item
      --> $DIR/two-mismatch-notes.rs:10:9
       |
    LL |     foo(f, w);
       |         ^
       = note: expected fn pointer `fn(i32)`
                     found fn item `fn(u32) {f}`
    note: expected struct `Wrapper`, found a different struct `Wrapper`
      --> $DIR/two-mismatch-notes.rs:10:12
       |
    LL |     foo(f, w);
       |            ^
       = note: expected struct `Wrapper<i32>`
                  found struct `Wrapper<isize>`
    note: function defined here
      --> $DIR/two-mismatch-notes.rs:4:4
       |
    LL | fn foo(_: fn(i32), _: Wrapper<i32>) {}
       |    ^^^ ----------  ---------------
    
    error: aborting due to previous error
    
    For more information about this error, try `rustc --explain E0308`.
    ```
    
    Yeah, it's a bit verbose, but much clearer IMO.
    
    ---
    
    Open to discussions about how this could be further improved. Motivated by `@jyn514's` [tweet](https://mobile.twitter.com/joshuayn514/status/1558042020601634816) here.
    compiler-errors authored Aug 14, 2022
    Configuration menu
    Copy the full SHA
    b3e76aa View commit details
    Browse the repository at this point in the history