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 9 pull requests #120714

Closed
wants to merge 34 commits into from

Commits on Jan 14, 2024

  1. Configuration menu
    Copy the full SHA
    511bf6e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2cfc817 View commit details
    Browse the repository at this point in the history

Commits on Jan 28, 2024

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

Commits on Jan 30, 2024

  1. limit the names_possiblilities to less than 3

    Co-authored-by: Urgau <3616612+Urgau@users.noreply.github.com>
    chenyukang and Urgau committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    0213c87 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ca243e7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d34b0fa View commit details
    Browse the repository at this point in the history
  4. Account for unbounded type param receiver in suggestions

    When encountering
    
    ```rust
    fn f<T>(a: T, b: T) -> std::cmp::Ordering {
        a.cmp(&b) //~ ERROR E0599
    }
    ```
    
    output
    
    ```
    error[E0599]: no method named `cmp` found for type parameter `T` in the current scope
      --> $DIR/method-on-unbounded-type-param.rs:2:7
       |
    LL | fn f<T>(a: T, b: T) -> std::cmp::Ordering {
       |      - method `cmp` not found for this type parameter
    LL |     a.cmp(&b)
       |       ^^^ method cannot be called on `T` due to unsatisfied trait bounds
       |
       = help: items from traits can only be used if the type parameter is bounded by the trait
    help: the following traits define an item `cmp`, perhaps you need to restrict type parameter `T` with one of them:
       |
    LL | fn f<T: Ord>(a: T, b: T) -> std::cmp::Ordering {
       |       +++++
    LL | fn f<T: Iterator>(a: T, b: T) -> std::cmp::Ordering {
       |       ++++++++++
    ```
    
    Fix rust-lang#120186.
    estebank committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    20b1c2a View commit details
    Browse the repository at this point in the history
  5. fix rebase

    estebank committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    9ccc770 View commit details
    Browse the repository at this point in the history
  6. Account for non-overlapping unmet trait bounds in suggestion

    When a method not found on a type parameter could have been provided by any
    of multiple traits, suggest each trait individually, instead of a single
    suggestion to restrict the type parameter with *all* of them.
    
    Before:
    
    ```
    error[E0599]: the method `cmp` exists for reference `&T`, but its trait bounds were not satisfied
      --> $DIR/method-on-unbounded-type-param.rs:5:10
       |
    LL |     (&a).cmp(&b)
       |          ^^^ method cannot be called on `&T` due to unsatisfied trait bounds
       |
       = note: the following trait bounds were not satisfied:
               `T: Ord`
               which is required by `&T: Ord`
               `&T: Iterator`
               which is required by `&mut &T: Iterator`
               `T: Iterator`
               which is required by `&mut T: Iterator`
    help: consider restricting the type parameters to satisfy the trait bounds
       |
    LL | fn g<T>(a: T, b: T) -> std::cmp::Ordering where T: Iterator, T: Ord {
       |                                           +++++++++++++++++++++++++
    ```
    
    After:
    
    ```
    error[E0599]: the method `cmp` exists for reference `&T`, but its trait bounds were not satisfied
      --> $DIR/method-on-unbounded-type-param.rs:5:10
       |
    LL |     (&a).cmp(&b)
       |          ^^^ method cannot be called on `&T` due to unsatisfied trait bounds
       |
       = note: the following trait bounds were not satisfied:
               `T: Ord`
               which is required by `&T: Ord`
               `&T: Iterator`
               which is required by `&mut &T: Iterator`
               `T: Iterator`
               which is required by `&mut T: Iterator`
       = help: items from traits can only be used if the type parameter is bounded by the trait
    help: the following traits define an item `cmp`, perhaps you need to restrict type parameter `T` with one of them:
       |
    LL | fn g<T: Ord>(a: T, b: T) -> std::cmp::Ordering {
       |       +++++
    LL | fn g<T: Iterator>(a: T, b: T) -> std::cmp::Ordering {
       |       ++++++++++
    ```
    
    Fix rust-lang#108428.
    estebank committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    5c41409 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    7331315 View commit details
    Browse the repository at this point in the history

Commits on Jan 31, 2024

  1. ast_lowering: Make sure all imports have non-empty resolution lists

    HIR visitor visits import paths once per resolution, so if some import has an empty resolution list, like in case of import list stems, its path stays unvisited.
    petrochenkov committed Jan 31, 2024
    Configuration menu
    Copy the full SHA
    49d49eb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3ff6796 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e292423 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    be77cf8 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f65fe3b View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    be80c82 View commit details
    Browse the repository at this point in the history

Commits on Feb 2, 2024

  1. Configuration menu
    Copy the full SHA
    0e16885 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7576b77 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7d1fda7 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a371059 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e951bcf View commit details
    Browse the repository at this point in the history

Commits on Feb 5, 2024

  1. Configuration menu
    Copy the full SHA
    9f58cf4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    48abca7 View commit details
    Browse the repository at this point in the history
  3. update the tracking issue for structural match violations

    and bless a test I missed
    RalfJung committed Feb 5, 2024
    Configuration menu
    Copy the full SHA
    45d01b8 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e00df17 View commit details
    Browse the repository at this point in the history

Commits on Feb 6, 2024

  1. Rollup merge of rust-lang#119939 - clubby789:static-const-generic-not…

    …e, r=compiler-errors
    
    Improve 'generic param from outer item' error for `Self` and inside `static`/`const` items
    
    Fixes rust-lang#109596
    Fixes rust-lang#119936
    matthiaskrgr committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    a255db4 View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#120206 - petrochenkov:somehir, r=compiler-e…

    …rrors
    
    hir: Make sure all `HirId`s have corresponding HIR `Node`s
    
    And then remove `tcx.opt_hir_node(hir_id)` in favor of `tcx.hir_node(hir_id)`.
    matthiaskrgr committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    02896ce View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#120331 - Nadrieril:no-arena, r=compiler-errors

    pattern_analysis: use a plain `Vec` in `DeconstructedPat`
    
    The use of an arena-allocated slice in `DeconstructedPat` dates to when we needed the arena anyway for lifetime reasons. Now that we don't, I'm thinking that if `thir::Pat` can use plain old `Vec`s, maybe so can I.
    
    r? ``@ghost``
    matthiaskrgr committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    8f70824 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#120396 - estebank:method-on-unbounded-type-…

    …param, r=nnethercote
    
    Account for unbounded type param receiver in suggestions
    
    When encountering
    
    ```rust
    fn f<T>(a: T, b: T) -> std::cmp::Ordering {
        a.cmp(&b) //~ ERROR E0599
    }
    ```
    
    output
    
    ```
    error[E0599]: no method named `cmp` found for type parameter `T` in the current scope
      --> $DIR/method-on-unbounded-type-param.rs:2:7
       |
    LL | fn f<T>(a: T, b: T) -> std::cmp::Ordering {
       |      - method `cmp` not found for this type parameter
    LL |     a.cmp(&b)
       |       ^^^ method cannot be called on `T` due to unsatisfied trait bounds
       |
       = help: items from traits can only be used if the type parameter is bounded by the trait
    help: the following traits define an item `cmp`, perhaps you need to restrict type parameter `T` with one of them:
       |
    LL | fn f<T: Ord>(a: T, b: T) -> std::cmp::Ordering {
       |       +++++
    LL | fn f<T: Iterator>(a: T, b: T) -> std::cmp::Ordering {
       |       ++++++++++
    ```
    
    Fix rust-lang#120186.
    matthiaskrgr committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    0175f9f View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#120423 - RalfJung:indirect-structural-match…

    …, r=petrochenkov
    
    update indirect structural match lints to match RFC and to show up for dependencies
    
    This is a large step towards implementing rust-lang/rfcs#3535.
    We currently have five lints related to "the structural match situation":
    - nontrivial_structural_match
    - indirect_structural_match
    - pointer_structural_match
    - const_patterns_without_partial_eq
    - illegal_floating_point_literal_pattern
    
    This PR concerns the first 3 of them. (The 4th already is set up to show for dependencies, and the 5th is removed by rust-lang#116284.) nontrivial_structural_match is being removed as per the RFC; the other two are enabled to show up in dependencies.
    
    Fixes rust-lang#73448 by removing the affected analysis.
    matthiaskrgr committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    f4abc7b View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#120435 - chenyukang:yukang-fix-120427-cfg-n…

    …ame, r=Urgau,Nilstrieb
    
    Suggest name value cfg when only value is used for check-cfg
    
    Fixes rust-lang#120427
    r? ````````````@Nilstrieb````````````
    matthiaskrgr committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    65ec50b View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#120502 - clubby789:remove-ffi-returns-twice…

    …, r=compiler-errors
    
    Remove `ffi_returns_twice` feature
    
    The [tracking issue](rust-lang#58314) and [RFC](rust-lang/rfcs#2633) have been closed for a couple of years.
    
    There is also an attribute gate in R-A which should be removed if this lands.
    matthiaskrgr committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    2a488c4 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#120507 - estebank:issue-108428, r=davidtwco

    Account for non-overlapping unmet trait bounds in suggestion
    
    When a method not found on a type parameter could have been provided by any
    of multiple traits, suggest each trait individually, instead of a single
    suggestion to restrict the type parameter with *all* of them.
    
    Before:
    
    ```
    error[E0599]: the method `cmp` exists for reference `&T`, but its trait bounds were not satisfied
      --> $DIR/method-on-unbounded-type-param.rs:5:10
       |
    LL |     (&a).cmp(&b)
       |          ^^^ method cannot be called on `&T` due to unsatisfied trait bounds
       |
       = note: the following trait bounds were not satisfied:
               `T: Ord`
               which is required by `&T: Ord`
               `&T: Iterator`
               which is required by `&mut &T: Iterator`
               `T: Iterator`
               which is required by `&mut T: Iterator`
    help: consider restricting the type parameters to satisfy the trait bounds
       |
    LL | fn g<T>(a: T, b: T) -> std::cmp::Ordering where T: Iterator, T: Ord {
       |                                           +++++++++++++++++++++++++
    ```
    
    After:
    
    ```
    error[E0599]: the method `cmp` exists for reference `&T`, but its trait bounds were not satisfied
      --> $DIR/method-on-unbounded-type-param.rs:5:10
       |
    LL |     (&a).cmp(&b)
       |          ^^^ method cannot be called on `&T` due to unsatisfied trait bounds
       |
       = note: the following trait bounds were not satisfied:
               `T: Ord`
               which is required by `&T: Ord`
               `&T: Iterator`
               which is required by `&mut &T: Iterator`
               `T: Iterator`
               which is required by `&mut T: Iterator`
       = help: items from traits can only be used if the type parameter is bounded by the trait
    help: the following traits define an item `cmp`, perhaps you need to restrict type parameter `T` with one of them:
       |
    LL | fn g<T: Ord>(a: T, b: T) -> std::cmp::Ordering {
       |       +++++
    LL | fn g<T: Iterator>(a: T, b: T) -> std::cmp::Ordering {
       |       ++++++++++
    ```
    
    Fix rust-lang#108428.
    
    Follow up to rust-lang#120396, only last commit is relevant.
    matthiaskrgr committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    ab20137 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#120513 - compiler-errors:normalize-regions-…

    …for-nll, r=lcnr
    
    Normalize type outlives obligations in NLL for new solver
    
    Normalize the type outlives assumptions and obligations in MIR borrowck. This should fix any of the lazy-norm-related MIR borrowck problems.
    
    Also some cleanups from last PR:
    1. Normalize obligations in a loop in lexical region resolution
    2. Use `deeply_normalize_with_skipped_universes` in lexical resolution since we may have, e.g. `for<'a> Alias<'a>: 'b`.
    
    r? lcnr
    matthiaskrgr committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    3ba5334 View commit details
    Browse the repository at this point in the history