Skip to content

Rollup of 7 pull requests - #164344

Open
Zalathar wants to merge 24 commits into
rust-lang:mainfrom
Zalathar:rollup-151HO9B
Open

Zalathar wants to merge 24 commits into
rust-lang:mainfrom
Zalathar:rollup-151HO9B

Conversation

@Zalathar

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

ozankenangungor and others added 24 commits October 10, 2026 18:04
Remove the `where Self: Sized` suggestion and the Sized-specific label
suppression so an explicit `Self: Sized` clause is reported like any
other `Self: Trait` bound, and only suggest relaxing the implicit
`Sized` restriction when the failing obligation is that implicit
restriction rather than an explicit where clause of the item.

Also rename the regression tests and add a case for an implicit
`Sized` failure on an associated item with other explicit where
clauses.
This LTO buffer appears to be an implementation detail of the LLVM backend, as
it is not touched by other in-tree backends.

Using OnceLock makes it possible to set the buffer through a shared reference.
This will be necessary when enforcing scoped access to the other contents of
ModuleLlvm.
Codegen code that needs any of `llcx`/`llmod`/`tm` must now access them through
a callback, to ensure that the `'ll` lifetimes are coherent and non-static, and
don't accidentally escape.
This commit migrates the `test-various` job in CI from testing the
`wasm32-wasip1` target to testing the `wasm32-wasip3` target. While
doing so this additionally runs tests with `-Cpanic=unwind` instead of
the historical `-Cpanic=abort` to expand the scope of tests slightly and
run `alloc` tests, for example. The purpose of this change is to start
migrating towards a wasm testing target which has a more fully-featured
`std`, e.g. panics & threads, to run more tests in CI and make it less
of a too-different target. This change was originally proposed at
rust-lang/compiler-team/1039 which contains some more background details
as well.

The major notable change in test coverage here is running tests with
`-Cpanic=unwind`. WebAssembly targets by default still use
`-Cpanic=abort` and this means that large swaths of the test suite do
not execute because they require panicking/unwinding in one way or
another. CI here is configuring wasm targets to specifically enable
unwinding, but only for the testing build. To achieve this a new
`bootstrap.toml` option is added which enables configuring the default
`panic_strategy` for wasm targets -- an option only intended to be used
in testing.

Most of this change is adjusting tests for this new testing
infrastructure, some old Wasmtime-related TODOs are cleaned up as well
with an updated build. Notably the `only-wasm32-wasip1` directive for
compiletest is removed and all preexisting tests are migrated to run for
any wasm target. The `run-make` suite in particular is updated to handle
when the wasm target outputs components and the various ABI details of
the wasip3 target.

This change notably does not yet start to run `std`'s test suite for the
`wasm32-wasip3` target. Too much of that test suite requires threads to
be useful to run at this time, and as such running those tests is
delayed until a later time when cooperative threading is enabled.

Closes 163451
…saethlin

Test panics and wasm32-wasip3 in CI, not wasip1

This commit migrates the `test-various` job in CI from testing the `wasm32-wasip1` target to testing the `wasm32-wasip3` target. While doing so this additionally runs tests with `-Cpanic=unwind` instead of the historical `-Cpanic=abort` to expand the scope of tests slightly and run `alloc` tests, for example. The purpose of this change is to start migrating towards a wasm testing target which has a more fully-featured `std`, e.g. panics & threads, to run more tests in CI and make it less of a too-different target. This change was originally proposed at rust-lang/compiler-team#1039 which contains some more background details as well.

The major notable change in test coverage here is running tests with `-Cpanic=unwind`. WebAssembly targets by default still use `-Cpanic=abort` and this means that large swaths of the test suite do not execute because they require panicking/unwinding in one way or another. CI here is configuring wasm targets to specifically enable unwinding, but only for the testing build. To achieve this a new `bootstrap.toml` option is added which enables configuring the default `panic_strategy` for wasm targets -- an option only intended to be used in testing.

Most of this change is adjusting tests for this new testing infrastructure, some old Wasmtime-related TODOs are cleaned up as well with an updated build. Notably the `only-wasm32-wasip1` directive for compiletest is removed and all preexisting tests are migrated to run for any wasm target. The `run-make` suite in particular is updated to handle when the wasm target outputs components and the various ABI details of the wasip3 target.

This change notably does not yet start to run `std`'s test suite for the `wasm32-wasip3` target. Too much of that test suite requires threads to be useful to run at this time, and as such running those tests is delayed until a later time when cooperative threading is enabled.
…gs-ice, r=nikomatsakis

Fix ICE when move expressions reference out-of-scope local bindings

I have added a diagnostic for rejecting out-of-scope local bindings in move expressions.

`tests/ui/move-expr/closure-local-bindings.rs` and `tests/ui/move-expr/move-initializer-local-bindings.rs` are generated by LLM.

r? @nikomatsakis
…xdexh,ShoyuVanilla

Improve diagnostics for non-well-formed associated items

Fixes rust-lang#162368.

With the new solver, this ended up as a projection mismatch instead of reporting the `Sized` requirement from the associated type.

I changed the diagnostic fallback to also check the associated item's own clauses, so it can recover the `Self: Sized` obligation and report E0277 instead. This works the same way for any other `Self: Trait` bound on the item, not just `Sized`.

In this case, the diagnostic now points to the impl type parameter instead of `i32`, and keeps the note for the associated type bound. The `Sized`-specific special casing from the first version is gone after review feedback; in particular, the implicit-`Sized` relaxation suggestion is now skipped when the failing obligation comes from an explicit where clause of the item, where relaxing the implicit restriction wouldn't help.

I also added regression tests for the original case, an existing where-clause, the normal implicit `Sized` case, and a non-impl projection use site.
cg_llvm: Use a callback to enforce scoped lifetimes in ModuleLlvm

Our LLVM backend makes frequent use of `'ll` lifetimes to help uphold soundness when calling into LLVM FFI bindings.

However, the root of those lifetimes is rather sketchy, because ModuleLlvm is happy to hand out things like `&llvm::Context` with *any* lifetime, including the rather terrifying `&'static llvm::Context`. That seems likely to be unsound in general.

To partly mitigate that unsoundness, this PR introduces the requirement that the references owned by ModuleLlvm can only be accessed via a `.with_module_refs` method that takes a `for<'ll>` closure. This helps to ensure that the `'ll` lifetimes must be coherent and non-static, and cannot leak outside of the closure.

Happily, all of the existing call sites can easily be converted to this style, which is a sign that we probably aren't doing anything too weird with those lifetimes right now.

There should be no change to compiler output.
…nic, r=GuillaumeGomez

Test the interaction between `--remap-path-prefix` and doctests

This PR adds a run-make test to test the interaction between `--remap-path-prefix` and doctests.

Related to rust-lang#163895 (comment)
Point at assoc item for trait that needs to be implemented

The line for `ID` is new:

```
note: `Foo` defines an item `ID`, perhaps you need to implement it
  --> $DIR/associated-const-no-item.rs:1:1
   |
LL | trait Foo {
   | ^^^^^^^^^
LL |     const ID: i32;
   |
```
…uillaumeGomez

Output remapped paths in rustdoc JSON with the `documentation` scope

Let's make rustdoc-json respect `--remap-path-prefix` and `--remap-path-scope` (if passed), by using the `documentation` scope.

That's a perfect application for the rustdoc-only `documentation` scope.
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Oct 15, 2026
@rustbot rustbot added A-CI Area: Our Github Actions CI A-compiletest Area: The compiletest test runner A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-run-make Area: port run-make Makefiles to rmake.rs A-rustdoc-json Area: Rustdoc JSON backend labels Oct 15, 2026
@rustbot rustbot added 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-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-infra Relevant to the infrastructure 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Oct 15, 2026
@Zalathar

Copy link
Copy Markdown
Member Author

Rollup of everything.

@bors r+ rollup=never p=5 force

@rust-bors

rust-bors Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 48cbb18 has been approved by Zalathar

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

rust-bors Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

⌛ Testing commit 48cbb18 with merge 420f422...

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

rust-bors Bot pushed a commit that referenced this pull request Oct 15, 2026
Rollup of 7 pull requests

Successful merges:

 - #163132 (Test panics and wasm32-wasip3 in CI, not wasip1)
 - #164076 (Fix ICE when move expressions reference out-of-scope local bindings)
 - #162432 (Improve diagnostics for non-well-formed associated items)
 - #164138 (cg_llvm: Use a callback to enforce scoped lifetimes in ModuleLlvm )
 - #164220 (Test the interaction between `--remap-path-prefix` and doctests)
 - #164225 (Point at assoc item for trait that needs to be implemented)
 - #164278 (Output remapped paths in rustdoc JSON with the `documentation` scope)

This branch has not been deployed

No deployments
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-compiletest Area: The compiletest test runner A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-run-make Area: port run-make Makefiles to rmake.rs A-rustdoc-json Area: Rustdoc JSON backend A-testsuite Area: The testsuite used to check the correctness of rustc 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-infra Relevant to the infrastructure 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. 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.

7 participants