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 14 pull requests #122711

Closed
wants to merge 36 commits into from

Commits on Mar 6, 2024

  1. Stabilize imported_main

    clubby789 committed Mar 6, 2024
    Configuration menu
    Copy the full SHA
    c7030e9 View commit details
    Browse the repository at this point in the history

Commits on Mar 8, 2024

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

Commits on Mar 12, 2024

  1. Gracefully handle AnonConst in diagnostic_hir_wf_check()

    when it is the default value of a generic param
    gurry committed Mar 12, 2024
    Configuration menu
    Copy the full SHA
    d0e4a3b View commit details
    Browse the repository at this point in the history

Commits on Mar 13, 2024

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

Commits on Mar 17, 2024

  1. Configuration menu
    Copy the full SHA
    d7b4b01 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    23e1b57 View commit details
    Browse the repository at this point in the history

Commits on Mar 18, 2024

  1. Configuration menu
    Copy the full SHA
    33c274f View commit details
    Browse the repository at this point in the history
  2. NormalizesTo return nested goals

    lcnr committed Mar 18, 2024
    Configuration menu
    Copy the full SHA
    f26e1e8 View commit details
    Browse the repository at this point in the history
  3. Add tests

    veera-sivarajan committed Mar 18, 2024
    Configuration menu
    Copy the full SHA
    935842b View commit details
    Browse the repository at this point in the history
  4. move tests

    lcnr committed Mar 18, 2024
    Configuration menu
    Copy the full SHA
    efa4269 View commit details
    Browse the repository at this point in the history
  5. Fix ICE: global_asm!() Don't Panic When Unable to Evaluate Constant

    A bit of an inelegant fix but given that the error is created only
    after call to `const_eval_poly()` and that the calling function
    cannot propagate the error anywhere else, the error has to be
    explicitly handled inside `mono_item.rs`.
    veera-sivarajan committed Mar 18, 2024
    Configuration menu
    Copy the full SHA
    97cc700 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    39f2d25 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    8124b26 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    e34e344 View commit details
    Browse the repository at this point in the history
  9. improve comments

    lcnr committed Mar 18, 2024
    Configuration menu
    Copy the full SHA
    7c5a99b View commit details
    Browse the repository at this point in the history
  10. cleanup + review

    lcnr committed Mar 18, 2024
    Configuration menu
    Copy the full SHA
    0b29b71 View commit details
    Browse the repository at this point in the history
  11. Fix a typo in the 1.77.0 relnotes

    Co-authored-by: Mateusz Mikuła <[email protected]>
    cuviper and mati865 committed Mar 18, 2024
    Configuration menu
    Copy the full SHA
    4739948 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    0db06bf View commit details
    Browse the repository at this point in the history
  13. Deduplicate associated_body and body_id

    They match on almost the same patterns, which is fishy.
    
    Also turn `associated_body` into a method and do some cleanups nearby the call sites
    oli-obk committed Mar 18, 2024
    Configuration menu
    Copy the full SHA
    419d205 View commit details
    Browse the repository at this point in the history
  14. Use hir::Node helper methods instead of repeat the same impl multip…

    …le times
    
    There already were inconsistencies, so this ensures we don't introduce subtle surprising bugs
    oli-obk committed Mar 18, 2024
    Configuration menu
    Copy the full SHA
    69c4e81 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    9b0cbe3 View commit details
    Browse the repository at this point in the history
  16. Rollup merge of rust-lang#121258 - fmease:assoc-const-eq-reject-overl…

    …y-generic-tys, r=compiler-errors
    
    Reject overly generic assoc const binding types
    
    Split off from rust-lang#119385 to make rust-lang#119385 easier to review.
    
    ---
    
    In the *instantiated* type of assoc const bindings
    
    1. reject **early-bound generic params**
       * Provide a rich error message instead of ICE'ing ([rust-lang#108271](rust-lang#108271)).
       * This is a temporary and semi-artificial restriction until the arrival of *generic const generics*.
       * It's quite possible that rustc could already perfectly support this subset of generic const generics if we just removed some checks (some `.no_bound_vars().expect(…)`) but even if that was the case, I'd rather gate it behind a new feature flag. Reporting an error instead of ICE'ing is a good first step towards an eventual feature gate error.
    2. reject **escaping late-bound generic params**
       * They lead to ICEs before & I'm pretty sure that they remain incorrect even in a world with *generic const generics*
    
    ---
    
    Together with rust-lang#118668 & rust-lang#119385, this supersedes rust-lang#118360.
    Fixes rust-lang#108271.
    workingjubilee authored Mar 18, 2024
    Configuration menu
    Copy the full SHA
    5fd8878 View commit details
    Browse the repository at this point in the history
  17. Rollup merge of rust-lang#122021 - oli-obk:delangitemification, r=com…

    …piler-errors
    
    Use hir::Node helper methods instead of repeating the same impl multiple times
    
    I wanted to do something entirely different and stumbled upon a bunch of cleanups
    workingjubilee authored Mar 18, 2024
    Configuration menu
    Copy the full SHA
    d6a2918 View commit details
    Browse the repository at this point in the history
  18. Rollup merge of rust-lang#122055 - compiler-errors:stabilize-atb, r=o…

    …li-obk
    
    Stabilize associated type bounds (RFC 2289)
    
    This PR stabilizes associated type bounds, which were laid out in [RFC 2289]. This gives us a shorthand to express nested type bounds that would otherwise need to be expressed with nested `impl Trait` or broken into several `where` clauses.
    
    ### What are we stabilizing?
    
    We're stabilizing the associated item bounds syntax, which allows us to put bounds in associated type position within other bounds, i.e. `T: Trait<Assoc: Bounds...>`. See [RFC 2289] for motivation.
    
    In all position, the associated type bound syntax expands into a set of two (or more) bounds, and never anything else (see "How does this differ[...]" section for more info).
    
    Associated type bounds are stabilized in four positions:
    * **`where` clauses (and APIT)** - This is equivalent to breaking up the bound into two (or more) `where` clauses. For example, `where T: Trait<Assoc: Bound>` is equivalent to `where T: Trait, <T as Trait>::Assoc: Bound`.
    * **Supertraits** - Similar to above, `trait CopyIterator: Iterator<Item: Copy> {}`. This is almost equivalent to breaking up the bound into two (or more) `where` clauses; however, the bound on the associated item is implied whenever the trait is used. See rust-lang#112573/rust-lang#112629.
    * **Associated type item bounds** - This allows constraining the *nested* rigid projections that are associated with a trait's associated types. e.g. `trait Trait { type Assoc: Trait2<Assoc2: Copy>; }`.
    * **opaque item bounds (RPIT, TAIT)** - This allows constraining associated types that are associated with the opaque without having to *name* the opaque. For example, `impl Iterator<Item: Copy>` defines an iterator whose item is `Copy` without having to actually name that item bound.
    
    The latter three are not expressible in surface Rust (though for associated type item bounds, this will change in rust-lang#120752, which I don't believe should block this PR), so this does represent a slight expansion of what can be expressed in trait bounds.
    
    ### How does this differ from the RFC?
    
    Compared to the RFC, the current implementation *always* desugars associated type bounds to sets of `ty::Clause`s internally. Specifically, it does *not* introduce a position-dependent desugaring as laid out in [RFC 2289], and in particular:
    * It does *not* desugar to anonymous associated items in associated type item bounds.
    * It does *not* desugar to nested RPITs in RPIT bounds, nor nested TAITs in TAIT bounds.
    
    This position-dependent desugaring laid out in the RFC existed simply to side-step limitations of the trait solver, which have mostly been fixed in rust-lang#120584. The desugaring laid out in the RFC also added unnecessary complication to the design of the feature, and introduces its own limitations to, for example:
    * Conditionally lowering to nested `impl Trait` in certain positions such as RPIT and TAIT means that we inherit the limitations of RPIT/TAIT, namely lack of support for higher-ranked opaque inference. See this code example: rust-lang#120752 (comment).
    * Introducing anonymous associated types makes traits no longer object safe, since anonymous associated types are not nameable, and all associated types must be named in `dyn` types.
    
    This last point motivates why this PR is *not* stabilizing support for associated type bounds in `dyn` types, e.g, `dyn Assoc<Item: Bound>`. Why? Because `dyn` types need to have *concrete* types for all associated items, this would necessitate a distinct lowering for associated type bounds, which seems both complicated and unnecessary compared to just requiring the user to write `impl Trait` themselves. See rust-lang#120719.
    
    ### Implementation history:
    
    Limited to the significant behavioral changes and fixes and relevant PRs, ping me if I left something out--
    * rust-lang#57428
    * rust-lang#108063
    * rust-lang#110512
    * rust-lang#112629
    * rust-lang#120719
    * rust-lang#120584
    
    Closes rust-lang#52662
    
    [RFC 2289]: https://rust-lang.github.io/rfcs/2289-associated-type-bounds.html
    workingjubilee authored Mar 18, 2024
    Configuration menu
    Copy the full SHA
    cb1bc2c View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    9e6cee5 View commit details
    Browse the repository at this point in the history
  20. Rollup merge of rust-lang#122370 - gurry:122199-ice-unexpected-node, …

    …r=davidtwco
    
    Gracefully handle `AnonConst` in `diagnostic_hir_wf_check()`
    
    Instead of running the WF check on the `AnonConst` itself we run it on the `ty` of the generic param of which the `AnonConst` is the default value.
    
    Fixes rust-lang#122199
    workingjubilee authored Mar 18, 2024
    Configuration menu
    Copy the full SHA
    325763c View commit details
    Browse the repository at this point in the history
  21. Rollup merge of rust-lang#122392 - BoxyUwU:misc_cleanup, r=lcnr

    misc cleanups from debugging something
    
    rename `instantiate_canonical_with_fresh_inference_vars` to `instantiate_canonical`  the substs for the canonical are not solely infer vars as that would be wildly wrong and it is rather confusing to see this method called and think that the entire canonicalization setup is completely broken when it is not 👍
    
    also update region debug printing to be more like the custom impls for Ty/Const, right now regions in debug output are horribly verbose and make it incredibly hard to read but with this atleast boundvars and placeholders when debugging the new solver do not take up excessive amounts of space.
    
    r? `@lcnr`
    workingjubilee authored Mar 18, 2024
    Configuration menu
    Copy the full SHA
    7c8251f View commit details
    Browse the repository at this point in the history
  22. Rollup merge of rust-lang#122642 - pallix:improve-wording-for-vec-swa…

    …p_remove, r=Amanieu
    
    Improve wording of `Vec::swap_remove`
    
    This improve the wording for  `Vec::swap_remove`.
    workingjubilee authored Mar 18, 2024
    Configuration menu
    Copy the full SHA
    62de306 View commit details
    Browse the repository at this point in the history
  23. Rollup merge of rust-lang#122675 - tmfink:doc-clarify, r=scottmcm

    core: document default attribute stabilization
    
    As of now, the first release which stabilized the `#[default]` macro for the deriving the `Default` trait for enus is not documented.
    I have had to search the [`RELEASES.md`](https://github.com/rust-lang/rust/blob/master/RELEASES.md) when making sure my code would be accepted by an older Rust compiler.
    
    I just added a line in the doc comment since, as far as I know, there's no option to pass to the `#[stable()]` attribute.
    
    I am open to improvements in the wording.
    workingjubilee authored Mar 18, 2024
    Configuration menu
    Copy the full SHA
    6007cdd View commit details
    Browse the repository at this point in the history
  24. Rollup merge of rust-lang#122687 - lcnr:normalizes-to-emit-nested-goa…

    …ls, r=compiler-errors
    
    `NormalizesTo`: return nested goals to caller
    
    Fixes the regression of `paperclip-core`. see https://hackmd.io/IsVAafiOTAaPIFcUxRJufw for more details.
    
    r? `@compiler-errors`
    workingjubilee authored Mar 18, 2024
    Configuration menu
    Copy the full SHA
    d0e534c View commit details
    Browse the repository at this point in the history
  25. Rollup merge of rust-lang#122691 - veera-sivarajan:bugfix-121099, r=A…

    …manieu
    
    Fix ICE: `global_asm!()` Don't Panic When Unable to Evaluate Constant
    
    Fixes rust-lang#121099
    
    A bit of an inelegant fix but given that the error is created only
    after call to `const_eval_poly()` and that the calling function
    cannot propagate the error anywhere else, the error has to be
    explicitly handled inside `mono_item.rs`.
    
    r? `@Amanieu`
    workingjubilee authored Mar 18, 2024
    Configuration menu
    Copy the full SHA
    f8a01f9 View commit details
    Browse the repository at this point in the history
  26. Rollup merge of rust-lang#122693 - ehuss:rust-css-header, r=Guillaume…

    …Gomez
    
    Fix heading anchors in doc pages.
    
    This fixes the heading anchors on the standalone doc pages (the index, releases, etc.) so that the § symbol is only shown when the user hovers over the heading. This was changed in rust-lang#117662, but this CSS was not updated.
    workingjubilee authored Mar 18, 2024
    Configuration menu
    Copy the full SHA
    0e98a61 View commit details
    Browse the repository at this point in the history
  27. Rollup merge of rust-lang#122699 - cuviper:relnotes-1.77.0-as, r=ehuss

    Fix a typo in the 1.77.0 relnotes
    workingjubilee authored Mar 18, 2024
    Configuration menu
    Copy the full SHA
    02d1965 View commit details
    Browse the repository at this point in the history
  28. Rollup merge of rust-lang#122700 - esp-rs:remove-old-files, r=working…

    …jubilee
    
    Remove redundant files, rename base riscv32 file
    
    Fixes a mistake I made in rust-lang#117874.
    workingjubilee authored Mar 18, 2024
    Configuration menu
    Copy the full SHA
    1612955 View commit details
    Browse the repository at this point in the history
  29. Rollup merge of rust-lang#122701 - compiler-errors:allocator-suspend,…

    … r=oli-obk
    
    Detect allocator for box in `must_not_suspend` lint
    
    I don't expect this to happen in practice, but better to check than not.
    
    Fixes rust-lang#122643
    workingjubilee authored Mar 18, 2024
    Configuration menu
    Copy the full SHA
    6380d28 View commit details
    Browse the repository at this point in the history