Skip to content

Conversation

matthiaskrgr
Copy link
Member

@matthiaskrgr matthiaskrgr commented Oct 7, 2025

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

folkertdev and others added 17 commits September 22, 2025 12:30
This commit adds a new tier 3 target to rustc, `wasm32-wasip3`. This
follows in the footsteps of the previous `wasm32-wasip2` target and is
used to represent binding to the WASIp3 set of APIs managed by the WASI
subgroup to the WebAssembly Community Group.

As of now the WASIp3 set of APIs are not finalized nor standardized.
They're in the process of doing so and the current trajectory is to have
the APIs published in December of this year. The goal here is to get the
wheels turning in Rust to have the target in a
more-ready-than-nonexistent state by the time this happens in December.

For now the `wasm32-wasip3` target looks exactly the same as
`wasm32-wasip2` except that `target_env = "p3"` is specified. This
indicates to crates in the ecosystem that WASIp3 APIs should be used,
such as the [`wasip3` crate]. Over time this target will evolve as
implementation in guest toolchains progress, notably:

* The standard library will use WASIp3 APIs natively once they're
  finalized in the WASI subgroup.
* Support through `wasi-libc` will be updated to use WASIp3 natively
  which Rust will then transitively use.
* Longer-term, features such as cooperative multithreading will be added
  to the WASIp3-track of targets to enable using `std::thread`, for
  example, on this target.

These changes are all expected to be non-breaking changes for users of
this target. Runtimes supporting WASIp3, currently Wasmtime and Jco,
support WASIp2 APIs as well and will work with components whether or not
they import WASIp2, both WASIp2 and WASIp3, or just WASIp3 APIs. This
means that changing the internal implementation details of libstd over
time is expected to be a non-breaking change.

[`wasip3` crate]: https://crates.io/crates/wasip3
Previously, `x test collect-license-metadata` gave the following message
on errors:
```
gathering license information from REUSE (this might take a minute...)
finished gathering the license information from REUSE in 78.69s
loading existing license information
The existing /home/runner/work/ferrocene/ferrocene/license-metadata.json
file is out of date.
Run ./x run collect-license-metadata to update it.
Error: The existing
/home/runner/work/ferrocene/ferrocene/license-metadata.json file doesn't
match what REUSE reports.
Bootstrap failed while executing `test collect-license-metadata`
```

Notable, this doesn't actually say what went wrong.
Print a diff in addition so it's more clear what broke:
```
...
                "license": {
                   "copyright": [
+                    "2010 The Rust Project Developers",
                     "2016, 2017, 2018, 2019, 2020, 2021 AXE Consultants. All Rights",
+                    "License. Subject to the terms and conditions of this",
                     "Notice",
-                    "The Ferrocene Developers"
+                    "The Ferrocene Developers",
+                    "[yyyy] [name of copyright owner]"
                   ],
...
```

Currently, this prints the entire text of the JSON file as context.
That's not ideal, but it's rare for this to fail, so I think it's ok for
now.

I considered using `assert_json_diff` instead of `similar`, but its
errors are a lot harder to read IMO, even though they are better at
omitting unnecessary context:

```
Diff: json atoms at path ".files.children[0].children[10].license.copyright[0]" are not equal:
    lhs:
        "2016 The Fuchsia Authors"
    rhs:
        "2019 The Crossbeam Project Developers"

json atoms at path ".files.children[0].children[10].license.spdx" are not equal:
    lhs:
        "BSD-2-Clause AND (Apache-2.0 OR MIT)"
    rhs:
        "Apache-2.0 OR MIT"

json atom at path ".files.children[0].children[10].children" is missing from lhs

json atoms at path ".files.children[0].children[10].name" are not equal:
    lhs:
        "library/std/src/sys/sync/mutex/fuchsia.rs"
    rhs:
        "library/std/src/sync/mpmc"
...
```
Few tests are larger than a handful of kilobytes, and nowadays we scan the
whole file for directives anyway, so there's little reason not to just read the
whole thing up-front.

This avoids having to deal with I/O within `iter_directives`, which should make
it easier to overhaul directive processing.
…patible, r=rcvalle

kcfi: only reify trait methods when dyn-compatible

fixes rust-lang#146853

Only generate a `ReifyShim` for trait method calls if the trait is dyn-compatible.

Until now kcfi would generate a `ReifyShim` whenever a trait method was cast to a function pointer. But technically the shim is only needed for dyn-compatible traits (where the method might end up in a vtable).

Up to this point that was only slightly inefficient, but in combination with c-variadic trait methods it is wrong. For c-variadic trait methods the generated shim is incorrect, and that is why c-variadic methods make a trait no longer dyn-compatible: we should simply never generate a `ReifyShim` that is c-variadic.

With this change the documentation on `ReifyReason` is now actually correct:

>  If KCFI is enabled, creating a function pointer from a method on a dyn-compatible trait. This includes the case of converting `::call`-like methods on closure-likes to function pointers.

cc ```@maurer``` ```@workingjubilee```

r? ```@rcvalle```
Add a new `wasm32-wasip3` target to Rust

This commit adds a new tier 3 target to rustc, `wasm32-wasip3`. This follows in the footsteps of the previous `wasm32-wasip2` target and is used to represent binding to the WASIp3 set of APIs managed by the WASI subgroup to the WebAssembly Community Group.

As of now the WASIp3 set of APIs are not finalized nor standardized. They're in the process of doing so and the current trajectory is to have the APIs published in December of this year. The goal here is to get the wheels turning in Rust to have the target in a
more-ready-than-nonexistent state by the time this happens in December.

For now the `wasm32-wasip3` target looks exactly the same as `wasm32-wasip2` except that `target_env = "p3"` is specified. This indicates to crates in the ecosystem that WASIp3 APIs should be used, such as the [`wasip3` crate]. Over time this target will evolve as implementation in guest toolchains progress, notably:

* The standard library will use WASIp3 APIs natively once they're finalized in the WASI subgroup.
* Support through `wasi-libc` will be updated to use WASIp3 natively which Rust will then transitively use.
* Longer-term, features such as cooperative multithreading will be added to the WASIp3-track of targets to enable using `std::thread`, for example, on this target.

These changes are all expected to be non-breaking changes for users of this target. Runtimes supporting WASIp3, currently Wasmtime and Jco, support WASIp2 APIs as well and will work with components whether or not they import WASIp2, both WASIp2 and WASIp3, or just WASIp3 APIs. This means that changing the internal implementation details of libstd over time is expected to be a non-breaking change.

[`wasip3` crate]: https://crates.io/crates/wasip3
cg_llvm: Consistently import `llvm::Type` and `llvm::Value`

We already have other modules that import these types and other types from `llvm`, so having the re-exports `type_::Type` and `value::Value` just distracts rust-analyzer and results in messier and less-consistent imports.

No functional change.
…inference-error, r=chenyukang

Fix; correct placement of type inference error for method calls

Addresses a FIXME for displaying errors on method calls;

Before;
```
error[E0282]: type annotations needed
  --> /<location>/src/main.rs:48:15
   |
## |             e.is_conversion_error();
   |               ^^^^^^^^^^^^^^^^^^^ cannot infer type
```

After;

```
error[E0282]: type annotations needed
  --> /<location>/src/main.rs:48:15
   |
## |             e.is_conversion_error();
   |             ^ cannot infer type
```
collect-license-metadata: Print a diff of the expected output

Previously, `x test collect-license-metadata` gave the following message on errors:
```
gathering license information from REUSE (this might take a minute...)
finished gathering the license information from REUSE in 78.69s
loading existing license information
The existing /home/runner/work/ferrocene/ferrocene/license-metadata.json
file is out of date.
Run ./x run collect-license-metadata to update it.
Error: The existing
/home/runner/work/ferrocene/ferrocene/license-metadata.json file doesn't
match what REUSE reports.
Bootstrap failed while executing `test collect-license-metadata`
```

Notable, this doesn't actually say what went wrong. Print a diff in addition so it's more clear what broke:
```
...
                "license": {
                   "copyright": [
+                    "2010 The Rust Project Developers",
                     "2016, 2017, 2018, 2019, 2020, 2021 AXE Consultants. All Rights",
+                    "License. Subject to the terms and conditions of this",
                     "Notice",
-                    "The Ferrocene Developers"
+                    "The Ferrocene Developers",
+                    "[yyyy] [name of copyright owner]"
                   ],
...
```

Currently, this prints the entire text of the JSON file as context. That's not ideal, but it's rare for this to fail, so I think it's ok for now.

I considered using `assert_json_diff` instead of `similar`, but its errors are a lot harder to read IMO, even though they are better at omitting unnecessary context:

```
Diff: json atoms at path ".files.children[0].children[10].license.copyright[0]" are not equal:
    lhs:
        "2016 The Fuchsia Authors"
    rhs:
        "2019 The Crossbeam Project Developers"

json atoms at path ".files.children[0].children[10].license.spdx" are not equal:
    lhs:
        "BSD-2-Clause AND (Apache-2.0 OR MIT)"
    rhs:
        "Apache-2.0 OR MIT"

json atom at path ".files.children[0].children[10].children" is missing from lhs

json atoms at path ".files.children[0].children[10].name" are not equal:
    lhs:
        "library/std/src/sys/sync/mutex/fuchsia.rs"
    rhs:
        "library/std/src/sync/mpmc"
...
```
compiletest: Read the whole test file before parsing directives

Few tests are larger than a handful of kilobytes, and nowadays we scan the whole file for directives anyway, so there's little reason not to just read the whole thing up-front.

This avoids having to deal with I/O within `iter_directives`, which should make it easier to overhaul directive processing.

r? jieyouxu
@rustbot rustbot added A-compiletest Area: The compiletest test runner A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-testsuite Area: The testsuite used to check the correctness of rustc F-autodiff `#![feature(autodiff)]` PG-exploit-mitigations Project group: Exploit mitigations 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. rollup A PR which is a rollup labels Oct 7, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Oct 7, 2025

📌 Commit b5c3247 has been approved by matthiaskrgr

It is now in the queue for this repository.

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 7, 2025
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Oct 7, 2025
@bors
Copy link
Collaborator

bors commented Oct 7, 2025

⌛ Testing commit b5c3247 with merge f6aa851...

@bors
Copy link
Collaborator

bors commented Oct 7, 2025

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing f6aa851 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 7, 2025
@bors bors merged commit f6aa851 into rust-lang:master Oct 7, 2025
11 checks passed
@rustbot rustbot added this to the 1.92.0 milestone Oct 7, 2025
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#146865 kcfi: only reify trait methods when dyn-compatible 33da95c598be6d82cd7f4bd86e250bee7212c413 (link)
#147205 Add a new wasm32-wasip3 target to Rust a8e60434d6ebda865c40d7463e183c5a074334cb (link)
#147322 cg_llvm: Consistently import llvm::Type and llvm::Value d5eec92a276140ea7e32a35c29c5c99bf9ade7d0 (link)
#147398 Fix; correct placement of type inference error for method c… 18d81e0e78a0e6daf49682be69deda75bd783834 (link)
#147410 Update S-waiting-on-team refs to new `S-waiting-on-{team}… d372510e37f723a9110cc1bc80134e259950dbcc (link)
#147422 collect-license-metadata: Print a diff of the expected outp… 80ef9fd2eaaca2644803f3950c143dc6d64c0ab5 (link)
#147431 compiletest: Read the whole test file before parsing direct… ca856d8bef0ba7526505cc12f74ef55f705af35f (link)
#147433 Fix doc comment 32dd56b5a0c983dba7caf04adff245116708231a (link)

previous master: d62f33a7c6

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

github-actions bot commented Oct 7, 2025

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 d62f33a (parent) -> f6aa851 (this PR)

Test differences

Show 31 test diffs

Stage 0

  • spec::tests::wasm32_wasip3: [missing] -> pass (J0)

Stage 1

  • [assembly] tests/assembly-llvm/targets/targets-elf.rs#wasm32_wasip3: [missing] -> pass (J0)
  • [codegen] tests/codegen-llvm/sanitizer/kcfi/fn-ptr-reify-shim.rs#aarch64: [missing] -> pass (J0)
  • [codegen] tests/codegen-llvm/sanitizer/kcfi/fn-ptr-reify-shim.rs#x86_64: [missing] -> pass (J0)
  • [ui] tests/ui/sanitizer/kcfi-c-variadic.rs: [missing] -> pass (J0)
  • spec::tests::wasm32_wasip3: [missing] -> pass (J2)

Stage 2

  • [assembly] tests/assembly-llvm/targets/targets-elf.rs#wasm32_wasip3: [missing] -> pass (J1)
  • [codegen] tests/codegen-llvm/sanitizer/kcfi/fn-ptr-reify-shim.rs#aarch64: [missing] -> pass (J1)
  • [codegen] tests/codegen-llvm/sanitizer/kcfi/fn-ptr-reify-shim.rs#x86_64: [missing] -> pass (J1)
  • [ui] tests/ui/sanitizer/kcfi-c-variadic.rs: [missing] -> pass (J3)
  • [ui] tests/ui/sanitizer/kcfi-c-variadic.rs: [missing] -> ignore (ignored on targets without kernel CFI sanitizer) (J4)

Additionally, 20 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 f6aa851dba4b4509ab7e4f3a407b0b1e72a89e4c --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-apple: 7332.3s -> 8558.7s (16.7%)
  2. x86_64-gnu-miri: 4704.3s -> 5410.9s (15.0%)
  3. dist-x86_64-netbsd: 4615.5s -> 5267.0s (14.1%)
  4. dist-aarch64-windows-gnullvm: 4617.5s -> 5188.5s (12.4%)
  5. dist-x86_64-freebsd: 5052.8s -> 5487.2s (8.6%)
  6. pr-check-1: 1530.2s -> 1654.3s (8.1%)
  7. aarch64-msvc-2: 4874.9s -> 5228.3s (7.2%)
  8. x86_64-gnu-llvm-20-2: 6044.6s -> 5641.8s (-6.7%)
  9. i686-gnu-nopt-1: 8275.5s -> 7727.8s (-6.6%)
  10. aarch64-gnu-llvm-20-2: 2374.4s -> 2530.4s (6.6%)
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-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
Prepare workflow directory
Prepare all required actions
Getting action download info
Download action repository 'actions/checkout@v5' (SHA:08c6903cd8c0fde910a37f88322edcfb5dd907a8)
Complete job name: DockerHub mirror
##[group]Run actions/checkout@v5
with:
  persist-credentials: false
  repository: rust-lang/rust
  token: ***
---
http.https://github.com/.extraheader
[command]/usr/bin/git config --local --unset-all http.https://github.com/.extraheader
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
##[endgroup]
##[group]Run echo "***" | docker login ghcr.io -u rust-lang --password-stdin
echo "***" | docker login ghcr.io -u rust-lang --password-stdin
shell: /usr/bin/bash -e {0}
##[endgroup]
Error response from daemon: Get "https://ghcr.io/v2/": net/http: request canceled (Client.Timeout exceeded while awaiting headers)
##[error]Process completed with exit code 1.
Post job cleanup.

@rust-timer
Copy link
Collaborator

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

Max RSS (memory usage)

Results (primary 1.1%, secondary -2.4%)

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

mean range count
Regressions ❌
(primary)
6.0% [6.0%, 6.0%] 1
Regressions ❌
(secondary)
2.1% [2.1%, 2.1%] 1
Improvements ✅
(primary)
-1.3% [-1.6%, -0.9%] 2
Improvements ✅
(secondary)
-3.9% [-4.7%, -2.7%] 3
All ❌✅ (primary) 1.1% [-1.6%, 6.0%] 3

Cycles

Results (secondary 1.6%)

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)
1.6% [1.0%, 2.1%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 470.014s -> 472.758s (0.58%)
Artifact size: 388.40 MiB -> 388.40 MiB (0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiletest Area: The compiletest test runner A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-testsuite Area: The testsuite used to check the correctness of rustc F-autodiff `#![feature(autodiff)]` merged-by-bors This PR was explicitly merged by bors. PG-exploit-mitigations Project group: Exploit mitigations 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-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.