Skip to content

Rollup of 9 pull requests#155960

Open
jhpratt wants to merge 25 commits intorust-lang:mainfrom
jhpratt:rollup-3RQLDqK
Open

Rollup of 9 pull requests#155960
jhpratt wants to merge 25 commits intorust-lang:mainfrom
jhpratt:rollup-3RQLDqK

Conversation

@jhpratt
Copy link
Copy Markdown
Member

@jhpratt jhpratt commented Apr 29, 2026

Successful merges:

r? @ghost

Create a similar rollup

lilith and others added 25 commits April 27, 2026 01:54
Wire IsProcessorFeaturePresent for the PF_ARM_* constants exposed in
Windows SDK 26100 (Win11 24H2):

  fp16   PF_ARM_V82_FP16_INSTRUCTIONS_AVAILABLE  (67)
  i8mm   PF_ARM_V82_I8MM_INSTRUCTIONS_AVAILABLE  (66)
  bf16   PF_ARM_V86_BF16_INSTRUCTIONS_AVAILABLE  (68)
  sha3   PF_ARM_SHA3 (64) AND PF_ARM_SHA512 (65)
  lse2   PF_ARM_LSE2_AVAILABLE                   (62)
  f32mm  PF_ARM_SVE_F32MM_INSTRUCTIONS_AVAILABLE (58)
  f64mm  PF_ARM_SVE_F64MM_INSTRUCTIONS_AVAILABLE (59)

Also derive `rdm` from FEAT_DotProd. There is no PF_ARM_RDM_* constant;
FEAT_DotProd is an optional v8.2-A feature only present on cores that
implement at least v8.1-A, and v8.1-A with AdvSIMD mandates FEAT_RDM
(Arm ARM K.a §D17.2.91). AdvSIMD is universal on Windows-on-ARM. See
PR description for full rationale and .NET 10 precedent.

All eight feature names have been stable in `is_aarch64_feature_detected!`
on Linux/Darwin/BSD since Rust 1.60.
Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com>
For now, this is a 1-to-1 copy of `LayoutData`, but this will change.
It was always set to `Variants::Single`.
Enum variants always have `Arbitrary` layout, so the enum isn't needed.
This field is only used during layout calculations, so re-synthetized
`LayoutData`s for enum variants can use a dummy value instead.
Reusing the alignment of the enclosing enum in `LayoutData::for_variant`
doesn't appear to cause any issues.
…ts, allowing to use `FnOnce` instead of `Fn`
Because the memory safety of `FlatMapInPlace::flat_map_in_place` depends
on `FlatMapInPlaceVec` impls behaving correctly.
Remove redundant information in `rustc_abi::Variants`

Follow-up to rust-lang#151040; partially addresses rust-lang#113988.

Replaces the nested `LayoutData` in `Variants::Multiple` by a new, smaller `VariantLayout` struct, and adjust `LayoutData::for_variant`and the layout algorithm in consequence.
This PR is best reviewed commit-by-commit.
…manieu

std_detect: support detecting more features on aarch64 Windows

Wires `IsProcessorFeaturePresent` calls for the `PF_ARM_*` constants exposed in Windows SDK 26100 (Windows 11 24H2), plus an architectural derivation for `rdm`. All eight feature names have been stable in `is_aarch64_feature_detected!` on Linux/Darwin/BSD since Rust 1.60 — this brings the Windows backend to parity.

| Feature | Source on Windows |
|---|---|
| `fp16`  | `PF_ARM_V82_FP16_INSTRUCTIONS_AVAILABLE`  (value 67) |
| `i8mm`  | `PF_ARM_V82_I8MM_INSTRUCTIONS_AVAILABLE`  (value 66) |
| `bf16`  | `PF_ARM_V86_BF16_INSTRUCTIONS_AVAILABLE`  (value 68) |
| `sha3`  | `PF_ARM_SHA3` (value 64) **AND** `PF_ARM_SHA512` (value 65) |
| `lse2`  | `PF_ARM_LSE2_AVAILABLE`                   (value 62) |
| `f32mm` | `PF_ARM_SVE_F32MM_INSTRUCTIONS_AVAILABLE` (value 58) |
| `f64mm` | `PF_ARM_SVE_F64MM_INSTRUCTIONS_AVAILABLE` (value 59) |
| `rdm`   | derived from `PF_ARM_V82_DP` (see below) |

`PF_ARM_SVE_F32MM` / `PF_ARM_SVE_F64MM` (values 58 / 59) were already added as commented-out placeholders in rust-lang/stdarch#1749 — they have direct stable Feature mappings (`f32mm`, `f64mm`), unlike their sibling values 52 / 53 / 57 (`SVE_BF16`, `SVE_EBF16`, `SVE_I8MM`) which have no SVE-specific stdarch Feature name and remain commented for that reason.

`sha3` requires both `PF_ARM_SHA3` (FEAT_SHA3) and `PF_ARM_SHA512` (FEAT_SHA512), matching the existing convention from rust-lang/stdarch#1749 where `sve2-aes` is set only when both `PF_ARM_SVE_AES` and `PF_ARM_SVE_PMULL128` are present.

### `rdm` derivation

There is no `PF_ARM_RDM_*` constant; Microsoft has never defined one. We derive it from `PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE` (FEAT_DotProd) via the following architectural chain:

1. FEAT_DotProd is an optional v8.2-A feature, so its presence implies the core implements at least v8.1-A.
2. Per Arm ARM K.a §D17.2.91: *"In an ARMv8.1 implementation, if FEAT_AdvSIMD is implemented, FEAT_RDM is implemented."*
3. AdvSIMD is universally implemented on every Windows-on-ARM SKU.
4. Therefore: DotProd ⇒ v8.1-A baseline + AdvSIMD ⇒ FEAT_RDM.

This is the same derivation .NET 10 uses, with comment cited verbatim ([dotnet/runtime PR 109493](dotnet/runtime#109493), shipped in v10.0.0 at [`src/native/minipal/cpufeatures.c`](https://github.com/dotnet/runtime/blob/v10.0.0/src/native/minipal/cpufeatures.c)):

> *"IsProcessorFeaturePresent does not have a dedicated flag for RDM, so we enable it by implication.
> 1) DP is an optional instruction set for Armv8.2, which may be included only in processors implementing at least Armv8.1.
> 2) Armv8.1 requires RDM when AdvSIMD is implemented, and AdvSIMD is a baseline requirement of .NET.
> Therefore, by documented standard, DP cannot exist here without RDM. In practice, there is only one CPU supported by Windows that includes RDM without DP, so this implication also has little practical chance of a false negative."*

The "one CPU with RDM without DP" trade-off applies equally to us: we accept a possible false negative on that single SKU rather than introducing a more aggressive heuristic.

### Tests

Adds `println!` lines to the existing `aarch64_windows()` test in `library/std_detect/tests/cpu-detection.rs` for each newly-detected feature, mirroring the existing single-line pattern. No structural assertions added.

### Scope

Stable feature names only. The unstable SME family (`sme`, `sme2`, `sme2p1`, `sme_*`, `ssve_fp8*`) and other unstable additions tracked under rust-lang#127764 are intentionally out of scope here to keep this PR minimal — happy to do a follow-up.

### References

- Tracking issue: rust-lang#127764 (`stdarch_aarch64_feature_detection`)
- Precedent: rust-lang/stdarch#1749 (taiki-e, merged 2025-03-24) — added the SVE constants this builds on
- MS docs: [`IsProcessorFeaturePresent`](https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-isprocessorfeaturepresent) — full PF_ARM_* table

r? @Amanieu

cc @taiki-e (author of rust-lang/stdarch#1749, would appreciate your eyes on the `rdm` inference)

@rustbot label +T-libs +O-windows +O-ARM
…r=jdonszelmann

Suggest `[const] Trait` bounds in more places

Right now we have some special logic in the const checker for emitting `[const] Trait` suggestions, but I'm trying to handle that similarly to how it is handled for normal `Trait` clauses. This is just a small step in how it will look on the UX side, which should make my follow-up PRs affect tests less and just be a refactoring
`dlltool`: Set the working directory to workaround `--temp-prefix` bug

dlltool's `--temp-prefix` argument incorrectly splits paths that contain spaces. To workaround this, we pass a relative path to `--temp-prefix` and set the working directory.

fixes rust-lang#155591
Update with new LLVM 22 target for `wasm32-wali-linux-musl` target

This is a reopening of rust-lang#155654, which was closed abruptly due to changed commit SHAs on my end during merge.
…r=Urgau,

remap OUT_DIR paths to fix build script path leakage in crate metadata.

### problem:
- build script outputs (`OUT_DIR`) leak absolute paths into crate metadata causing non-determinism across identical builds.
- bootstrap remaps source paths (`self.build.src`) and registry sources but doesn't not remap `self.build.out` used by `OUT_DIR`

### fix:
- adding `--remap-path-prefix` for `self.build.out` , mapping it to a stable virtual prefix, consistent with existing remappings

### result:
- removes path-based non-determinism from build script outputs
- verified via stage 2 reproducibility testing.

r? @Urgau
…henyukang

use the new `//@ needs-asm-mnemonic: ret` more

Since rust-lang#155692 we have this neat new rule, and a couple of tests should be able to use them.
…thanBrouwer,kivooeo

Update `opt_ast_lowering_delayed_lints` query to allow "stealing" lints, allowing to use `FnOnce` instead of `Fn`

Part of rust-lang#153099.

This is needed for https://github.com/rust-lang/rust/compare/main...GuillaumeGomez:rust:diagnostic-instead-of-closure?expand=1 which will allow to pass `Diagnostic` instead of a closure.

As asked by @JonathanBrouwer, I make this as a stand-alone PR. :)

r? @JonathanBrouwer
…ec, r=kivooeo

Make `FlatMapInPlaceVec` an unsafe trait.

Because the memory safety of `FlatMapInPlace::flat_map_in_place` depends on `FlatMapInPlaceVec` impls behaving correctly.

r? @chenyukang
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Apr 29, 2026
@rustbot rustbot added 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-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. labels Apr 29, 2026
@rustbot rustbot added 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. labels Apr 29, 2026
@jhpratt
Copy link
Copy Markdown
Member Author

jhpratt commented Apr 29, 2026

@bors r+ rollup=never p=5

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 29, 2026

📌 Commit 143227f has been approved by jhpratt

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

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Apr 29, 2026
Rollup of 9 pull requests

Successful merges:

 - #151742 (Remove redundant information in `rustc_abi::Variants`)
 - #155856 (std_detect: support detecting more features on aarch64 Windows)
 - #155861 (Suggest `[const] Trait` bounds in more places)
 - #155899 (`dlltool`: Set the working directory to workaround `--temp-prefix` bug)
 - #155916 (Update with new LLVM 22 target for `wasm32-wali-linux-musl` target)
 - #155935 (remap OUT_DIR paths to fix build script path leakage in crate metadata. )
 - #155950 (use the new `//@ needs-asm-mnemonic: ret` more)
 - #155949 (Update `opt_ast_lowering_delayed_lints` query to allow "stealing" lints, allowing to use `FnOnce` instead of `Fn`)
 - #155951 (Make `FlatMapInPlaceVec` an unsafe trait.)
@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

The job x86_64-gnu-llvm-21-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
test expr_store::scope::tests::while_let_adds_binding ... ok
test expr_store::scope::tests::test_lambda_scope ... ok
test expr_store::tests::body::block::inner_item_smoke ... ok
test expr_store::tests::body::block::legacy_macro_items ... ok
error: test failed, to rerun pass `-p hir-def --lib`

Caused by:
  process didn't exit successfully: `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/hir_def-efef625bc23d7e18 '--skip=tests::smoke_test_real_sysroot_cargo' --skip=check_code_formatting -Z unstable-options --format json` (signal: 11, SIGSEGV: invalid memory reference)
Bootstrap failed while executing `--stage 2 test --skip tests --skip coverage-map --skip coverage-run --skip library --skip tidyselftest`
Build completed unsuccessfully in 1:07:22
  local time: Wed Apr 29 12:06:06 UTC 2026
  network time: Wed, 29 Apr 2026 12:06:06 GMT
##[error]Process completed with exit code 1.

@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 29, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 29, 2026

💔 Test for a3933d9 failed: CI. Failed job:

@JonathanBrouwer
Copy link
Copy Markdown
Contributor

Is that spurious?
@bors try jobs=x86_64-gnu-llvm-21-1

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 29, 2026

⌛ Trying commit 143227f with merge f61ee4b

To cancel the try build, run the command @bors try cancel.

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

rust-bors Bot pushed a commit that referenced this pull request Apr 29, 2026
Rollup of 9 pull requests


try-job: x86_64-gnu-llvm-21-1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-run-make Area: port run-make Makefiles to rmake.rs rollup A PR which is a rollup 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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.