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 #103671

Merged
merged 18 commits into from
Oct 28, 2022
Merged

Rollup of 5 pull requests #103671

merged 18 commits into from
Oct 28, 2022

Commits on Oct 21, 2022

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

Commits on Oct 25, 2022

  1. Configuration menu
    Copy the full SHA
    641bf08 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a4279a1 View commit details
    Browse the repository at this point in the history
  3. diagnostics: do not suggest static candidates as traits to import

    If it's a static candidate, then it's already implemented. Do not suggest
    it a second time for implementing.
    notriddle committed Oct 25, 2022
    Configuration menu
    Copy the full SHA
    b205a5a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8cf9ad6 View commit details
    Browse the repository at this point in the history

Commits on Oct 27, 2022

  1. Configuration menu
    Copy the full SHA
    dce44fa View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4e0c27b View commit details
    Browse the repository at this point in the history
  3. Add tests for static async functions in traits

    This patch adds test cases for AFIT, the majority of which are currently
    expected to run as `check-fail`.
    bryangarza committed Oct 27, 2022
    Configuration menu
    Copy the full SHA
    97423d3 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8a0ebca View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    11b1439 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    9a05081 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    0b3b046 View commit details
    Browse the repository at this point in the history
  8. Update tests based on feedback

    - Add comment to some tests that will break when rust-lang#102745 is implemented
    - Mark a test with known-bug
    - Delete duplicate test
    bryangarza committed Oct 27, 2022
    Configuration menu
    Copy the full SHA
    bfdefdb View commit details
    Browse the repository at this point in the history

Commits on Oct 28, 2022

  1. Rollup merge of rust-lang#102642 - bryangarza:afit-tests, r=compiler-…

    …errors
    
    Add tests for static async functions in traits
    
    This patch adds test cases for AFIT, the majority of which are currently expected to run as `check-fail`.
    
    ---
    
    Note: I grabbed the cases from https://hackmd.io/SwRcXCiWQV-WRJ4BYs53fA
    
    Also, I'm not sure if the `async-associated-types2` and `async-associated-types2-desugared` are correct, I modified them a bit from the examples in the HackMD.
    matthiaskrgr authored Oct 28, 2022
    Configuration menu
    Copy the full SHA
    c404092 View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#103283 - nbarrios1337:unsafe-impl-suggestio…

    …ns, r=cjgillot
    
    Add suggestions for unsafe impl error codes
    
    Adds suggestions for users to add `unsafe` to trait impls that should be `unsafe`, and remove `unsafe` from trait impls that do not require `unsafe`
    
    With the folllowing code:
    
    ```rust
    struct Foo {}
    
    struct Bar {}
    
    trait Safe {}
    
    unsafe trait Unsafe {}
    
    impl Safe for Foo {} // ok
    
    impl Unsafe for Foo {} // E0200
    
    unsafe impl Safe for Bar {} // E0199
    
    unsafe impl Unsafe for Bar {} // ok
    
    // omitted empty main fn
    ```
    
    The current rustc output is:
    ```
    error[E0199]: implementing the trait `Safe` is not unsafe
      --> e0200.rs:13:1
       |
    13 | unsafe impl Safe for Bar {} // E0199
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    
    error[E0200]: the trait `Unsafe` requires an `unsafe impl` declaration
      --> e0200.rs:11:1
       |
    11 | impl Unsafe for Foo {} // E0200
       | ^^^^^^^^^^^^^^^^^^^^^^
    
    error: aborting due to 2 previous errors
    
    Some errors have detailed explanations: E0199, E0200.
    For more information about an error, try `rustc --explain E0199`.
    ```
    
    With this PR, the future rustc output would be:
    ```
    error[E0199]: implementing the trait `Safe` is not unsafe
      --> ../../temp/e0200.rs:13:1
       |
    13 | unsafe impl Safe for Bar {} // E0199
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
    help: remove `unsafe` from this trait implementation
       |
    13 - unsafe impl Safe for Bar {} // E0199
    13 + impl Safe for Bar {} // E0199
       |
    
    error[E0200]: the trait `Unsafe` requires an `unsafe impl` declaration
      --> ../../temp/e0200.rs:11:1
       |
    11 | impl Unsafe for Foo {} // E0200
       | ^^^^^^^^^^^^^^^^^^^^^^
       |
       = note: the trait `Unsafe` enforces invariants that the compiler can't check. Review the trait documentation and make sure this implementation upholds those invariants before adding the `unsafe` keyword
    help: add `unsafe` to this trait implementation
       |
    11 | unsafe impl Unsafe for Foo {} // E0200
       | ++++++
    
    error: aborting due to 2 previous errors
    
    Some errors have detailed explanations: E0199, E0200.
    For more information about an error, try `rustc --explain E0199`.
    ```
    
    ``@rustbot`` label +T-compiler +A-diagnostics +A-suggestion-diagnostics
    matthiaskrgr authored Oct 28, 2022
    Configuration menu
    Copy the full SHA
    270e0c5 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#103523 - GuillaumeGomez:inline-doc-comment-…

    …impl-block, r=notriddle
    
    Fix unwanted merge of inline doc comments for impl blocks
    
    Fixes rust-lang#102909.
    
    We need this merge mechanism for inlined items but it's completely unwanted for impl blocks (at least the doc comments are, not the other attributes) since we want to keep what `cfg()` is put on the `pub use` or other attributes.
    
    r? ``@notriddle``
    matthiaskrgr authored Oct 28, 2022
    Configuration menu
    Copy the full SHA
    2f02cf8 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#103550 - notriddle:notriddle/no-suggest-sta…

    …tic-candidates, r=wesleywiser
    
    diagnostics: do not suggest static candidates as traits to import
    
    If it's a static candidate, then it's already implemented. Do not suggest it a second time for implementing.
    
    Partial fix for rust-lang#102354
    matthiaskrgr authored Oct 28, 2022
    Configuration menu
    Copy the full SHA
    f541ad9 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#103641 - compiler-errors:issue-103624, r=cj…

    …gillot
    
    Don't carry MIR location in `ConstraintCategory::CallArgument`
    
    It turns out that `ConstraintCategory::CallArgument` cannot just carry a MIR location in it, since we may bubble them up to totally different MIR bodies.
    
    So instead, revert the commit a6b5f95, and instead just erase regions from the original `Option<Ty<'tcx>>` that it carried, so that it doesn't ICE with the changes in rust-lang#103220.
    
    Best reviewed in parts -- the first is just a revert, and the second is where the meaningful changes happen.
    
    Fixes rust-lang#103624
    matthiaskrgr authored Oct 28, 2022
    Configuration menu
    Copy the full SHA
    84663ce View commit details
    Browse the repository at this point in the history