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

Closed
wants to merge 20 commits into from

Commits on Mar 10, 2024

  1. Configuration menu
    Copy the full SHA
    2d48a3a View commit details
    Browse the repository at this point in the history
  2. Fix lint.

    reitermarkus committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    85dfb47 View commit details
    Browse the repository at this point in the history
  3. Fix miri tests.

    reitermarkus committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    b5c11d1 View commit details
    Browse the repository at this point in the history

Commits on Mar 14, 2024

  1. Configuration menu
    Copy the full SHA
    bc532a6 View commit details
    Browse the repository at this point in the history
  2. Fix lint.

    reitermarkus committed Mar 14, 2024
    Configuration menu
    Copy the full SHA
    40f8227 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ecee730 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    4a79908 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    36a8dae View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    75fba9d View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    42c5eb8 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    2047e84 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    87ced15 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    48f2f0d View commit details
    Browse the repository at this point in the history

Commits on Mar 15, 2024

  1. Configuration menu
    Copy the full SHA
    571f945 View commit details
    Browse the repository at this point in the history
  2. Clean up AstConv

    fmease committed Mar 15, 2024
    Configuration menu
    Copy the full SHA
    5beda81 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#121885 - reitermarkus:generic-nonzero-inner…

    …, r=oli-obk
    
    Move generic `NonZero` `rustc_layout_scalar_valid_range_start` attribute to inner type.
    
    Tracking issue: rust-lang#120257
    
    r? `@dtolnay`
    matthiaskrgr authored Mar 15, 2024
    Configuration menu
    Copy the full SHA
    bd376dc View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#122471 - RalfJung:const-eval-span, r=oli-obk

    preserve span when evaluating mir::ConstOperand
    
    This lets us show to the user where they were using the faulty const (which can be quite relevant when generics are involved).
    
    I wonder if we should change "erroneous constant encountered" to something like "the above error was encountered while evaluating this constant" or so, to make this more similar to what the collector emits when showing a "backtrace" of where things get monomorphized? It seems a bit strange to rely on the order of emitted diagnostics for that but it seems the collector already [does that](https://github.com/rust-lang/rust/blob/da8a8c9223722e17cc0173ce9490076b4a6d263d/compiler/rustc_monomorphize/src/collector.rs#L472-L475).
    matthiaskrgr authored Mar 15, 2024
    Configuration menu
    Copy the full SHA
    cc125a4 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#122515 - jieyouxu:ice-self-ty-mismatch, r=c…

    …ompiler-errors
    
    Pass the correct DefId when suggesting writing the aliased Self type out
    
    Fixes rust-lang#122467.
    matthiaskrgr authored Mar 15, 2024
    Configuration menu
    Copy the full SHA
    8a34c31 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#122523 - compiler-errors:ensure-associated-…

    …types, r=oli-obk
    
    Ensure RPITITs are created before def-id freezing
    
    From the test:
    
    ```rust
    // `ty::Error` in a trait ref will silence any missing item errors, but will also
    // prevent the `associated_items` query from being called before def ids are frozen.
    ```
    
    Essentially, the code that checks that `impl`s have all their items (`check_impl_items_against_trait`) is also (implicitly) responsible for fetching the `associated_items` query before, but since we early return here:
    https://github.com/rust-lang/rust/blob/c2901f543577af99b9cb708f5c0d28525eb7f08f/compiler/rustc_hir_analysis/src/check/check.rs#L732-L737
    ...that means that this never happens for trait refs that reference errors.
    
    Fixes rust-lang#122518
    r? oli-obk
    matthiaskrgr authored Mar 15, 2024
    Configuration menu
    Copy the full SHA
    c588677 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#122527 - fmease:clean-up-hir-ty-lowering, r…

    …=compiler-errors
    
    Clean up AstConv
    
    Split off from rust-lang#120926 to make it only contain the renaming & (doc) comment updates.
    Any changes other than that which have accumulated over time are now part of this PR.
    Let's be disciplined ;) Inspired by rust-lang#120926 (comment).
    
    ---
    
    * Remove `hir_trait_to_predicates`
      * Unused since rust-lang#113671
    * Inline `create_args_for_ast_trait_ref`
      * Only had a single call site
      * Having it as a separate method didn't gain us anything
    * Use an if-let guard somewhere to avoid unwrapping
    * Avoid explicit trait object lifetimes
      * More legible, stylistic-only (the updated code is 100% semantically identical)
      * Use explicitly elided lifetimes in impl headers, they get elaborated to distinct lifetimes
      * Make use of [object lifetime defaulting](https://doc.rust-lang.org/reference/lifetime-elision.html#default-trait-object-lifetimes) for a trait object type inside of a reference type somewhere
    * Use preexisting dedicated method `ItemCtxt::to_ty` over `<dyn AstConv<'_>>::ast_ty_to_ty`
    * Use preexisting dedicated method `AstConv::astconv` over explicit coercions
    * Simplify the function signature of `create_args_for_ast_path` and of `check_generic_arg_count`
      * In both cases redundant information was passed rendering the call sites verbose and confusing
      * No perf impact (tested in [rust-lang#120926](rust-lang#120926))
    * Move diagnostic method `report_ambiguous_associated_type` from `astconv` to `astconv::errors`
      * The submodule `errors` exists specifically for that purpose
      * Use it to keep the main module clean & short
    matthiaskrgr authored Mar 15, 2024
    Configuration menu
    Copy the full SHA
    e1b25d9 View commit details
    Browse the repository at this point in the history