Skip to content

Rollup of 11 pull requests - #163970

Merged
rust-bors[bot] merged 24 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-ntScez1
Oct 8, 2026
Merged

rust-bors[bot] merged 24 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-ntScez1

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

sgasho and others added 24 commits September 19, 2026 16:43
This prevents nonsensical combinations like unsized+on_stack and forces
all users to explicitly handle the difference between sized and unsized
arguments. In a couple of places unsized arguments were handled
incorrectly if they would ever manage to reach that code.
This will make it easier to move them in a subsequent commit, since
`UnrollAttr` implements `PartialEq`.

If, in the future, we add more kinds of loop hints, this can become a
small enum wrapping only those attr types.
We should not disable the pattern in MatchBranchSimplification.
The two forms exhaustive match and cast are equivalent, but the cast is better represented in MIR: no branches, only one statement.

AFAIK, LLVM does not handle multiple disjoint intervals well.
As an workaround, the patch emits `assume(ctpop(val) == 1)` to tell LLVM that
the discriminant is a power of two.
Only the `Goto` variant uses `loop_hint_attrs`, so other variants
shouldn't pay the cost. This shrinks `Terminator` and thus
`BasicBlockData` by 8 bytes, and also simplifies many users of
`Terminator`.

Every byte saved from `BasicBlockData` makes a big difference in
max-rss. For aws-sdk-ec2 full check, this saves 34.1 MiB (~0.62% of its
peak RSS)

Add a `TerminatorKind::goto` helper function for convenient construction
with a target and no hints. With that helper available, most of this
commit is simple, straightforward, mechanical translations of
construction or pattern matching. The only notable changes are:

- `compiler/rustc_codegen_ssa/src/mir/block.rs` actually uses the moved hints.
- `compiler/rustc_middle/src/mir/mod.rs` updates the size assertions.
- `compiler/rustc_mir_build/src/builder/cfg.rs` adds/updates helpers.
- `compiler/rustc_mir_build/src/builder/expr/into.rs` has the one place
  that creates a `Goto` with non-empty hints.
… r=saethlin

codegen: tell LLVM that the discriminant is a power of two

Fixes rust-lang#162513.

We should not disable the pattern in MatchBranchSimplification. The two forms exhaustive match and cast are equivalent, but the cast is better represented in MIR: no branches, only one statement.

AFAIK, LLVM does not handle multiple disjoint intervals well. As an workaround, the patch emits `assume(ctpop(val) == 1)` to tell LLVM that the discriminant is a power of two.

LLM disclosure: search the codebase and fix grammer.
… r=beetrees

Split PassMode::IndirectUnsized out of PassMode::Indirect

This prevents nonsensical combinations like unsized+on_stack and forces all users to explicitly handle the difference between sized and unsized arguments. In a couple of places unsized arguments were handled incorrectly if they would ever manage to reach that code.
…n-goto, r=saethlin

Move `loop_hint_attrs` from `Terminator` into `TerminatorKind::Goto`

Only the `Goto` variant uses `loop_hint_attrs`, so other variants shouldn't pay the cost. This shrinks `Terminator` and thus `BasicBlockData` by 8 bytes, and also simplifies many users of `Terminator`.

Every byte saved from `BasicBlockData` makes a big difference in max-rss. For aws-sdk-ec2 full check, this saves 34.1 MiB (~0.62% of its peak RSS)

Add a `TerminatorKind::goto` helper function for convenient construction with a target and no hints. With that helper available, most of this commit is simple, straightforward, mechanical translations of construction or pattern matching. The only notable changes are:

- `compiler/rustc_codegen_ssa/src/mir/block.rs` actually uses the moved hints.
- `compiler/rustc_middle/src/mir/mod.rs` updates the size assertions.
- `compiler/rustc_mir_build/src/builder/cfg.rs` adds/updates helpers.
- `compiler/rustc_mir_build/src/builder/expr/into.rs` has the one place that creates a `Goto` with non-empty hints.

---

I have several more potential improvements to basic block sizes, but this one was an easy starting point.
…useZ4

autodiff: fix sysroot candidates in libEnzyme not found error

fix: rust-lang#160335 (comment)

Before

```shell
RUSTFLAGS="-Zautodiff=Enable" cargo +enzyme run
info: `cargo` is unavailable for the active toolchain
info: falling back to "/home/gh-sgasho/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo"
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/home/gh-sgasho/.rustup/toolchains/enzyme/bin/rustc - --crate-name ___ --print=file-names -Zautodiff=Enable --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=split-debuginfo --print=crate-name --print=cfg -Wwarnings` (exit status: 1)
  --- stderr
  error: autodiff backend not found in the sysroot: failed to find a `libEnzyme-23` folder in the sysroot candidates:
         * /home/gh-sgasho/rust-worktrees/enzyme-wrapper-cleanup/build/x86_64-unknown-linux-gnu/stage1/lib
    |
    = note: it will be distributed via rustup in the future
```

After: points out the right candidate dir

```shell
RUSTFLAGS="-Zautodiff=Enable" cargo +enzyme run --release
info: `cargo` is unavailable for the active toolchain
info: falling back to "/home/gh-sgasho/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo"
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/home/gh-sgasho/.rustup/toolchains/enzyme/bin/rustc - --crate-name ___ --print=file-names -Zautodiff=Enable --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=split-debuginfo --print=crate-name --print=cfg -Wwarnings` (exit status: 1)
  --- stderr
  error: autodiff backend not found in the sysroot: failed to find a `libEnzyme-23.so` in the sysroot candidates:
         * /home/gh-sgasho/rust-worktrees/enzyme-wrapper-cleanup/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib
    |
    = note: it will be distributed via rustup in the future
```

I also verified that sample autodiff code ran successfully using local build, without breaking anything.

r? @ZuseZ4
…r=BoxyUwU,bit-aloo

abby DSL: sanity checks on forall where clauses

fixes rust-lang/project-assumptions-on-binders#43

took the opportunity to clean up a bit too, so the diff is a bit bigger than it strictly needs to be

this PR enforces that the LHS of forall where clauses must be a placeholder (or toplevel param), an alias, or a lifetime

also, after review, this PR now enforces that all implied bounds in where clauses are also explicitly present as well, enforcing that there's no sneaky bounds going on

r? @BoxyUwU
…Urgau

[rustdoc] Fix more `incoherent_impl` linking

Hopefully last fix for rust-lang#162808.

We force the correct crate to be linked when generating the external location based on the `DefId` crate. I'm actually surprised it wasn't an issue before. Oh well.

r? @Urgau
…r=ZuseZ4

Update Enzyme submodule

r? ZuseZ4
cc @wsmoses

@bors try jobs=dist-x86_64-linux,optional-test-x86_64-gnu-autodiff
Use BasicBlock::start_location and Location::START

Construct special MIR locations concisely.
…t, r=lqd

disable next-solver with higher-ranked-assumptions

that's nicer than needing to update all the `[assumptions]` ui tests I think

r? @lqd or @BoxyUwU
…wesleywiser

relax_elf_relocations is x86-only

The flag ends up here

https://github.com/rust-lang/rust/blob/8d1a76430406c877b35d0b627e7f796dcf0dfeca/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp#L393

The LLVM name for this, `X86RelaxRelocations`, makes me believe that this is x86-only. So let's at least document that on our side as well.

Cc @bjorn3  @nikic
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Oct 8, 2026
@rustbot rustbot added 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 F-autodiff `#![feature(autodiff)]` 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. labels Oct 8, 2026
@rustbot rustbot added the T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. label Oct 8, 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

@rust-bors

rust-bors Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 61789a5 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 Oct 8, 2026
@rust-bors

This comment has been minimized.

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

This comment has been minimized.

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job test-i686-msvc failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
compile::Assemble { target_compiler: Compiler { stage: 2, host: x86_64-pc-windows-msvc, forced_compiler: false } } at src\bootstrap\src\core\build_steps\test.rs:2025
compile::Assemble { target_compiler: Compiler { stage: 1, host: x86_64-pc-windows-msvc, forced_compiler: false } } at src\bootstrap\src\core\build_steps\compile.rs:2290
compile::CraneliftCodegenBackend { compilers: RustcPrivateCompilers { build_compiler: Compiler { stage: 0, host: x86_64-pc-windows-msvc, forced_compiler: false }, target_compiler: Compiler { stage: 1, host: x86_64-pc-windows-msvc, forced_compiler: false } } } at src\bootstrap\src\core\build_steps\compile.rs:2422
Build completed unsuccessfully in 0:33:16
make: *** [Makefile:115: ci-msvc-py] Error 1
  local time: Thu Oct  8 07:37:40 CUT 2026
  network time: Thu, 08 Oct 2026 07:37:41 GMT
##[error]Process completed with exit code 2.
##[group]Run echo "disk usage:"
echo "disk usage:"

@rust-bors rust-bors Bot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Oct 8, 2026
@rust-bors

rust-bors Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

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

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job test-i686-msvc failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
compile::Assemble { target_compiler: Compiler { stage: 2, host: x86_64-pc-windows-msvc, forced_compiler: false } } at src\bootstrap\src\core\build_steps\test.rs:2025
compile::Assemble { target_compiler: Compiler { stage: 1, host: x86_64-pc-windows-msvc, forced_compiler: false } } at src\bootstrap\src\core\build_steps\compile.rs:2290
compile::CraneliftCodegenBackend { compilers: RustcPrivateCompilers { build_compiler: Compiler { stage: 0, host: x86_64-pc-windows-msvc, forced_compiler: false }, target_compiler: Compiler { stage: 1, host: x86_64-pc-windows-msvc, forced_compiler: false } } } at src\bootstrap\src\core\build_steps\compile.rs:2422
Build completed unsuccessfully in 0:33:16
make: *** [Makefile:115: ci-msvc-py] Error 1
  local time: Thu Oct  8 07:37:40 CUT 2026
  network time: Thu, 08 Oct 2026 07:37:41 GMT
##[error]Process completed with exit code 2.
##[group]Run echo "disk usage:"
echo "disk usage:"

@rust-bors rust-bors Bot added the merged-by-bors This PR was explicitly merged by bors. label Oct 8, 2026
@rust-bors

rust-bors Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: JonathanBrouwer
Duration: 2h 58m 18s
Pushing fc2324d to main...

@rust-bors rust-bors Bot removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Oct 8, 2026
@rust-bors
rust-bors Bot merged commit fc2324d into rust-lang:main Oct 8, 2026
15 of 16 checks passed
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Oct 8, 2026
@rustbot rustbot added this to the 1.101.0 milestone Oct 8, 2026
@github-actions

github-actions Bot commented Oct 8, 2026

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 42cfc04 (parent) -> fc2324d (this PR)

Test differences

Show 85 test diffs

Stage 1

  • [codegen] tests/codegen-llvm/enum/enum-discriminant-power-of-two.rs: [missing] -> pass (J2)
  • [ui] tests/ui/async-await/witness-auto-trait/higher-ranked-auto-trait-1.rs#assumptions_next: [missing] -> pass (J3)
  • [rustdoc-html] tests/rustdoc-html/jump-to-def/link-to-alloc.rs: [missing] -> pass (J5)
  • [ui (polonius)] tests/ui/async-await/witness-auto-trait/higher-ranked-auto-trait-1.rs#assumptions_next: [missing] -> pass (J6)

Stage 2

  • [rustdoc-html] tests/rustdoc-html/jump-to-def/link-to-alloc.rs: [missing] -> pass (J0)
  • [codegen] tests/codegen-llvm/enum/enum-discriminant-power-of-two.rs: [missing] -> pass (J1)
  • [ui] tests/ui/async-await/witness-auto-trait/higher-ranked-auto-trait-1.rs#assumptions_next: [missing] -> pass (J4)

Additionally, 78 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 fc2324d0546aa6782c45b76247266a0c37db0b8a --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. test-x86_64-gnu-stdlib-semver-check: 7m 58s -> 15m 20s (+92.5%)
  2. test-x86_64-rust-for-linux: 33m 25s -> 1h 1m (+82.7%)
  3. test-i686-gnu-nopt-1: 1h 21m -> 2h 22m (+75.3%)
  4. test-x86_64-msvc-ext3: 1h 9m -> 1h 56m (+66.6%)
  5. dist-arm-linux-musl: 1h 6m -> 1h 51m (+66.0%)
  6. test-x86_64-gnu-stable: 1h 36m -> 2h 38m (+64.1%)
  7. dist-riscv64-linux-musl: 58m 5s -> 1h 33m (+60.8%)
  8. optional-test-x86_64-gnu-autodiff: 37m 39s -> 58m 17s (+54.8%)
  9. test-pr-check-1: 25m 12s -> 39m (+54.8%)
  10. dist-x86_64-solaris: 1h 11m -> 1h 48m (+51.0%)
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 (fc2324d): comparison URL.

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

Max RSS (memory usage)

Results (primary 0.3%, secondary -2.0%)

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

mean range count
Regressions ❌
(primary)
1.3% [1.2%, 1.4%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.7% [-0.8%, -0.6%] 2
Improvements ✅
(secondary)
-2.0% [-2.6%, -1.3%] 3
All ❌✅ (primary) 0.3% [-0.8%, 1.4%] 4

Cycles

Results (secondary 2.7%)

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)
8.5% [6.5%, 10.5%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.1% [-4.2%, -2.0%] 2
All ❌✅ (primary) - - 0

Binary size

Results (secondary -0.1%)

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

Bootstrap: 489.959s -> 484.956s (-1.02%)
Artifact size: 408.60 MiB -> 406.45 MiB (-0.53%)

@rust-bors

rust-bors Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#162741 codegen: tell LLVM that the discriminant is a power of two a341e0ee37271a55935153891f2ac232210f70a5
(link)
#162758 Split PassMode::IndirectUnsized out of PassMode::Indirect 780d9a7aa7ea14ed924768ce9d9e048b87b06498
(link)
#163931 Move loop_hint_attrs from Terminator into `TerminatorKi… 34bacc1820a9d57d9a47555594f8290513e504dc
(link)
#163028 autodiff: fix sysroot candidates in libEnzyme not found err… 72e3e2dab6ea803f96612c5ea841fc8dad702e04
(link)
#163257 abby DSL: sanity checks on forall where clauses 4a241c2964ff6bfe4930c6780017fe44894e08fc
(link)
#163841 [rustdoc] Fix more incoherent_impl linking 079459306ebc064542bf6d8440bd7bd23ce8f295
(link)
#163908 Update Enzyme submodule 49a365027c7e7620d91ab383bac593366a650feb
(link)
#163935 Use BasicBlock::start_location and Location::START 64635941417d7b84a8055e8706e89ec9b1520f26
(link)
#163949 disable next-solver with higher-ranked-assumptions 6b1a8f8e95003a13c9b8a5690d02e543f95084ab
(link)
#163951 relax_elf_relocations is x86-only 0b098eb0b0a5c1783be03e2a66bd9c295583a005
(link)
#163968 Remove needs-triage label from relnotes issues 1005da9e91c0b0a708b72728291b67a31dca06f5
(link)

parent commit: 42cfc04dea

In the case of a perf regression, run the following command with the SHAs of each PR you suspect might be the cause: @rust-timer triage $SHA $SHA $SHA..., or run @rust-timer triage all to benchmark all rollup members.

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

Labels

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 F-autodiff `#![feature(autodiff)]` 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-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.