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 16 pull requests #126319

Merged
merged 38 commits into from
Jun 12, 2024
Merged

Rollup of 16 pull requests #126319

merged 38 commits into from
Jun 12, 2024

Commits on Apr 2, 2024

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

Commits on Apr 26, 2024

  1. Add "safety" comment

    mgeier committed Apr 26, 2024
    Configuration menu
    Copy the full SHA
    22319bf View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4df1303 View commit details
    Browse the repository at this point in the history
  3. Add missing .into_iter()

    mgeier committed Apr 26, 2024
    Configuration menu
    Copy the full SHA
    30b676c View commit details
    Browse the repository at this point in the history

Commits on Apr 29, 2024

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

Commits on May 31, 2024

  1. NVPTX: Avoid PassMode::Direct for C ABI

    Kjetil Kjeka committed May 31, 2024
    Configuration menu
    Copy the full SHA
    14348d9 View commit details
    Browse the repository at this point in the history
  2. NVPTX:_Especially add the DoubleI32 struct as a nvptx abi test case s…

    …ince it was used as an example when discussing possible problems
    Kjetil Kjeka committed May 31, 2024
    Configuration menu
    Copy the full SHA
    a49fe0a View commit details
    Browse the repository at this point in the history

Commits on Jun 4, 2024

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

Commits on Jun 10, 2024

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

Commits on Jun 11, 2024

  1. Configuration menu
    Copy the full SHA
    1462f3d View commit details
    Browse the repository at this point in the history
  2. Simplify [T; N]::try_map signature

    People keep making fun of this signature for being so gnarly.
    Associated type bounds lend it a much simpler scribbling.
    ChangeOutputType can also come along for the ride.
    workingjubilee committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    d695544 View commit details
    Browse the repository at this point in the history
  3. Make issue-122805.rs big endian compatible

    Instead of not generating the function at all on big endian (which
    makes the CHECK lines fail), instead use to_le() on big endian,
    so that we essentially perform a bswap for both endiannesses.
    nikic committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    26fa5c2 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    751143e View commit details
    Browse the repository at this point in the history
  5. Make storage-live.rs robust against rustc internal changes.

    Currently it can be made to fail by rearranging code within
    `compiler/rustc_mir_transform/src/lint.rs`.
    nnethercote committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    1a60597 View commit details
    Browse the repository at this point in the history
  6. Update a cranelift patch file for formatting changes.

    PR rust-lang#125443 will reformat all the use declarations in the repo. This
    would break a patch kept in `rustc_codegen_cranelift` that gets applied
    to `library/std/src/sys/pal/windows/rand.rs`.
    
    So this commit formats the use declarations in
    `library/std/src/sys/pal/windows/rand.rs` in advance of rust-lang#125443 and
    updates the patch file accordingly.
    
    The motivation is that rust-lang#125443 is a huge change and we want to get
    fiddly little changes like this out of the way so it can be nothing more
    than an `x fmt --all`.
    nnethercote committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    7e7da49 View commit details
    Browse the repository at this point in the history

Commits on Jun 12, 2024

  1. For E0277 suggest adding Result return type for function which usin…

    …g QuesionMark `?` in the body.
    surechen committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    0b3fec9 View commit details
    Browse the repository at this point in the history
  2. Use tidy to sort crate attributes for all compiler crates.

    We already do this for a number of crates, e.g. `rustc_middle`,
    `rustc_span`, `rustc_metadata`, `rustc_span`, `rustc_errors`.
    
    For the ones we don't, in many cases the attributes are a mess.
    - There is no consistency about order of attribute kinds (e.g.
      `allow`/`deny`/`feature`).
    - Within attribute kind groups (e.g. the `feature` attributes),
      sometimes the order is alphabetical, and sometimes there is no
      particular order.
    - Sometimes the attributes of a particular kind aren't even grouped
      all together, e.g. there might be a `feature`, then an `allow`, then
      another `feature`.
    
    This commit extends the existing sorting to all compiler crates,
    increasing consistency. If any new attribute line is added there is now
    only one place it can go -- no need for arbitrary decisions.
    
    Exceptions:
    - `rustc_log`, `rustc_next_trait_solver` and `rustc_type_ir_macros`,
      because they have no crate attributes.
    - `rustc_codegen_gcc`, because it's quasi-external to rustc (e.g. it's
      ignored in `rustfmt.toml`).
    nnethercote committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    75b164d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    af04418 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f2cce98 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    d79aeaf View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    bbc5509 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    45a9bd5 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#123374 - mgeier:doc-slice-from-raw-parts, r…

    …=scottmcm
    
    DOC: Add FFI example for slice::from_raw_parts()
    
    For some discussion, see https://users.rust-lang.org/t/missing-guidance-on-converting-ffi-ptr-length-to-slice/106048
    
    See also rust-lang#120608.
    workingjubilee committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    8d3b9a1 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#124514 - michaelwoerister:zero-disambiguato…

    …r-demangling-recommendation, r=davidtwco
    
    Recommend to never display zero disambiguators when demangling v0 symbols
    
    This PR extends the [v0 symbol mangling documentation](https://doc.rust-lang.org/rustc/symbol-mangling/v0.html) with the strong recommendation that demanglers should never display zero-disambiguators, especially when dealing with `crate-root`.
    
    Being able to rely on `C3foo` to be rendered as `foo` (i.e. without explicit disambiguator value) rather than as `foo[0]` allows the compiler to encode things like new basic types in a backward compatible way. This idea has been originally proposed by `@eddyb` in [the discussion around supporting `f16` and `f128` in the v0 mangling scheme](rust-lang#122106). It is a generally useful mechanism for supporting a certain class of new elements in the v0 mangling scheme in a backward compatible way (whether as a temporary workaround until downstream tooling has picked up grammar changes or as a permanent encoding).
    
    cc `@tgross35`
    workingjubilee committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    969056d View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#125978 - fmease:cleanup-hir-ty-lowering-con…

    …solidate-assoc-item-access-checking, r=davidtwco
    
    Cleanup: HIR ty lowering: Consolidate the places that do assoc item probing & access checking
    
    Use `probe_assoc_item` (for hygienically probing an assoc item and checking if it's accessible wrt. visibility and stability) for assoc item constraints, too, not just for assoc type paths and make the privacy error translatable.
    workingjubilee committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    e7b07ea View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#125980 - kjetilkjeka:nvptx_remove_direct_pa…

    …ssmode, r=davidtwco
    
    Nvptx remove direct passmode
    
    This PR does what should have been done in rust-lang#117671. That is fully avoid using the `PassMode::Direct` for `extern "C" fn` for `nvptx64-nvidia-cuda` and enable the compatibility test. `@RalfJung` [pointed me in the right direction](rust-lang#117480 (comment)) for solving this issue.
    
    There are still some ABI bugs after this PR is merged. These ABI tests are created based on what is actually correct, and since they continue passing with even more of them enabled things are improving. I don't have the time to tackle all the remaining issues right now, but I think getting these improvements merged is very valuable in themselves and plan to tackle more of them long term.
    
    This also doesn't remove the use of `PassMode::Direct` for `extern "ptx-kernel" fn`. This was also not trivial to make work. And since the ABI is hidden behind an unstable feature it's less urgent.
    
    I don't know if it's correct to request `@RalfJung` as a reviewer (due to team structures), but he helped me a lot to figure out this stuff. If that's not appropriate then `@davidtwco` would be a good candidate since he know about this topic from rust-lang#117671
    
    r​? `@RalfJung`
    workingjubilee committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    322af5c View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#126187 - surechen:fix_125997, r=oli-obk

    For E0277 suggest adding `Result` return type for function when using QuestionMark `?` in the body.
    
    Adding suggestions for following function in E0277.
    
    ```rust
    fn main() {
        let mut _file = File::create("foo.txt")?;
    }
    ```
    
    to
    
    ```rust
    fn main() -> Result<(), Box<dyn std::error::Error>> {
        let mut _file = File::create("foo.txt")?;
    
        return Ok(());
    }
    ```
    
    According to the issue rust-lang#125997, only the code examples in the issue are targeted, but the issue covers a wider range of situations.
    
    <!--
    If this PR is related to an unstable feature or an otherwise tracked effort,
    please link to the relevant tracking issue here. If you don't know of a related
    tracking issue or there are none, feel free to ignore this.
    
    This PR will get automatically assigned to a reviewer. In case you would like
    a specific user to review your work, you can assign it to them by using
    
        r​? <reviewer name>
    -->
    workingjubilee committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    519a322 View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#126210 - lolbinarycat:ptr_doctest_assert, r…

    …=workingjubilee
    
    docs(core): make more const_ptr doctests assert instead of printing
    
    improves on rust-lang#124669
    workingjubilee committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    3a37293 View commit details
    Browse the repository at this point in the history
  14. Rollup merge of rust-lang#126249 - workingjubilee:simplify-try-map-si…

    …gnature, r=scottmcm
    
    Simplify `[T; N]::try_map` signature
    
    People keep making fun of this signature for being so gnarly.
    Associated type bounds admit a much simpler scribbling.
    
    r? ````@scottmcm````
    workingjubilee committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    4de77b6 View commit details
    Browse the repository at this point in the history
  15. Rollup merge of rust-lang#126256 - ferrocene:lw-target-subst, r=alber…

    …tlarsan68
    
    Add {{target}} substitution to compiletest
    
    In ferrocene we have ui tests testing the cli interface of the compiler, one of which tests the `--target` flag. To be able to run this on all targets we require a way to specify a valid target in the `compile-flags` directive that is target independent, as otherwise we can only run the test against the one target we choose to supply in the flags. See https://github.com/ferrocene/ferrocene/blob/383cbc80f4e85859a4055f121f15dac329908346/tests/ui/ferrocene/compiler-arguments/target/target.rs
    
    We figured the project might be able to make use of this substitution as well in the future.
    
    try-job: dist-x86_64-msvc
    workingjubilee committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    3997b62 View commit details
    Browse the repository at this point in the history
  16. Rollup merge of rust-lang#126263 - nikic:s390x-codegen-test-fix, r=ji…

    …eyouxu
    
    Make issue-122805.rs big endian compatible
    
    Instead of not generating the function at all on big endian (which makes the CHECK lines fail), instead use to_le() on big endian, so that we essentially perform a bswap for both endiannesses.
    workingjubilee committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    0ed474a View commit details
    Browse the repository at this point in the history
  17. Rollup merge of rust-lang#126281 - ChrisDenton:env, r=jhpratt

    set_env: State the conclusion upfront
    
    People tend to skim or skip over long explanations so we should be very upfront that `set_var` and `remove_var` are being made unsafe for a very good reason.
    
    This is just the conclusion restated almost verbatim but earlier in the docs and separated from the explanation:
    
    https://github.com/rust-lang/rust/blob/0c960618b56f662d933e8b864cd9632a99174e87/library/std/src/env.rs#L338-L339
    
    I think this may help with people who may not be entirely comfortable with rust-lang#125937 being rejected.
    workingjubilee committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    0805ab4 View commit details
    Browse the repository at this point in the history
  18. Rollup merge of rust-lang#126286 - nnethercote:fix-test-LL-CC, r=lqd

    Make `storage-live.rs` robust against rustc internal changes.
    
    Currently it can be made to fail by rearranging code within `compiler/rustc_mir_transform/src/lint.rs`.
    
    This is a precursor to rust-lang#125443.
    
    r? ```@lqd```
    workingjubilee committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    6cde179 View commit details
    Browse the repository at this point in the history
  19. Rollup merge of rust-lang#126287 - nnethercote:reformat-cranelift-pat…

    …ch, r=bjorn3
    
    Update a cranelift patch file for formatting changes.
    
    PR rust-lang#125443 will reformat all the use declarations in the repo. This would break a patch kept in `rustc_codegen_cranelift` that gets applied to `library/std/src/sys/pal/windows/rand.rs`.
    
    So this commit formats the use declarations in `library/std/src/sys/pal/windows/rand.rs` in advance of rust-lang#125443 and updates the patch file accordingly.
    
    The motivation is that rust-lang#125443 is a huge change and we want to get fiddly little changes like this out of the way so it can be nothing more than an `x fmt --all`.
    
    r? ``@bjorn3``
    workingjubilee committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    ac73965 View commit details
    Browse the repository at this point in the history
  20. Rollup merge of rust-lang#126301 - nnethercote:sort-crate-attributes,…

    … r=davidtwco
    
    Use `tidy` to sort crate attributes for all compiler crates.
    
    We already do this for a number of crates, e.g. `rustc_middle`, `rustc_span`, `rustc_metadata`, `rustc_span`, `rustc_errors`.
    
    For the ones we don't, in many cases the attributes are a mess.
    - There is no consistency about order of attribute kinds (e.g. `allow`/`deny`/`feature`).
    - Within attribute kind groups (e.g. the `feature` attributes), sometimes the order is alphabetical, and sometimes there is no particular order.
    - Sometimes the attributes of a particular kind aren't even grouped all together, e.g. there might be a `feature`, then an `allow`, then another `feature`.
    
    This commit extends the existing sorting to all compiler crates, increasing consistency. If any new attribute line is added there is now only one place it can go -- no need for arbitrary decisions.
    
    Exceptions:
    - `rustc_log`, `rustc_next_trait_solver` and `rustc_type_ir_macros`, because they have no crate attributes.
    - `rustc_codegen_gcc`, because it's quasi-external to rustc (e.g. it's ignored in `rustfmt.toml`).
    
    r? `@davidtwco`
    workingjubilee committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    36e828f View commit details
    Browse the repository at this point in the history
  21. Rollup merge of rust-lang#126305 - workingjubilee:fix-os-string-to-st…

    …ring-utf8-invariant, r=joboet
    
    Make PathBuf less Ok with adding UTF-16 then `into_string`
    
    Fixes rust-lang#126291 which is, as far as I can tell, a regression introduced by rust-lang#96869.
    
    try-job: x86_64-msvc
    workingjubilee committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    3862f01 View commit details
    Browse the repository at this point in the history
  22. Rollup merge of rust-lang#126310 - GuillaumeGomez:migrate-run-make-pr…

    …efer-rlib, r=Kobzol
    
    Migrate run make prefer rlib
    
    Part of rust-lang#121876.
    
    r? `@jieyouxu`
    workingjubilee committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    6f4f405 View commit details
    Browse the repository at this point in the history
  23. Rollup merge of rust-lang#126314 - lcnr:fix-relnotes, r=pietroalbini

    fix RELEASES: we do not support upcasting to auto traits
    
    rust-lang#119338 does not actually support casts from `dyn Trait` to `dyn Auto`, only from `dyn Trait` to `dyn Trait + Auto`. The following test does not compile
    
    ```rust
    trait Trait: Send {}
    impl<T: Send> Trait for T {}
    
    fn foo() {
        let x: &i32 = &1;
        let y = x as &dyn Trait as &dyn Send;
    }
    ```
    it actually also doesn't compile with `feature(trait_upcasting)`, opened rust-lang#126313 for that
    
    r? `@Mark-Simulacrum` `@cuviper`
    workingjubilee committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    0a52849 View commit details
    Browse the repository at this point in the history