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 7 pull requests #130807

Merged
merged 21 commits into from
Sep 25, 2024
Merged

Rollup of 7 pull requests #130807

merged 21 commits into from
Sep 25, 2024

Commits on Sep 23, 2024

  1. Improve assembly test for CMSE ABIs

    This ensures the code-gen for these ABIs does not change silently.
    
    Co-authored-by: Folkert <folkert@folkertdev.nl>
    tdittr and folkertdev committed Sep 23, 2024
    Configuration menu
    Copy the full SHA
    3d168c2 View commit details
    Browse the repository at this point in the history

Commits on Sep 24, 2024

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

    compiler-errors committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    28f6980 View commit details
    Browse the repository at this point in the history
  3. Pin memchr to 2.5.0 in the library rather than rustc_ast

    The latest versions of `memchr` experience LTO-related issues when
    compiling for windows-gnu [1], so needs to be pinned. The issue is
    present in the standard library.
    
    `memchr` has been pinned in `rustc_ast`, but since the workspace was
    recently split, this pin no longer has any effect on library crates.
    
    Resolve this by adding `memchr` as an _unused_ dependency in `std`,
    pinned to 2.5. Additionally, remove the pin in `rustc_ast` to allow
    non-library crates to upgrade to the latest version.
    
    Link: rust-lang#127890 [1]
    tgross35 committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    e95d15a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    50729fe View commit details
    Browse the repository at this point in the history
  5. add InProgress ErrorKind gated behind io_error_inprogress feature

    Co-authored-by: David Tolnay <dtolnay@gmail.com>
    Co-authored-by: nora <48135649+Noratrieb@users.noreply.github.com>
    3 people committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    46fd76e View commit details
    Browse the repository at this point in the history
  6. rustdoc: inherit parent's stability where applicable

    Lukas Markeffsky committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    2fdeb3b View commit details
    Browse the repository at this point in the history
  7. unify dyn* coercions with other pointer coercions

    Lukas Markeffsky committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    46ecb23 View commit details
    Browse the repository at this point in the history
  8. add another test

    Lukas Markeffsky committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    b52dea8 View commit details
    Browse the repository at this point in the history
  9. use more accurate spans for user type ascriptions

    Lukas Markeffsky committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    d1e82d4 View commit details
    Browse the repository at this point in the history
  10. replace "cast" with "coercion" where applicable

    This changes the remaining span for the cast, because the new `Cast`
    category has a higher priority (lower `Ord`) than the old `Coercion`
    category, so we no longer report the region error for the "unsizing"
    coercion from `*const Trait` to itself.
    Lukas Markeffsky committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    5e60d1f View commit details
    Browse the repository at this point in the history
  11. be even more precise about "cast" vs "coercion"

    Lukas Markeffsky committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    bd31e3e View commit details
    Browse the repository at this point in the history
  12. improve errors for invalid pointer casts

    Lukas Markeffsky committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    39f66ba View commit details
    Browse the repository at this point in the history
  13. update doc comment

    Lukas Markeffsky committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    b62e72c View commit details
    Browse the repository at this point in the history
  14. Rollup merge of rust-lang#130234 - lukas-code:ptr-cast-errors, r=Waff…

    …leLapkin
    
    improve compile errors for invalid ptr-to-ptr casts with trait objects
    
    This is a follow-up to rust-lang#120248 to improve some of its error messages.
    
    1. Make the borrowcheck error for "type annotation requires that x must outlive y" actually point at the type annotation, i.e. the type `T` in a `x as T` cast. This makes the error more consistent with other errors caused by type annotation in other places, such as
    ```text
    error: lifetime may not live long enough
     --> src/lib.rs:4:12
      |
    3 | fn bar(a: &i32) {
      |           - let's call the lifetime of this reference `'1`
    4 |     let b: &'static i32 = a;
      |            ^^^^^^^^^^^^ type annotation requires that `'1` must outlive `'static`
    ```
    
    2. Don't say "cast" when we actually mean "coercion" and give borrowcheck errors from actual casts (which is currently just the check added in rust-lang#120248) a higher priority than ones from coercions. This can improve the errors for ptr-to-ptr cast between trait objects because they are are lowered as an upcast "unsizing" coercion if possible (which may be the identity upcast) followed by the actual cast.
    
    3. Bring back the old "casting X as Y is invalid" message for type mismatch in the principals and reword the "vtable kinds may not match" message to more accurately describe the pointer metadata and not refer to "vtables" if the metadata is unknown.
    
    fixes rust-lang#130030
    
    r? `@WaffleLapkin` but feel free to reassign
    tgross35 authored Sep 24, 2024
    Configuration menu
    Copy the full SHA
    75296fc View commit details
    Browse the repository at this point in the history
  15. Rollup merge of rust-lang#130752 - tdittr:cmse-assembly-tests, r=jiey…

    …ouxu
    
    Improve assembly test for CMSE ABIs
    
    Tracking issues: rust-lang#75835 rust-lang#81391
    
    This ensures the code-gen for these ABIs does not change silently. There is a small chance that this code-gen might change, however even GCC (https://godbolt.org/z/16arxab5x and https://godbolt.org/z/16arxab5x) generates almost the same assembly for these ABIs. I hope the notes in the comments should help fix the tests if it ever breaks.
    tgross35 authored Sep 24, 2024
    Configuration menu
    Copy the full SHA
    1f52c07 View commit details
    Browse the repository at this point in the history
  16. Rollup merge of rust-lang#130764 - compiler-errors:inherent, r=estebank

    Separate collection of crate-local inherent impls from error tracking
    
    rust-lang#119895 changed the return type of the `crate_inherent_impls` query from `CrateInherentImpls` to `Result<CrateInherentImpls, ErrorGuaranteed>` to avoid needing to use the non-parallel-friendly `track_errors()` to track if an error was reporting from within the query... This was mostly fine until rust-lang#121113, which stopped halting compilation when we hit an `Err(ErrorGuaranteed)` in the `crate_inherent_impls` query.
    
    Thus we proceed onwards to typeck, and since a return type of `Result<CrateInherentImpls, ErrorGuaranteed>` means that the query can *either* return one of "the list inherent impls" or "error has been reported", later on when we want to assemble method or associated item candidates for inherent impls, we were just treating any `Err(ErrorGuaranteed)` return value as if Rust had no inherent impls defined anywhere at all! This leads to basically every inherent method call failing with an error, lol, which was reported in rust-lang#127798.
    
    This PR changes the `crate_inherent_impls` query to return `(CrateInherentImpls, Result<(), ErrorGuaranteed>)`, i.e. returning the inherent impls collected *and* whether an error was reported in the query itself. It firewalls the latter part of that query into a new `crate_inherent_impls_validity_check` just for the `ensure()` call.
    
    This fixes rust-lang#127798.
    tgross35 authored Sep 24, 2024
    Configuration menu
    Copy the full SHA
    3b45f8f View commit details
    Browse the repository at this point in the history
  17. Rollup merge of rust-lang#130788 - tgross35:memchr-pinning, r=Noratri…

    …eb,Mark-Simulacrum
    
    Pin memchr to 2.5.0 in the library rather than rustc_ast
    
    The latest versions of `memchr` experience LTO-related issues when compiling for windows-gnu [1], so needs to be pinned. The issue is present in the standard library.
    
    `memchr` has been pinned in `rustc_ast`, but since the workspace was recently split, this pin no longer has any effect on library crates.
    
    Resolve this by adding `memchr` as an _unused_ dependency in `std`, pinned to 2.5. Additionally, remove the pin in `rustc_ast` to allow non-library crates to upgrade to the latest version.
    
    Link: rust-lang#127890 [1]
    
    try-job: x86_64-mingw
    try-job: x86_64-msvc
    tgross35 authored Sep 24, 2024
    Configuration menu
    Copy the full SHA
    9bdef3c View commit details
    Browse the repository at this point in the history
  18. Rollup merge of rust-lang#130789 - aviramha:add_inprogress, r=Noratrieb

    add InProgress ErrorKind gated behind io_error_inprogress feature
    
    Follow up on rust-lang/libs-team#92 (comment)
    tgross35 authored Sep 24, 2024
    Configuration menu
    Copy the full SHA
    147aa86 View commit details
    Browse the repository at this point in the history
  19. Rollup merge of rust-lang#130793 - jieyouxu:mention-crashes-verbose, …

    …r=matthiaskrgr
    
    Mention `COMPILETEST_VERBOSE_CRASHES` on crash test failure
    
    Fixes rust-lang#130776.
    
    r? `@matthiaskrgr` (or compiler/bootstrap)
    tgross35 authored Sep 24, 2024
    Configuration menu
    Copy the full SHA
    7de1082 View commit details
    Browse the repository at this point in the history
  20. Rollup merge of rust-lang#130798 - lukas-code:doc-stab, r=notriddle

    rustdoc: inherit parent's stability where applicable
    
    It is currently not possible for a re-export to have a different stability (rust-lang#30827). Therefore the standard library uses a hack when moving items like `std::error::Error` or `std::net::IpAddr` into `core` by marking the containing module (`core::error` / `core::net`) as unstable or stable in a later version than the items the module contains.
    
    Previously, rustdoc would always show the *stability as declared* for an item rather than the *stability as publicly reachable* (i.e. the features required to actually access the item), which could be confusing when viewing the docs. This PR changes it so that we show the stability of the first unstable parent or the most recently stabilized parent instead, to hopefully make things less confusing.
    
    fixes rust-lang#130765
    
    screenshots:
    ![error in std](https://github.com/user-attachments/assets/2ab9bdb9-ed81-4e45-a832-ac7d3ba1be3f) ![error in core](https://github.com/user-attachments/assets/46f46182-5642-4ac5-b92e-0b99a8e2496d)
    tgross35 authored Sep 24, 2024
    Configuration menu
    Copy the full SHA
    9737f92 View commit details
    Browse the repository at this point in the history