Skip to content

Rollup of 15 pull requests#155941

Merged
rust-bors[bot] merged 85 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-Ak66iXR
Apr 28, 2026
Merged

Rollup of 15 pull requests#155941
rust-bors[bot] merged 85 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-Ak66iXR

Conversation

@JonathanBrouwer
Copy link
Copy Markdown
Contributor

@JonathanBrouwer JonathanBrouwer commented Apr 28, 2026

Successful merges:

r? @ghost

Create a similar rollup

calebzulawski and others added 30 commits January 28, 2026 00:56
Following rust-lang#89117, rustc has defaulted to the v0 mangling
scheme by default (since Nov 20th 2025). This surfaced two bugs:

- rust-lang#138261 was a small ICE (found via fuzzing) where an
  implementation-internal namespace was missing for global assembly -
  this occurs with names instantiated within global assembly (that can
  happen inside constants)

- rust-lang#134479 only occurs with unstable `generic_const_exprs`

Since there have been three-to-four months for users to find bugs with
this mangling scheme on nightly, that the scheme has been waiting many
years to be stabilised, and has been used successfully internally at
Microsoft, Meta and Google for many years, this patch proposes
stabilising the v0 mangling scheme on stable.

This patch does not propose removing the legacy mangling, it will remain
usable on nightly as an escape-hatch if there are remaining bugs (though
admittedly it would require switching to nightly for those on stable) -
it is anticipated that this would be unlikely given current testing
undergone by v0. Legacy mangling can be removed in another follow-up.
Add `bounds::FloatPrimitive`

Exhaustive float pattern match

Fix GCC

use span bugs
This will become the default soon.
…tgross35,RalfJung

Merge `fabsf16/32/64/128` into `fabs::<F>`

Following [a small conversation on Zulip](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Float.20intrinsics/with/521501401) (and because I'd be interested in starting to contribute on Rust), I thought I'd give a try at merging the float intrinsics :)

This PR just merges `fabsf16`, `fabsf32`, `fabsf64`, `fabsf128`, as it felt like an easy first target.

Notes:
- I'm opening the PR for one intrinsic as it's probably easier if the shift is done one intrinsic at a time, but let me know if you'd rather I do several at a time to reduce the number of PRs.
- Currently this PR increases LOCs, despite being an attempt at simplifying the intrinsics/compilers. I believe this increase is a one time thing as I had to define new functions and move some things around, and hopefully future PRs/commits will reduce overall LoCs
- `fabsf32` and `fabsf64` are `#[rustc_intrinsic_const_stable_indirect]`, while `fabsf16` and `fabsf128` aren't; because `f32`/`f64` expect the function to be const, the generic version must be made indirectly stable too. We'd need to check with T-lang this change is ok; the only other intrinsics where there is such a mismatch is `minnum`, `maxnum` and `copysign`.
- I haven't touched libm because I'm not familiar with how it works; any guidance would be welcome!
…alebzulawski,antoyo

simd_fmin/fmax: make semantics and name consistent with scalar intrinsics

This is the SIMD version of rust-lang#153343: change the documented semantics of the SIMD float min/max intrinsics to that of the scalar intrinsics, and also make the name consistent. The overall semantic change this amounts to is that we restrict the non-determinism: the old semantics effectively mean "when one input is an SNaN, the result non-deterministically is a NaN or the other input"; the new semantics say that in this case the other input must be returned. For all other cases, old and new semantics are equivalent. This means all users of these intrinsics that were correct with the old semantics are still correct: the overall set of possible behaviors has become smaller, no new possible behaviors are being added.

In terms of providers of this API:
- Miri, GCC, and cranelift already implement the new semantics, so no changes are needed.
- LLVM is adjusted to use `minimumnum nsz` instead of `minnum`, thus giving us the new semantics.

In terms of consumers of this API:
- Portable SIMD almost certainly wants to match the scalar behavior, so this is strictly a bugfix here.
- Stdarch mostly stopped using the intrinsic, except on nvptx, where arguably the new semantics are closer to what we actually want than the old semantics (rust-lang/stdarch#2056).

Q: Should there be an `f` in the intrinsic name to indicate that it is for floats? E.g., `simd_fminimum_number_nsz`?

Also see rust-lang#153395.
The `HashStable` and `ToStableHashKey` traits both have a type parameter
that is sometimes called `CTX` and sometimes called `HCX`. (In practice
this type parameter is always instantiated as `StableHashingContext`.)
Similarly, variables with these types are sometimes called `ctx` and
sometimes called `hcx`. This inconsistency has bugged me for some time.

The `HCX`/`hcx` form is more informative (the `H`/`h` indicates what
type of context it is) and it matches other cases like `tcx`, `dcx`,
`icx`.

Also, RFC 430 says that type parameters should have names that are
"concise UpperCamelCase, usually single uppercase letter: T". In this
case `H` feels insufficient, and `Hcx` feels better.

Therefore, this commit changes the code to use `Hcx`/`hcx` everywhere.
This file has several methods that take a `FnOnce() -> R` closure:
- `DepGraph::with_ignore`
- `DepGraph::with_query_deserialization`
- `DepGraph::with_anon_task`
- `DepGraphData::with_anon_task_inner`

It also has two methods that take a faux closure via an `A` argument and
a `fn(TyCtxt<'tcx>, A) -> R` argument:
- DepGraph::with_task
- DepGraphData::with_task

The rationale is that the faux closure exercises tight control over what
state they have access to. This seems silly when (a) they are passed a
`TyCtxt`, and (b) when similar nearby functions take real closures. And
they are more awkward to use, e.g. requiring multiple arguments to be
gathered into a tuple. This commit changes the faux closures to real
closures.
Because the things in this module aren't MIR and don't use anything
from `rustc_middle::mir`. Also, modules that use `mono` often don't use
anything else from `rustc_middle::mir`.
This allows custom JSON targets to compile, as the assembler was
previously failing with an error that `-Zunstable-options` had not been
set.
Fix compilation for custom JSON targets
and provide it to LLVM for better optimization
…=petrochenkov

Use closures more consistently in `dep_graph.rs`.

This file has several methods that take a `FnOnce() -> R` closure:
- `DepGraph::with_ignore`
- `DepGraph::with_query_deserialization`
- `DepGraph::with_anon_task`
- `DepGraphData::with_anon_task_inner`

It also has two methods that take a faux closure via an `A` argument and a `fn(TyCtxt<'tcx>, A) -> R` argument:
- DepGraph::with_task
- DepGraphData::with_task

The rationale is that the faux closure exercises tight control over what state they have access to. This seems silly when (a) they are passed a `TyCtxt`, and (b) when similar nearby functions take real closures. And they are more awkward to use, e.g. requiring multiple arguments to be gathered into a tuple. This commit changes the faux closures to real closures.

r? @Zalathar
…iser

Start using pattern types in libcore



cc rust-lang#135996

Replaces the innards of `NonNull` with `*const T is !null`.

This does affect LLVM's optimizations, as now reading the field preserves the metadata that the field is not null, and transmuting to another type (e.g. just a raw pointer), will also preserve that information for optimizations. This can cause LLVM opts to do more work, but it's not guaranteed to produce better machine code.

Once we also remove all uses of rustc_layout_scalar_range_start from rustc itself, we can remove the support for that attribute entirely and handle all such needs via pattern types
… r=nnethercote

preserve SIMD element type information

Preserve the SIMD element type and provide it to LLVM for better optimization.

This is relevant for AArch64 types like `int16x4x2_t`, see also llvm/llvm-project#181514. Such types are defined like so:

```rust
#[repr(simd)]
struct int16x4_t([i16; 4]);

#[repr(C)]
struct int16x4x2_t(pub int16x4_t, pub int16x4_t);
```

Previously this would be translated to the opaque `[2 x <8 x i8>]`, with this PR it is instead `[2 x <4 x i16>]`. That change is not relevant for the ABI, but using the correct type prevents bitcasts that can (indeed, do) confuse the LLVM pattern matcher.

This change will make it possible to implement the deinterleaving loads on AArch64 in a portable way (without neon-specific intrinsics), which means that e.g. Miri or the cranelift backend can run them without additional support.

discussion at [#t-compiler > loss of vector element type information](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/loss.20of.20vector.20element.20type.20information/with/584483611)
@rustbot rustbot added 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. labels Apr 28, 2026
@JonathanBrouwer
Copy link
Copy Markdown
Contributor Author

@bors r+ rollup=never p=1000

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 28, 2026

📌 Commit 4dd31ca 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 Apr 28, 2026
@rust-bors

This comment has been minimized.

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

Rollup of 15 pull requests

Successful merges:

 - #155923 (Subtree sync for rustc_codegen_cranelift)
 - #155930 (Sync from portable simd 2026 04 28)
 - #155850 (Only exclude the #155473 change for 1-byte bool-likes)
 - #151994 (switch to v0 mangling by default on stable)
 - #154325 (Tweak irrefutable let else warning output)
 - #155273 (Lock stable_crate_ids once in create_crate_num)
 - #155361 (Document that CFI diverges from Rust wrt. ABI-compatibility rules)
 - #155692 (disable naked-dead-code-elimination test if no RET mnemonic is available)
 - #155747 (Update documentation for `wasm32-wali-linux-musl` after integrating n…)
 - #155768 (compiletest: Overhaul the code for running an incremental test revision)
 - #155907 (Handle hkl const closures)
 - #155910 (misc stuff from reading borrowck again :))
 - #155913 (Delete the 12 year old fixme)
 - #155920 (remove review queue triagebot mentions)
 - #155936 (Rename `SharedContext::emit_dyn_lint*` into `emit_lint*`)
@rust-bors rust-bors Bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 28, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 28, 2026

💔 Test for 5db1570 failed: CI. Failed job:

@JonathanBrouwer
Copy link
Copy Markdown
Contributor Author

@bors retry
Yep, github is still being github

@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 Apr 28, 2026
@rust-bors

This comment has been minimized.

@JonathanBrouwer
Copy link
Copy Markdown
Contributor Author

Seems stable enough again
@bors treeopen

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 28, 2026

Tree is now open for merging.

@rust-bors rust-bors Bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 28, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 28, 2026

☀️ Test successful - CI
Approved by: JonathanBrouwer
Duration: 3h 21m 6s
Pushing 37d85e5 to main...

@rust-bors rust-bors Bot merged commit 37d85e5 into rust-lang:main Apr 28, 2026
12 checks passed
@rustbot rustbot added this to the 1.97.0 milestone Apr 28, 2026
@github-actions
Copy link
Copy Markdown
Contributor

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 03c609a (parent) -> 37d85e5 (this PR)

Test differences

Show 304 test diffs

Stage 0

  • directives::tests::needs_asm_mnemonic: [missing] -> pass (J3)

Stage 1

  • [ui] tests/ui/consts/const-closure-hkl.rs#current: [missing] -> pass (J1)
  • [ui] tests/ui/consts/const-closure-hkl.rs#next: [missing] -> pass (J1)

Stage 2

  • [run-make] tests/run-make/naked-dead-code-elimination: pass -> ignore (skipping test as non-LLVM backend does not support mnemonic queries) (J0)
  • [ui] tests/ui/consts/const-closure-hkl.rs#current: [missing] -> pass (J2)
  • [ui] tests/ui/consts/const-closure-hkl.rs#next: [missing] -> pass (J2)
  • [run-make] tests/run-make/naked-dead-code-elimination: ignore (ignored when cross-compiling) -> ignore (skipping test as target does not have RET mnemonic) (J4)
  • [run-make] tests/run-make/compressed-debuginfo-zstd: ignore (ignored if LLVM wasn't build with zstd for ELF section compression or LLVM is not the default codegen backend) -> pass (J5)

Additionally, 296 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 37d85e592f9ae5f20f7d9a9f99785246fa7298da --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. pr-check-1: 44m 57s -> 28m 2s (-37.6%)
  2. x86_64-gnu-tools: 1h 18m -> 51m 22s (-34.3%)
  3. i686-gnu-nopt-1: 2h 24m -> 1h 39m (-30.7%)
  4. x86_64-rust-for-linux: 1h 11m -> 49m 35s (-30.5%)
  5. pr-check-2: 55m 41s -> 39m 22s (-29.3%)
  6. armhf-gnu: 1h 57m -> 1h 24m (-28.3%)
  7. aarch64-apple: 3h 55m -> 2h 56m (-25.1%)
  8. x86_64-gnu-miri: 1h 50m -> 1h 25m (-23.1%)
  9. dist-riscv64-linux: 1h 12m -> 1h 28m (+22.8%)
  10. x86_64-gnu-gcc: 1h 21m -> 1h 3m (-22.3%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Copy Markdown
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#151994 switch to v0 mangling by default on stable a0959607632ab71e6afb4c13250ade5d3b17ed3a (link)
#153834 Merge fabsf16/32/64/128 into fabs::<F> ❌ conflicts merging 'c3ef307d1b' into previous master ❌
#153997 Use closures more consistently in dep_graph.rs. ❌ conflicts merging '85e5a244a5' into previous master ❌
#154043 simd_fmin/fmax: make semantics and name consistent with sca… ❌ conflicts merging 'a3741b2aef' into previous master ❌
#154325 Tweak irrefutable let else warning output 865c6548c1166f6d7a046f8f122a7d1e596313ef (link)
#155005 preserve SIMD element type information ❌ conflicts merging 'a67de10494' into previous master ❌
#155273 Lock stable_crate_ids once in create_crate_num 83fd2f5840bf9566d29b883f8b422f9f03f53d05 (link)
#155361 Document that CFI diverges from Rust wrt. ABI-compatibility… 465d09fc4a208e7b3737741b28b8087a197e1b56 (link)
#155692 disable naked-dead-code-elimination test if no RET mnemonic… 616910c87291ea7a5cd3e58eadaad6160273215d (link)
#155747 Update documentation for wasm32-wali-linux-musl after int… 0f1b02ff4be2411e780b668c23922658a65f84a6 (link)
#155768 compiletest: Overhaul the code for running an incremental t… 19812d3e797aaaa3338fbc802e4029f84aaca022 (link)
#155850 Only exclude the #155473 change for 1-byte bool-likes 55b01e06094a818d05d8f41c7e1c6fd5b573836f (link)
#155907 Handle hkl const closures f904849fae7d1fa5edcbdd34304480861646f81a (link)
#155910 misc stuff from reading borrowck again :) e6a796d1e81ec91bc2a0e80a59dea02738ce7940 (link)
#155913 Delete the 12 year old fixme 03fa9488113df3fc699adcda7e11e39be2863fd7 (link)
#155920 remove review queue triagebot mentions 7ca806fd72b8ac465f5efea6d615133d0e5af3da (link)
#155923 Subtree sync for rustc_codegen_cranelift 65a401ab17d62c3cf2ef1d34e7558f8d2ae79226 (link)
#155930 Sync from portable simd 2026 04 28 30c25495426eef533a73eab27e09602d93eae86d (link)
#155936 Rename SharedContext::emit_dyn_lint* into emit_lint* 261f4fd0a80a0e440d36b3e00d2f8ce50e0ca60f (link)

previous master: 03c609abb6

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@rust-timer
Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (37d85e5): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.0% [-2.0%, -2.0%] 1
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 3.4%, secondary -3.8%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
3.4% [3.3%, 3.6%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.8% [-3.8%, -3.8%] 1
All ❌✅ (primary) 3.4% [3.3%, 3.6%] 2

Cycles

Results (secondary 2.2%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.3% [2.0%, 4.6%] 9
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.6% [-3.1%, -2.1%] 2
All ❌✅ (primary) - - 0

Binary size

Results (primary 0.0%, secondary -2.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.0% [0.0%, 0.0%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.1% [-2.1%, -2.1%] 1
All ❌✅ (primary) 0.0% [0.0%, 0.0%] 1

Bootstrap: 487.089s -> 486.76s (-0.07%)
Artifact size: 393.44 MiB -> 393.43 MiB (-0.00%)

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

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-compiletest Area: The compiletest test runner A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-run-make Area: port run-make Makefiles to rmake.rs A-rustc-dev-guide Area: rustc-dev-guide A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. PG-exploit-mitigations Project group: Exploit mitigations rollup A PR which is a rollup 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.