Skip to content

Conversation

jhpratt
Copy link
Member

@jhpratt jhpratt commented Sep 30, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

alexcrichton and others added 11 commits September 11, 2025 16:13
This commit is an update to the `AbortUnwindingCalls` MIR pass in the
compiler. Specifically a new boolean is added for "can this target
possibly unwind" and if that's `false` then terminators are all adjusted
to be unreachable/not present. The end result is that this fixes 140293
for wasm targets.

The motivation for this PR is that currently on WebAssembly targets the
usage of the `C-unwind` ABI can lead LLVM to either (a) emit
exception-handling instructions or (b) hit a LLVM-ICE-style codegen
error. WebAssembly as a base instruction set does not support unwinding
at all, and a later proposal to WebAssembly, the exception-handling
proposal, was what enabled this. This means that the current intent of
WebAssembly targets is that they maintain the baseline of "don't emit
exception-handling instructions unless enabled". The commit here is
intended to restore this behavior by skipping these instructions even
when `C-unwind` is present.

Exception-handling is a relatively tricky and also murky topic in
WebAssembly, however. There are two sets of instructions LLVM can emit
for WebAssembly exceptions, Rust's Emscripten target supports
exceptions, WASI targets do not, the LLVM flags to enable this are not
always obvious, and additionally this all touches on "changing
exception-handling behavior should be a target-level concern, not a
feature". Effectively WebAssembly's exception-handling integration into
Rust is not finalized at this time. The best idea at this time is that a
parallel set of targets will eventually be added which support
exceptions, but it's not clear if/when to do this. In the meantime the
goal is to keep existing targets working while still enabling
experimentation with exception-handling with `-Zbuild-std` and various
permutations of LLVM flags.

To that extent this commit does not blanket disable these landing pads
and cleanup routines for WebAssembly but instead checks to see if
panic=unwind is enabled or if `+exception-handling` is enabled. Tests
are updated here as well to account for this where, by default, using a
`C-unwind` ABI won't affect Rust codegen at all. If
`+exception-handling` is enabled, however, then Rust codegen will look
like native platforms where exceptions are caught and the program aborts.
More-or-less I've done my best to keep exceptions working on wasm where
it's possible to have them work, but turned them off where they're not
supposed to be emitted.
to avoid overflow from proving `for<'a> opaque<'a>: Sized`
Make macOS dist build configuration match where reasonable

r? `@madsmtm`
…ons, r=bjorn3

Skip cleanups on unsupported targets

This commit is an update to the `AbortUnwindingCalls` MIR pass in the compiler. Specifically a new boolean is added for "can this target possibly unwind" and if that's `false` then terminators are all adjusted to be unreachable/not present. The end result is that this fixes rust-lang#140293 for wasm targets.

The motivation for this PR is that currently on WebAssembly targets the usage of the `C-unwind` ABI can lead LLVM to either (a) emit exception-handling instructions or (b) hit a LLVM-ICE-style codegen error. WebAssembly as a base instruction set does not support unwinding at all, and a later proposal to WebAssembly, the exception-handling proposal, was what enabled this. This means that the current intent of WebAssembly targets is that they maintain the baseline of "don't emit exception-handling instructions unless enabled". The commit here is intended to restore this behavior by skipping these instructions even when `C-unwind` is present.

Exception-handling is a relatively tricky and also murky topic in WebAssembly, however. There are two sets of instructions LLVM can emit for WebAssembly exceptions, Rust's Emscripten target supports exceptions, WASI targets do not, the LLVM flags to enable this are not always obvious, and additionally this all touches on "changing exception-handling behavior should be a target-level concern, not a feature". Effectively WebAssembly's exception-handling integration into Rust is not finalized at this time. The best idea at this time is that a parallel set of targets will eventually be added which support exceptions, but it's not clear if/when to do this. In the meantime the goal is to keep existing targets working while still enabling experimentation with exception-handling with `-Zbuild-std` and various permutations of LLVM flags.

To that extent this commit does not blanket disable these landing pads and cleanup routines for WebAssembly but instead checks to see if panic=unwind is enabled or if `+exception-handling` is enabled. Tests are updated here as well to account for this where, by default, using a `C-unwind` ABI won't affect Rust codegen at all. If `+exception-handling` is enabled, however, then Rust codegen will look like native platforms where exceptions are caught and the program aborts. More-or-less I've done my best to keep exceptions working on wasm where it's possible to have them work, but turned them off where they're not supposed to be emitted.

Closes rust-lang#140293
…r=BoxyUwU

builtin `Fn`-trait impls: instantiate binder before the return type `Sized` check

fixes
- rust-lang/trait-system-refactor-initiative#220
- rust-lang/trait-system-refactor-initiative#204

r? `@BoxyUwU`
…ore-stripping-items, r=lolbinarycat

[rustdoc] Move doc cfg propagation pass before items stripping passes

Follow-up of rust-lang#138907.

r? lolbinarycat
@rustbot rustbot added A-CI Area: Our Github Actions CI A-testsuite Area: The testsuite used to check the correctness of rustc 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-infra Relevant to the infrastructure 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) rollup A PR which is a rollup labels Sep 30, 2025
@jhpratt
Copy link
Member Author

jhpratt commented Sep 30, 2025

@bors r+ rollup=never p=4

@bors
Copy link
Collaborator

bors commented Sep 30, 2025

📌 Commit 745b8f6 has been approved by jhpratt

It is now in the queue for this repository.

@bors bors 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 Sep 30, 2025
@bors
Copy link
Collaborator

bors commented Sep 30, 2025

⌛ Testing commit 745b8f6 with merge c5dc558...

@bors
Copy link
Collaborator

bors commented Sep 30, 2025

☀️ Test successful - checks-actions
Approved by: jhpratt
Pushing c5dc558 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 30, 2025
@bors bors merged commit c5dc558 into rust-lang:master Sep 30, 2025
11 checks passed
@rustbot rustbot added this to the 1.92.0 milestone Sep 30, 2025
@jhpratt jhpratt deleted the rollup-65ooei8 branch September 30, 2025 05:47
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#145883 Make macOS dist build configuration match where reasonable 62bc7fbabf46c62a5be89c33c2470f596d623876 (link)
#146457 Skip cleanups on unsupported targets 84cc77782af5a747e0d907ba1d27068bba23bea4 (link)
#147152 builtin Fn-trait impls: instantiate binder before the ret… 6911204336815514c2776521ff4b8d76cd8c88ba (link)
#147153 [rustdoc] Move doc cfg propagation pass before items stripp… 5c6fc68a3f70f5c7ae2a86157cea707a90e46f08 (link)

previous master: 29b7717de2

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

Copy link
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 29b7717 (parent) -> c5dc558 (this PR)

Test differences

Show 62 test diffs

Stage 1

  • [codegen] tests/codegen-llvm/unwind-abis/c-unwind-abi-panic-abort.rs: pass -> [missing] (J0)
  • [codegen] tests/codegen-llvm/unwind-abis/c-unwind-abi-panic-abort.rs#NONWASM: [missing] -> pass (J0)
  • [codegen] tests/codegen-llvm/unwind-abis/c-unwind-abi-panic-abort.rs#WASM: [missing] -> ignore (only executed when the architecture is wasm32) (J0)
  • [codegen] tests/codegen-llvm/unwind-abis/c-unwind-abi-panic-abort.rs#WASMEXN: [missing] -> ignore (only executed when the architecture is wasm32) (J0)
  • [codegen] tests/codegen-llvm/unwind-and-panic-abort.rs: pass -> [missing] (J0)
  • [codegen] tests/codegen-llvm/unwind-and-panic-abort.rs#NONWASM: [missing] -> pass (J0)
  • [codegen] tests/codegen-llvm/unwind-and-panic-abort.rs#WASM: [missing] -> ignore (only executed when the architecture is wasm32) (J0)
  • [codegen] tests/codegen-llvm/unwind-and-panic-abort.rs#WASMEXN: [missing] -> ignore (only executed when the architecture is wasm32) (J0)
  • [codegen] tests/codegen-llvm/wasm_exceptions.rs: ignore (only executed when the architecture is wasm32) -> [missing] (J0)
  • [codegen] tests/codegen-llvm/wasm_exceptions.rs#WASM: [missing] -> ignore (only executed when the architecture is wasm32) (J0)
  • [codegen] tests/codegen-llvm/wasm_exceptions.rs#WASMEXN: [missing] -> ignore (only executed when the architecture is wasm32) (J0)
  • [rustdoc] tests/rustdoc/doc-auto-cfg-public-in-private.rs: [missing] -> pass (J0)
  • [ui] tests/ui/traits/next-solver/opaques/overflow-hr-fn-trait-sized-1.rs: [missing] -> pass (J0)
  • [ui] tests/ui/traits/next-solver/opaques/overflow-hr-fn-trait-sized-2.rs: [missing] -> pass (J0)

Stage 2

  • [codegen] tests/codegen-llvm/unwind-abis/c-unwind-abi-panic-abort.rs: pass -> [missing] (J1)
  • [codegen] tests/codegen-llvm/unwind-abis/c-unwind-abi-panic-abort.rs#NONWASM: [missing] -> pass (J1)
  • [codegen] tests/codegen-llvm/unwind-abis/c-unwind-abi-panic-abort.rs#WASM: [missing] -> ignore (only executed when the architecture is wasm32) (J1)
  • [codegen] tests/codegen-llvm/unwind-abis/c-unwind-abi-panic-abort.rs#WASMEXN: [missing] -> ignore (only executed when the architecture is wasm32) (J1)
  • [codegen] tests/codegen-llvm/unwind-and-panic-abort.rs: pass -> [missing] (J1)
  • [codegen] tests/codegen-llvm/unwind-and-panic-abort.rs#NONWASM: [missing] -> pass (J1)
  • [codegen] tests/codegen-llvm/unwind-and-panic-abort.rs#WASM: [missing] -> ignore (only executed when the architecture is wasm32) (J1)
  • [codegen] tests/codegen-llvm/unwind-and-panic-abort.rs#WASMEXN: [missing] -> ignore (only executed when the architecture is wasm32) (J1)
  • [codegen] tests/codegen-llvm/wasm_exceptions.rs: ignore (only executed when the architecture is wasm32) -> [missing] (J1)
  • [codegen] tests/codegen-llvm/wasm_exceptions.rs#WASM: [missing] -> ignore (only executed when the architecture is wasm32) (J1)
  • [codegen] tests/codegen-llvm/wasm_exceptions.rs#WASMEXN: [missing] -> ignore (only executed when the architecture is wasm32) (J1)
  • [ui] tests/ui/traits/next-solver/opaques/overflow-hr-fn-trait-sized-1.rs: [missing] -> pass (J2)
  • [ui] tests/ui/traits/next-solver/opaques/overflow-hr-fn-trait-sized-2.rs: [missing] -> pass (J2)
  • [rustdoc] tests/rustdoc/doc-auto-cfg-public-in-private.rs: [missing] -> pass (J3)

Additionally, 34 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 c5dc558e6cca43958616b268b66c49763f2e9e9a --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-aarch64-linux: 6296.2s -> 8381.2s (33.1%)
  2. dist-loongarch64-linux: 5355.0s -> 6316.2s (17.9%)
  3. x86_64-gnu-miri: 4396.1s -> 5165.1s (17.5%)
  4. pr-check-2: 2277.6s -> 2645.4s (16.1%)
  5. dist-aarch64-apple: 6115.8s -> 7032.5s (15.0%)
  6. x86_64-gnu-debug: 8527.2s -> 7253.3s (-14.9%)
  7. i686-gnu-nopt-1: 7456.8s -> 8543.9s (14.6%)
  8. aarch64-msvc-2: 4994.7s -> 5696.8s (14.1%)
  9. dist-aarch64-msvc: 5183.1s -> 5807.5s (12.0%)
  10. dist-i586-gnu-i586-i686-musl: 4803.2s -> 5378.8s (12.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
Collaborator

Finished benchmarking commit (c5dc558): 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.4% [0.4%, 0.4%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

Results (primary 2.5%)

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

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

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 470.95s -> 468.849s (-0.45%)
Artifact size: 387.69 MiB -> 387.70 MiB (0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-CI Area: Our Github Actions CI A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure 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