Skip to content

Rollup of 7 pull requests - #165454

Closed
JonathanBrouwer wants to merge 19 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-12kFXDC
Closed

JonathanBrouwer wants to merge 19 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-12kFXDC

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

adamgemmell and others added 19 commits October 23, 2026 12:05
Method to get a ordering key on `Discriminant`
Based on reviewer feedback.
…ation, r=lqd,bjorn3

Apply the Cortex-A53 843419 CC mitigation to aarch64 targets

This PR sets out a strategy for more consistently applying the mitigation for Cortex A53 Errata 843419 to aarch64 targets. See rust-lang#118095 for more detailed background information on the mitigation itself.

In the last stable release rust-lang#155453 applied the linker flag for this mitigation (`--fix-cortex-a53-843419`) to aarch64 linux gnu & musl targets, but this raised two bugs:

- rust-lang#161486 - old versions of LD (before 2.26 in 2016 I believe) do not support the mitigation and this form of the flag cannot be disabled. The LD version requirement was not detailed in the release notes.
- rust-lang#164275 - large build time regression. When LD [is patched](https://inbox.sourceware.org/binutils/20260806054354.27168-1-ktkachov@nvidia.com/) to allow disabling the mitigation, having the mitigation enabled results in a large regression in link time. This is particularly bad for large Rust projects (+327% debug build time for deno) as Rust defaults to `-Zfunction-sections=yes` for most targets, while Clang defaults to -`fno-function-sections`. Again, the mitigation cannot be disabled.

This PR does a few things to fix those:

- Apply the mitigation by default for all aarch64 targets when using a CC linker driver
- Applying the linker driver variant of the flag `-mfix-cortex-a53-843419`, which can be overridden with `-mno-fix-cortex-a53-843419`
- Attempt an automatic linking retry without the mitigation when the linker or linker driver reports that it isn't aware of the flag. This is particularly an issue with Clang which only [added the mitigation control flag](llvm/llvm-project#143915) in v21.

If a target wishes it can force the mitigation enabled with the linker version of the flag, as [fuchsia](https://github.com/rust-lang/rust/blob/afe686de2708699b69dd31ed14be326f4e95edfc/compiler/rustc_target/src/spec/targets/aarch64_unknown_fuchsia.rs#L24), [nuttx](https://github.com/rust-lang/rust/blob/afe686de2708699b69dd31ed14be326f4e95edfc/compiler/rustc_target/src/spec/targets/aarch64_unknown_nuttx.rs#L21) and the [bare-metal target](https://github.com/rust-lang/rust/blob/afe686de2708699b69dd31ed14be326f4e95edfc/compiler/rustc_target/src/spec/targets/aarch64_unknown_none.rs#L21) do, though this limits the versions of LD that can be used.

As mentioned above in the reproduction guide in rust-lang#164275 this mitigation results in a large build time regression for rustc crates with more than 128MiB. I haven't reproduced the findings, but the repo does contain a setup for running all the benchmarks detailed. For many users this change won't have an effect as the mitigation is forced on anyway by unpatched versions of LD, or builds of GCC which enable the mitigation (Debian's GCC does this). For users this PR does affect, switching the target to LLD I expect would significantly reduce this compile time regression.

An interesting footnote, Clang does not enable this mitigation by default at all for Linux targets, but does for Android.

r? @lqd
…gate, r=JonathanBrouwer

Add `Forget` trait feature gate

r? jonathanbrouwer

Add an unstable feature gate for the `Forget` trait. Creating the feature gate allows experimentation with its implementation. Note that this does not commit to anything w.r.t. stabilization of the forget trait. A feature gate can be removed at any time.

Part of rust-lang#165370
…anBrouwer

Revert FCW on lint attributes on macro calls

In porting the lint attributes, it also added a fcw if they're used on a macro invocation. However t is something that has meaning, so revert the FCW.

```rust
// edition ..2021
macro_rules! wat {
    ($($tt:tt)*) => {}
}

fn main(){
    #[deny(keyword_idents_2024)]
    wat!(gen);
    //~^ ERROR `gen` is a keyword in the 2024 edition
    //~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024!
}
```

So I don't think this should be a fcw.

Similarly, clippy currently does this:
```rust
fn main() {
    #[deny(clippy::nonstandard_macro_braces)]
    println! {};
}
```
```rust
error: use of irregular braces for `println!` macro
 --> src/main.rs:3:5
  |
3 |     println! {};
  |     ^^^^^^^^^^^ help: consider writing: `println!()`
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/main/index.html#nonstandard_macro_braces
note: the lint level is defined here
 --> src/main.rs:2:12
  |
2 |     #[deny(clippy::nonstandard_macro_braces)]
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: the `deny` attribute cannot be used on macro calls
 --> src/main.rs:2:7
  |
2 |     #[deny(clippy::nonstandard_macro_braces)]
  |       ^^^^
3 |     println! {};
  |
  = help: the `deny` attribute can be applied to associated consts, associated types, break expressions, const parameters, constants, crates, data types, enum variants, extern crates, for loops, foreign modules, foreign statics, function params, functions, global asms, impl blocks, lifetime parameters, loops, macro defs, match arms, modules, pattern fields, statics, struct fields, trait aliases, traits, type aliases, type parameters, use statements, and while loops
  = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
  = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute
  = note: `#[warn(unused_attributes)]` (part of `#[warn(unused)]`) on by default
```
Update books

## rust-lang/book

1 commits in 1500248d8f230566e4ec9f27fcbb8fe9e2898ab1..2771df165f092a4fbb9f46b5b2e7450f19010adb
2026-10-28 18:58:38 UTC to 2026-10-28 18:58:38 UTC

- Upgrade to rust 1.99.1 (rust-lang/book#4861)

## rust-embedded/book

1 commits in 0789b0f29e73ecb91213cac10ad0eec1b9333770..637b4a0244e16ec391a60184ae0c86b550ffc24b
2026-10-27 19:19:19 UTC to 2026-10-27 19:19:19 UTC

- Replace cty:: with core::ffi:: (rust-embedded/book#422)

## rust-lang/reference

1 commits in 2dafab96d919d6ab2884488e970bf95610ff83eb..3989fe91f1a601b51684a582ad17b2503f221787
2026-10-20 21:23:48 UTC to 2026-10-20 21:23:48 UTC

- Add documentation for `MaybeUninit<T>` (rust-lang/reference#2393)
…kruppe

Update amdgpu datalayout for LLVM 24

It changed in llvm/llvm-project#209746
…clarfonthey

Add `Discriminant::ord`

ACP: rust-lang/libs-team#925
Tracking Issue: rust-lang#165438
Alternative To: rust-lang#164231

This is an implementation for Option 2 from rust-lang#165438. This provides a new method `Discriminant::ord` which returns a new type, `DiscriminantOrd`, suitable for key comparison. This follows a philosophy similar to that of `Path::display` for providing functional through standard traits gated behind a wrapper. I've elected for the return type of `Discriminant::ord` to be named as was requested during the T-Libs meeting proposing this option, and I've chosen to implement all traits currently implemented by `Discriminant`, this could be reduced.

In comparison to rust-lang#164231, this has the advantage of allowing the storage of the discriminant in a structure and the deriving a `Partial/Ord` implementation.

# Notes

* No AI tooling of any kind was used during the creation of this PR.
* Chose the name `ord` as that appeared to be the generally preferred option, but alternatives may include `unstable_ord`, etc.
Add an unstable option to increase the chain depth of the next solver overflow FCW

This will help us debug the causes of overflows. See rust-lang#159228 (comment)

r? @ShoyuVanilla
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Nov 4, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Nov 4, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Member Author

@bors r+ p=5 force

Trying commonly failed jobs
@bors try jobs=dist-various-1,test-various,test-x86_64-gnu-aux,test-x86_64-msvc-1,test-aarch64-apple-1,test-aarch64-apple-2,test-x86_64-mingw-1,test-i686-msvc,test-armhf-gnu,test-x86_64-gnu-llvm-22-3,test-aarch64-msvc-2

@rust-bors

rust-bors Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

📌 Commit dc0c9bd has been approved by JonathanBrouwer

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Nov 4, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 4, 2026
Rollup of 7 pull requests


try-job: dist-various-1
try-job: test-various
try-job: test-x86_64-gnu-aux
try-job: test-x86_64-msvc-1
try-job: test-aarch64-apple-1
try-job: test-aarch64-apple-2
try-job: test-x86_64-mingw-1
try-job: test-i686-msvc
try-job: test-armhf-gnu
try-job: test-x86_64-gnu-llvm-22-3
try-job: test-aarch64-msvc-2
@rust-bors

This comment has been minimized.

@rust-bors

rust-bors Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 71abefe (71abefed14e84d60c602a92b0993c3342c8ad7ea)
Base parent: 2d20b42 (2d20b42b883dcfc014f3c2c56081eeb6091c2179)

@rust-bors

rust-bors Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

⌛ Testing commit dc0c9bd with merge f1c7f70...

Workflow: https://github.com/rust-lang/rust/actions/runs/41867048071

rust-bors Bot pushed a commit that referenced this pull request Nov 4, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #164752 (Apply the Cortex-A53 843419 CC mitigation to aarch64 targets )
 - #165376 (Add `Forget` trait feature gate)
 - #165257 (Revert FCW on lint attributes on macro calls)
 - #165364 (Update books)
 - #165424 (Update amdgpu datalayout for LLVM 24)
 - #165443 (Add `Discriminant::ord`)
 - #165445 (Add an unstable option to increase the chain depth of the next solver overflow FCW)
@rust-bors rust-bors Bot 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 Nov 4, 2026
@rust-bors

rust-bors Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved due to being closed.

Auto build was cancelled due to the PR being closed. Cancelled workflows:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-run-make Area: port run-make Makefiles to rmake.rs 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-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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants