Skip to content

Rollup of 15 pull requests #142971

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

Closed
wants to merge 102 commits into from

Conversation

workingjubilee
Copy link
Member

@workingjubilee workingjubilee commented Jun 24, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

bjorn3 and others added 30 commits May 25, 2025 18:51
And move passing it to the linker to the driver code.
This deduplicates some code between codegen backends and may in the
future allow adding extra metadata that is only known at link time.
 - remove unused `llvm.aarch64.neon.frintn` from cg_clif
…bzol

Merge `compiler-builtins` as a Josh subtree

Use the Josh [1] utility to add `compiler-builtins` as a subtree, which
will allow us to stop using crates.io for updates. This is intended to
help resolve some problems when unstable features change and require
code changes in `compiler-builtins`, which sometimes gets trapped in a
bootstrap cycle.

This was done using `josh-filter` built from the r24.10.04 tag:

    git fetch https://github.com/rust-lang/compiler-builtins.git 233434412fe7eced8f1ddbfeddabef1d55e493bd
    josh-filter ":prefix=library/compiler-builtins" FETCH_HEAD
    git merge --allow-unrelated FILTERED_HEAD

The HEAD in the `compiler-builtins` repository is 233434412f ("fix an if
statement that can be collapsed").

[1]: https://github.com/josh-project/josh
…=bjorn3

Replace ad-hoc ABI "adjustments" with an `AbiMap` to `CanonAbi`

Our `conv_from_spec_abi`, `adjust_abi`, and `is_abi_supported` combine to give us a very confusing way of reasoning about what _actual_ calling convention we want to lower our code to and whether we want to compile the resulting code at all. Instead of leaving this code as a miniature adventure game in which someone tries to combine stateful mutations into a Rube Goldberg machine that will let them escape the maze and arrive at the promised land of codegen, we let `AbiMap` devour this complexity. Once you have an `AbiMap`, you can answer which `ExternAbi`s will lower to what `CanonAbi`s (and whether they will lower at all).

Removed:
- `conv_from_spec_abi` replaced by `AbiMap::canonize_abi`
- `adjust_abi` replaced by same
- `Conv::PreserveAll` as unused
- `Conv::Cold` as unused
- `enum Conv` replaced by `enum CanonAbi`

target-spec.json changes:
- If you have a target-spec.json then now your "entry-abi" key will be specified in terms of one of the `"{abi}"` strings Rust recognizes, e.g.
```json
    "entry-abi": "C",
    "entry-abi": "win64",
    "entry-abi": "aapcs",
```
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#137725 (Add `iter` macro)
 - rust-lang#141455 (std: abort the process on failure to allocate a TLS key)
 - rust-lang#141569 (Replace ad-hoc ABI "adjustments" with an `AbiMap` to `CanonAbi`)
 - rust-lang#141698 (Use the informative error as the main const eval error message)
 - rust-lang#141925 (Remove bootstrap cfgs from library/)
 - rust-lang#141943 (Remove pre-expansion AST stats.)
 - rust-lang#141945 (Remove `Path::is_ident`.)
 - rust-lang#141957 (Add missing `dyn` keywords to tests that do not test for them Part 2)

r? `@ghost`
`@rustbot` modify labels: rollup
It was already available as a generic parameter anyway, and it's not like we'll ever put a tag in the 5-billionth field.
As suggested by Ralf in 142005.
…-obk

Update `InterpCx::project_field` to take `FieldIdx`

As suggested by Ralf in rust-lang#142005 (comment)
In PR 90877 T-lang decided not to remove `intrinsics::pref_align_of`.
However, the intrinsic and its supporting code
1.  is a nightly feature, so can be removed at compiler/libs discretion
2.  requires considerable effort in the compiler to support, as it
    necessarily complicates every single site reasoning about alignment
3.  has been justified based on relevance to codegen, but it is only a
    requirement for C++ (not C, not Rust) stack frame layout for AIX,
    in ways Rust would not consider even with increased C++ interop
4.  is only used by rustc to overalign some globals, not correctness
5.  can be adequately replaced by other rules for globals, as it mostly
    affects alignments for a few types under 16 bytes of alignment
6.  has only one clear benefactor: automating C -> Rust translation
    for GNU extensions like `__alignof`
7.  such code was likely intended to be `alignof` or `_Alignof`,
    because the GNU extension is a "false friend" of the C keyword,
    which makes the choice to support such a mapping very questionable
8.  makes it easy to do incorrect codegen in the compiler by its mere
    presence as usual Rust rules of alignment (e.g. `size == align * N`)
    do not hold with preferred alignment

The implementation is clearly damaging the code quality of the compiler.
Thus it is within the compiler team's purview to simply rip it out.
If T-lang wishes to have this intrinsic restored for c2rust's benefit,
it would have to use a radically different implementation that somehow
does not cause internal incorrectness.

Until then, remove the intrinsic and its supporting code, as one tool
and an ill-considered GCC extension cannot justify risking correctness.

Because we touch a fair amount of the compiler to change this at all,
and unfortunately the duplication of AbiAndPrefAlign is deep-rooted,
we keep an "AbiAlign" type which we can wean code off later.
Also reduce visibility of a function
…, r=fmease

Also emit suggestions for usages in the `non_upper_case_globals` lint

This PR adds suggestions for all the usages of the renamed item in the warning of the  `non_upper_case_globals` lint.

Fixes rust-lang#124061
…ifiers-cleanup, r=petrochenkov

mbe: Clean up code with non-optional `NonterminalKind`

Since [rust-lang#128425], the fragment specifier is unconditionally required in all
editions. This means `NonTerminalKind` no longer needs to be optional,
as we can reject this code during the expansion of `macro_rules!` rather
than handling it throughout the code. Do this cleanup here.

[rust-lang#128425]: rust-lang#128425
rustc_session: Add a structure for keeping both explicit and default sysroots

Also avoid creating and cloning sysroot unnecessarily.

Implements the suggestion from rust-lang#142089 (comment).
r? `@bjorn3`
…iler-errors

Emit a single error when importing a path with `_`

When encountering `use _;`, `use _::*'` or similar, do not emit two errors for that single mistake. This also side-steps the issue of resolve errors suggesting adding a crate named `_` to `Cargo.toml`.

Fix rust-lang#142662.
…=jieyouxu

Enable reproducible-build-2 for Windows MSVC

Works with MSVC if instructing the linker to avoid timestamps and deleting the PDB between compilations.

Addresses item in rust-lang#128602

---

try-job: x86_64-mingw-*
try-job: x86_64-msvc-*
try-job: i686-msvc-*
…etrochenkov

Lazy init diagnostics-only local_names in borrowck

`local_names` is not used during successful compilation, so not initializing it saves a little bit of work.

I've also made it accessible only from the diagnostics module to make it clearer that the names are from `var_debug_info` which is technically optional and could be absent.
Add impl_trait_in_bindings tests from rust-lang#61773

This adds the [three test cases](rust-lang#61773 (comment)) from the rust-lang#61773 as was suggested by `@lcnr.`

I have merged the first two cases into one, named as `region-lifetimes.rs`

r? `@lcnr`

Closes rust-lang#61773
…etrochenkov

Tweak `-Zmacro-stats` measurement.

It currently reports net size, i.e. size(output) - size(input). After some use I think this is sub-optimal, and it's better to just report size(output). Because for derive macros the input size is always 1, and for attribute macros it's almost always 1.

r? `@petrochenkov`
Couple of test suite fixes for cg_clif

Most of these are required for getting the test suite running with panic=unwind for cg_clif.
…bjorn3

Subtree sync for rustc_codegen_cranelift

The main highlight this time is a Cranelift update.

r? `@ghost`

`@rustbot` label +A-codegen +A-cranelift +T-compiler
…ink-to-rust-va-list-fn_test, r=jieyouxu

[RTE-497] Ignore `c-link-to-rust-va-list-fn` test on SGX platform

rust-lang#141856 enables using the runner defined in bootstrap.toml to execute run-make tests. A test was added for this feature that compiles a Rust library and C code, links them together and passes the result to the runner. Unfortunately, that's not sufficient for the SGX platform; x86 machine code cannot be directly executed. This PR fixes the issue by disabling this test for SGX.
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-run-make Area: port run-make Makefiles to rmake.rs A-tidy Area: The tidy tool A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Jun 24, 2025
@workingjubilee
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Jun 24, 2025

📌 Commit 2c86c70 has been approved by workingjubilee

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 24, 2025
@workingjubilee
Copy link
Member Author

Oops. Should have triaged last PR first.

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 24, 2025
@workingjubilee workingjubilee deleted the rollup-fh64sjv branch June 24, 2025 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-run-make Area: port run-make Makefiles to rmake.rs A-tidy Area: The tidy tool A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.