Repository navigation
Rollup of 7 pull requests - #164344
Open
Zalathar wants to merge 24 commits into
Open
Rollup of 7 pull requests#164344Zalathar wants to merge 24 commits into
Zalathar wants to merge 24 commits into
Conversation
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.
Member
Author
|
Rollup of everything. @bors r+ rollup=never p=5 force |
Contributor
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Successful merges:
--remap-path-prefixand doctests #164220 (Test the interaction between--remap-path-prefixand doctests)documentationscope #164278 (Output remapped paths in rustdoc JSON with thedocumentationscope)r? @ghost
Create a similar rollup