Skip to content

Rollup of 7 pull requests#154773

Merged
rust-bors[bot] merged 26 commits intorust-lang:mainfrom
matthiaskrgr:rollup-DMnqd9w
Apr 4, 2026
Merged

Rollup of 7 pull requests#154773
rust-bors[bot] merged 26 commits intorust-lang:mainfrom
matthiaskrgr:rollup-DMnqd9w

Conversation

@matthiaskrgr
Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

mejrs and others added 26 commits March 31, 2026 20:46
Instead of just using regular struct lowering for these types, which
results in an incorrect ABI (e.g. returning indirectly), use
`BackendRepr::ScalableVector` which will lower to the correct type and
be passed in registers.

This also enables some simplifications for generating alloca of scalable
vectors and greater re-use of `scalable_vector_parts`.

A LLVM codegen test demonstrating the changed IR this generates is
included in the next commit alongside some intrinsics that make these
tuples usable.
Clang changed to representing tuples of scalable vectors as
structs rather than as wide vectors (that is, scalable vector types
where the `N` part of the `<vscale x N x ty>` type was multiplied by
the number of vectors). rustc mirrored this in the initial implementation
of scalable vectors.

Earlier versions of our patches used the wide vector representation and
our intrinsic patches used the legacy
`llvm.aarch64.sve.tuple.{create,get,set}{2,3,4}` intrinsics for creating
these tuples/getting/setting the vectors, which were only supported
due to LLVM's `AutoUpgrade` pass converting these intrinsics into
`llvm.vector.insert`. `AutoUpgrade` only supports these legacy intrinsics
with the wide vector representation.

With the current struct representation, Clang has special handling in
codegen for generating `insertvalue`/`extractvalue` instructions for
these operations, which must be replicated by rustc's codegen for our
intrinsics to use. This patch implements new intrinsics in
`core::intrinsics::scalable` (mirroring the structure of
`core::intrinsics::simd`) which rustc lowers to the appropriate
`insertvalue`/`extractvalue` instructions.
Generate debuginfo for scalable vectors, following the structure that
Clang generates for scalable vectors.
Abstract over the existing `simd_cast` intrinsic to implement a new
`sve_cast` intrinsic - this is better than allowing scalable vectors to
be used with all of the generic `simd_*` intrinsics.
various fixes for scalable vectors

These are a handful of patches fixing bugs with the current `#[rustc_scalable_vector]` infrastructure so that we can upstream the intrinsics to stdarch:

1. Instead of just using regular struct lowering for tuples of scalable vectors, which results in an incorrect ABI (e.g. returning indirectly), we change to using `BackendRepr::ScalableVector` which will lower to the correct type and be passed in registers.
2. Clang changed from representing tuples of scalable vectors as structs rather than as wide vectors (that is, scalable vector types where the `N` part of the `<vscale x N x ty>` type was multiplied by the number of vectors). rustc mirrored this in the initial implementation of scalable vectors that didn't land.

   When our early patches used the wide vector representation, our intrinsic patches used the legacy `llvm.aarch64.sve.tuple.{create,get,set}{2,3,4}` intrinsics for creating these tuples/getting/setting the vectors, which were only supported due to LLVM's `AutoUpgrade` pass converting these intrinsics into `llvm.vector.insert`. `AutoUpgrade` only supports these legacy intrinsics with the wide vector representation.

   With the current struct representation, Clang has special handling in codegen for generating `insertvalue`/`extractvalue` instructions for these operations, which must be replicated by rustc's codegen for our intrinsics to use.

   We add a new `core::intrinsics::scalable` module (never intended to be stable, just used by the stdarch intrinsics, gated by `core_intrinsics`) and add new intrinsics which rustc lowers to the appropriate `insertvalue`/`extractvalue` instructions.
3. Add generation of debuginfo for scalable vectors, following the DWARF that Clang generates.
4. Some intrinsics need something like `simd_cast`, which will work for scalable vectors too, so this implements a new `sve_cast` intrinsic that uses the same internals as `simd_cast`. This seemed better than permitting scalable vectors to be used with the `simd_*` intrinsics more generally as I can't guarantee this would work for all of them.

This is a relatively large patch but most of it is tests, and each commit should be relatively standalone. It's a little bit easier to upstream them together to avoid needing to stack them.  It's possible that some more compiler fixes will be forthcoming but it's looking like this might be all at the moment.

Depends on rust-lang#153653

r? @workingjubilee (discussed on Zulip)
…d_privacy-gate, r=BoxyUwU

Add  `min_adt_const_params` gate

Add `min_adt_const_params` feature gate to disallow `ConstParamTy_` impl for types which fields visibility mismatches with struct itself

r? BoxyUwU
…te-field-deref-fresh, r=estebank

Improve shadowed private field diagnostics

Fixes rust-lang#149546

I tried to extend the diagnostic to more scenarios, like method call, type mismatch errors.

r? @estebank
…Brouwer

Remove rustc_on_unimplemented's append_const_msg

This does nothing because it is unreachable within the compiler. It also doesn't seem that useful since all the traits it was on are `const` now.

Will make pr to rustc-dev-guide docs later.
…le-impls, r=TaKO8Ki

Remove an unused `StableHash` impl.

r? @TaKO8Ki
Add comment to borrow-checker

As requested by @lcnr

r? @lcnr
…278, r=jackh726

Add tests for three ICEs that have already been fixed

Closes rust-lang#113870.
Closes rust-lang#114056.
Closes rust-lang#118278.
@rust-bors rust-bors bot added the rollup A PR which is a rollup label Apr 3, 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-meta Area: Issues & PRs about the rust-lang/rust repository itself labels Apr 3, 2026
@matthiaskrgr
Copy link
Copy Markdown
Member Author

@bors cancel

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 3, 2026

Auto build was cancelled. Cancelled workflows:

The next pull request likely to be tested is #154773.

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Apr 3, 2026
Rollup of 7 pull requests

Successful merges:

 - #153286 (various fixes for scalable vectors)
 - #153592 (Add  `min_adt_const_params` gate)
 - #154675 (Improve shadowed private field diagnostics)
 - #154653 (Remove rustc_on_unimplemented's append_const_msg)
 - #154743 (Remove an unused `StableHash` impl.)
 - #154752 (Add comment to borrow-checker)
 - #154764 (Add tests for three ICEs that have already been fixed)
@matthiaskrgr
Copy link
Copy Markdown
Member Author

@bors r+

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 3, 2026

📌 Commit 7a68d3f has been approved by matthiaskrgr

It is now in the queue for this repository.

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

rust-bors bot commented Apr 4, 2026

💔 Test for 4e174c4 failed: CI. Failed job:

@matthiaskrgr
Copy link
Copy Markdown
Member Author

@bors retry no space left on device

@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 4, 2026
@rust-bors rust-bors bot mentioned this pull request Apr 4, 2026
@rust-bors

This comment has been minimized.

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

rust-bors bot commented Apr 4, 2026

☀️ Test successful - CI
Approved by: matthiaskrgr
Duration: 3h 32m 17s
Pushing 981cf69 to main...

@rust-bors rust-bors bot merged commit 981cf69 into rust-lang:main Apr 4, 2026
12 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Apr 4, 2026
@rust-timer
Copy link
Copy Markdown
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#153286 various fixes for scalable vectors a4dc61e6938c445b716fc37485fe54b32510157e (link)
#153592 Add min_adt_const_params gate 0111ff3a998f22a460d66357e56ec257df31d950 (link)
#154653 Remove rustc_on_unimplemented's append_const_msg 47384b545f817404b0f1387d30761cf67237e948 (link)
#154675 Improve shadowed private field diagnostics 9778825086f42214bf1cdc10dbc50366fed38227 (link)
#154743 Remove an unused StableHash impl. 3a4d5d48d039884ac4d35ba6adabd456c84f5050 (link)
#154752 Add comment to borrow-checker a9b7be586c3da034e476cfe76d310272b1ba159c (link)
#154764 Add tests for three ICEs that have already been fixed d3f1cd082d4a5c87fdd6c19b48c97eb44c82c736 (link)

previous master: 2972b5e59f

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2026

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 2972b5e (parent) -> 981cf69 (this PR)

Test differences

Show 390 test diffs

Stage 1

  • [codegen] tests/codegen-llvm/scalable-vectors/debuginfo-tuples-x2.rs: [missing] -> ignore (only executed when the architecture is aarch64) (J1)
  • [codegen] tests/codegen-llvm/scalable-vectors/debuginfo-tuples-x3.rs: [missing] -> ignore (only executed when the architecture is aarch64) (J1)
  • [codegen] tests/codegen-llvm/scalable-vectors/debuginfo-tuples-x4.rs: [missing] -> ignore (only executed when the architecture is aarch64) (J1)
  • [ui] tests/ui/const-generics/generic_const_exprs/escaping-late-bound-region-in-canonical-ice-113870.rs: [missing] -> pass (J1)
  • [ui] tests/ui/const-generics/generic_const_exprs/ice-wrapper-impl-trait-with-const-bound-118278.rs: [missing] -> pass (J1)
  • [ui] tests/ui/const-generics/min_adt_const_params/const_param_ty-on-adt-without-adt-gate.rs: [missing] -> pass (J1)
  • [ui] tests/ui/const-generics/min_adt_const_params/min_adt_const_params-gate-fail.rs: [missing] -> pass (J1)
  • [ui] tests/ui/const-generics/min_adt_const_params/min_adt_const_params-gate.rs: [missing] -> pass (J1)
  • [ui] tests/ui/const-generics/min_adt_const_params/type-field-more-visible-than-type.rs: [missing] -> pass (J1)
  • [ui] tests/ui/privacy/private-field-deref-confusion-issue-149546.rs: [missing] -> pass (J1)
  • [ui] tests/ui/scalable-vectors/cast-intrinsic.rs: [missing] -> ignore (only executed when the architecture is aarch64) (J1)
  • [ui] tests/ui/typeck/index-out-of-bounds-on-partial-cmp-ice-114056.rs: [missing] -> pass (J1)
  • [codegen] tests/codegen-llvm/scalable-vectors/debuginfo.rs#POST-LLVM-22: [missing] -> ignore (ignored when the LLVM version 21.1.2 is older than 22.0.0) (J7)
  • [codegen] tests/codegen-llvm/scalable-vectors/debuginfo.rs#PRE-LLVM-22: [missing] -> ignore (only executed when the architecture is aarch64) (J7)
  • [codegen] tests/codegen-llvm/scalable-vectors/debuginfo-tuples-x2.rs: [missing] -> ignore (only executed when the operating system is linux) (J9)
  • [codegen] tests/codegen-llvm/scalable-vectors/debuginfo-tuples-x3.rs: [missing] -> ignore (only executed when the operating system is linux) (J9)
  • [codegen] tests/codegen-llvm/scalable-vectors/debuginfo-tuples-x4.rs: [missing] -> ignore (only executed when the operating system is linux) (J9)
  • [codegen] tests/codegen-llvm/scalable-vectors/debuginfo.rs#POST-LLVM-22: [missing] -> ignore (only executed when the operating system is linux) (J9)
  • [codegen] tests/codegen-llvm/scalable-vectors/debuginfo.rs#PRE-LLVM-22: [missing] -> ignore (ignored when the LLVM version (22.1.2) is newer than majorversion 21) (J9)
  • [codegen] tests/codegen-llvm/scalable-vectors/debuginfo.rs#POST-LLVM-22: [missing] -> ignore (only executed when the architecture is aarch64) (J10)
  • [codegen] tests/codegen-llvm/scalable-vectors/debuginfo.rs#PRE-LLVM-22: [missing] -> ignore (ignored when the LLVM version (22.1.1) is newer than majorversion 21) (J10)
  • [codegen] tests/codegen-llvm/scalable-vectors/tuple-intrinsics.rs: [missing] -> ignore (only executed when the architecture is aarch64) (J15)

Stage 2

  • [ui] tests/ui/const-generics/generic_const_exprs/escaping-late-bound-region-in-canonical-ice-113870.rs: [missing] -> pass (J0)
  • [ui] tests/ui/const-generics/generic_const_exprs/ice-wrapper-impl-trait-with-const-bound-118278.rs: [missing] -> pass (J0)
  • [ui] tests/ui/const-generics/min_adt_const_params/const_param_ty-on-adt-without-adt-gate.rs: [missing] -> pass (J0)
  • [ui] tests/ui/const-generics/min_adt_const_params/min_adt_const_params-gate-fail.rs: [missing] -> pass (J0)
  • [ui] tests/ui/const-generics/min_adt_const_params/min_adt_const_params-gate.rs: [missing] -> pass (J0)
  • [ui] tests/ui/const-generics/min_adt_const_params/type-field-more-visible-than-type.rs: [missing] -> pass (J0)
  • [ui] tests/ui/privacy/private-field-deref-confusion-issue-149546.rs: [missing] -> pass (J0)
  • [ui] tests/ui/typeck/index-out-of-bounds-on-partial-cmp-ice-114056.rs: [missing] -> pass (J0)
  • [codegen] tests/codegen-llvm/scalable-vectors/debuginfo-tuples-x2.rs: [missing] -> ignore (only executed when the operating system is linux) (J2)
  • [codegen] tests/codegen-llvm/scalable-vectors/debuginfo-tuples-x3.rs: [missing] -> ignore (only executed when the operating system is linux) (J2)
  • [codegen] tests/codegen-llvm/scalable-vectors/debuginfo-tuples-x4.rs: [missing] -> ignore (only executed when the operating system is linux) (J2)
  • [codegen] tests/codegen-llvm/scalable-vectors/debuginfo.rs#POST-LLVM-22: [missing] -> ignore (only executed when the operating system is linux) (J2)
  • [codegen] tests/codegen-llvm/scalable-vectors/debuginfo.rs#POST-LLVM-22: [missing] -> pass (J3)
  • [codegen] tests/codegen-llvm/scalable-vectors/debuginfo.rs#PRE-LLVM-22: [missing] -> ignore (only executed when the architecture is aarch64) (J4)
  • [codegen] tests/codegen-llvm/scalable-vectors/debuginfo.rs#PRE-LLVM-22: [missing] -> pass (J5)
  • [codegen] tests/codegen-llvm/scalable-vectors/debuginfo-tuples-x2.rs: [missing] -> ignore (only executed when the architecture is aarch64) (J6)
  • [codegen] tests/codegen-llvm/scalable-vectors/debuginfo-tuples-x3.rs: [missing] -> ignore (only executed when the architecture is aarch64) (J6)
  • [codegen] tests/codegen-llvm/scalable-vectors/debuginfo-tuples-x4.rs: [missing] -> ignore (only executed when the architecture is aarch64) (J6)
  • [codegen] tests/codegen-llvm/scalable-vectors/debuginfo-tuples-x2.rs: [missing] -> pass (J8)
  • [codegen] tests/codegen-llvm/scalable-vectors/debuginfo-tuples-x3.rs: [missing] -> pass (J8)
  • [codegen] tests/codegen-llvm/scalable-vectors/debuginfo-tuples-x4.rs: [missing] -> pass (J8)
  • [ui] tests/ui/scalable-vectors/cast-intrinsic.rs: [missing] -> ignore (only executed when the architecture is aarch64) (J11)
  • [codegen] tests/codegen-llvm/scalable-vectors/debuginfo.rs#PRE-LLVM-22: [missing] -> ignore (ignored when the LLVM version (22.1.1) is newer than majorversion 21) (J12)
  • [codegen] tests/codegen-llvm/scalable-vectors/debuginfo.rs#POST-LLVM-22: [missing] -> ignore (only executed when the architecture is aarch64) (J13)
  • [codegen] tests/codegen-llvm/scalable-vectors/debuginfo.rs#POST-LLVM-22: [missing] -> ignore (ignored when the LLVM version 21.1.2 is older than 22.0.0) (J14)
  • [codegen] tests/codegen-llvm/scalable-vectors/tuple-intrinsics.rs: [missing] -> pass (J16)
  • [ui] tests/ui/scalable-vectors/cast-intrinsic.rs: [missing] -> pass (J16)
  • [codegen] tests/codegen-llvm/scalable-vectors/debuginfo.rs#PRE-LLVM-22: [missing] -> ignore (ignored when the LLVM version (22.1.2) is newer than majorversion 21) (J17)
  • [codegen] tests/codegen-llvm/scalable-vectors/tuple-intrinsics.rs: [missing] -> ignore (only executed when the architecture is aarch64) (J18)

Additionally, 339 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 981cf69479ded5e2de0cf9e16111c19d65be0369 --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. dist-x86_64-apple: 2h 12m -> 1h 47m (-18.7%)
  2. dist-aarch64-llvm-mingw: 1h 48m -> 1h 33m (-13.9%)
  3. x86_64-gnu-llvm-21-2: 1h 39m -> 1h 27m (-11.7%)
  4. x86_64-gnu-gcc: 1h 9m -> 1h 1m (-11.0%)
  5. i686-msvc-1: 3h 2m -> 2h 42m (-11.0%)
  6. pr-check-2: 44m 12s -> 39m 21s (-11.0%)
  7. dist-x86_64-llvm-mingw: 2h 3m -> 1h 50m (-10.9%)
  8. dist-i686-linux: 1h 45m -> 1h 56m (+10.6%)
  9. x86_64-gnu-llvm-22-1: 1h 9m -> 1h 16m (+10.5%)
  10. x86_64-msvc-ext1: 2h 16m -> 2h 4m (-8.7%)
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

Finished benchmarking commit (981cf69): comparison URL.

Overall result: ❌✅ regressions and 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.6% [0.3%, 1.5%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.1%] 1
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -0.0%, secondary -1.8%)

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

mean range count
Regressions ❌
(primary)
1.0% [0.5%, 1.5%] 2
Regressions ❌
(secondary)
2.8% [2.1%, 3.5%] 2
Improvements ✅
(primary)
-2.1% [-2.1%, -2.1%] 1
Improvements ✅
(secondary)
-3.3% [-4.8%, -2.2%] 6
All ❌✅ (primary) -0.0% [-2.1%, 1.5%] 3

Cycles

Results (secondary 4.4%)

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)
4.4% [2.9%, 6.0%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

Results (primary 0.0%, secondary 0.0%)

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%] 8
Regressions ❌
(secondary)
0.0% [0.0%, 0.1%] 12
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [0.0%, 0.0%] 8

Bootstrap: 489.759s -> 485.459s (-0.88%)
Artifact size: 395.08 MiB -> 395.00 MiB (-0.02%)

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-meta Area: Issues & PRs about the rust-lang/rust repository itself A-test-infra-minicore Area: `minicore` test auxiliary and `//@ add-core-stubs` merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup 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.

10 participants