Skip to content

Rollup of 9 pull requests#153723

Open
JonathanBrouwer wants to merge 22 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-zP7J3H2
Open

Rollup of 9 pull requests#153723
JonathanBrouwer wants to merge 22 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-zP7J3H2

Conversation

@JonathanBrouwer
Copy link
Contributor

Successful merges:

r? @ghost

Create a similar rollup

TaKO8Ki and others added 22 commits March 8, 2026 23:04
There is a bunch of complexity supporting the "cannot check whether the
hidden type of opaque type satisfies auto traits" error that shows up in
`tests/ui/impl-trait/auto-trait-leak.rs`. This is an obscure error that
shows up in a single test. If we are willing to downgrade that error
message to a cycle error, we can do the following.

- Simplify the `type_of_opaque` return value.
- Remove the `cycle_stash` query modifier.
- Remove the `CyclePlaceholder` type.
- Remove the `SelectionError::OpaqueTypeAutoTraitLeakageUnknown`
  variant.
- Remove a `FromCycleError` impl.
- Remove `report_opaque_type_auto_trait_leakage`.
- Remove the `StashKey::Cycle` variant.
- Remove the `CycleErrorHandling::Stash` variant.

That's a lot! I think this is a worthwhile trade-off.
This simplifies the inner function's signature, and makes it more consistent
with other uses of `for_each_query_vtable!`.
…mann

Avoid ICE when an EII declaration conflicts with a constructor

Fixes rust-lang#153502

When an `#[eii]` declaration conflicts with a tuple-struct constructor of the same name, error recovery can resolve
the EII target to the constructor instead of the generated foreign item. `compare_eii_function_types` then assumes
that target is a foreign function and later ICEs while building diagnostics.

This pull request adds an early guard in `compare_eii_function_types` to skip EII signature comparison unless the resolved target is actually a foreign function.
Simplify `type_of_opaque`.

There is a bunch of complexity supporting the "cannot check whether the hidden type of opaque type satisfies auto traits" error that shows up in `tests/ui/impl-trait/auto-trait-leak.rs`. This is an obscure error that shows up in a single test. If we are willing to downgrade that error message to a cycle error, we can do the following.

- Simplify the `type_of_opaque` return value.
- Remove the `cycle_stash` query modifier.
- Remove the `CyclePlaceholder` type.
- Remove the `SelectionError::OpaqueTypeAutoTraitLeakageUnknown` variant.
- Remove a `FromCycleError` impl.
- Remove `report_opaque_type_auto_trait_leakage`.
- Remove the `StashKey::Cycle` variant.
- Remove the `CycleErrorHandling::Stash` variant.

That's a lot! I think this is a worthwhile trade-off.

r? @oli-obk
…li-obk

interpret: go back to regular string interpolation for error messages

Using the translatable diagnostic infrastructure adds a whole lot of boilerplate which isn't actually useful for const-eval errors, so let's get rid of it. This effectively reverts rust-lang#111677. That PR effectively added 1000 lines and this PR only removes around 600 -- the difference is caused by (a) keeping some of the types around for validation, where we can use them to share error strings and to trigger the extra help for pointer byte shenanigans during CTFE, and (b) this not being a full revert of rust-lang#111677; I am not touching diagnostics outside the interpreter such as all the const-checking code which also got converted to fluent in the same PR.

The last commit does something similar for `LayoutError`, which also helps deduplicate a bunch of error strings. I can make that into a separate PR if you prefer.

r? @oli-obk
Fixes rust-lang#113117
Fixes rust-lang#116764
Fixes rust-lang#112618
…abels, r=estebank

Unify same-span labels in move error diagnostics

Fixes rust-lang#153506.

When there's a single binding in a move error, we emit "data moved here" and "move occurs because ... does not implement the Copy trait" as two separate labels on the same span. This combines them into one label via a new `TypeNoCopy::LabelMovedHere` variant.

The multi-binding case still uses separate labels + a note since they point at different spans.

cc @estebank
…i865

mir-opt: Drop invalid debuginfos after SingleUseConsts.

Fixes rust-lang#153601.
…cote

Introduce `for_each_query_vtable!` to move more code out of query macros

After rust-lang#153114 moved a few for-each-query functions into the big `rustc_query_impl::plumbing` macro, I have found that those functions became much harder to navigate and modify, because they no longer have access to ordinary IDE features in rust-analyzer. Even *finding* the functions is considerably harder, because a plain go-to-definition no longer works smoothly.

This PR therefore tries to move as much of that code back out of the macro as possible, with the aid of a smaller `for_each_query_vtable!` helper macro. A typical use of that macro looks like this:

```rust
for_each_query_vtable!(ALL, tcx, |query| {
    query_key_hash_verify(query, tcx);
});
```

The result is an outer function consisting almost entirely of plain Rust code, with all of the usual IDE affordances expected of normal Rust code. Because it uses plain Rust syntax, it can also be formatted automatically by rustfmt.

Adding another layer of macro-defined macros is not something I propose lightly, but in this case I think the improvement is well worth it:
- The outer functions can once again be defined as “normal” Rust functions, right next to their corresponding inner functions, making navigation and modification much easier.
- The closure expression is ordinary Rust code that simply gets repeated ~300 times in the expansion, once for each query, in order to account for the variety of key/value/cache types used by different queries. Even within the closure expression, IDE features still *mostly* work, which is an improvement over the status quo.
- For future maintainers looking at the call site, the macro's effect should hopefully be pretty obvious and intuitive, reducing the need to even look at the helper macro. And the helper macro itself is largely straightforward, with its biggest complication being that it necessarily uses the `$name` metavar from the outer macro.

There should be no change to compiler behaviour.

r? nnethercote (or compiler)
…t, r=Kobzol

Make Enzyme has dependent on LLVM hash

This issue was encountered a few times by autodiff contributors.
Closes rust-lang#152969

Just adding the llvm hash here triggered a rebuild of Enzyme locally, but I'll admit I didn't try it with a real llvm submodule update.

r? @Kobzol
remove `.ftl` checks from tidy

These files have been removed following rust-lang/compiler-team#959.
Part of rust-lang#151366.
… r=RalfJung

doc/rustc: clarify how to contact arm-maintainers

Addresses feedback from rust-lang#147268 (comment)
@rust-bors rust-bors bot added the rollup A PR which is a rollup label Mar 11, 2026
@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-tidy Area: The tidy tool 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. labels Mar 11, 2026
@JonathanBrouwer
Copy link
Contributor Author

@bors r+ rollup=never p=5

rust-bors bot pushed a commit that referenced this pull request Mar 11, 2026
…uwer

Rollup of 9 pull requests

Successful merges:

 - #153571 (Avoid ICE when an EII declaration conflicts with a constructor)
 - #153581 (Simplify `type_of_opaque`.)
 - #153611 (interpret: go back to regular string interpolation for error messages)
 - #153635 (Unify same-span labels in move error diagnostics)
 - #153660 (mir-opt: Drop invalid debuginfos after SingleUseConsts.)
 - #153685 (Introduce `for_each_query_vtable!` to move more code out of query macros)
 - #153671 (Make Enzyme has dependent on LLVM hash)
 - #153710 (remove `.ftl` checks from tidy)
 - #153720 (doc/rustc: clarify how to contact arm-maintainers)
@rust-bors rust-bors bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 11, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 11, 2026

💔 Test for 0d711f1 failed: CI, CI

@JonathanBrouwer
Copy link
Contributor Author

@bors retry
@bors treeclosed=1000

@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 Mar 11, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 11, 2026

Tree closed for PRs with priority less than 1000.

@JonathanBrouwer
Copy link
Contributor Author

@bors p=1000

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Mar 11, 2026
…uwer

Rollup of 9 pull requests

Successful merges:

 - #153571 (Avoid ICE when an EII declaration conflicts with a constructor)
 - #153581 (Simplify `type_of_opaque`.)
 - #153611 (interpret: go back to regular string interpolation for error messages)
 - #153635 (Unify same-span labels in move error diagnostics)
 - #153660 (mir-opt: Drop invalid debuginfos after SingleUseConsts.)
 - #153685 (Introduce `for_each_query_vtable!` to move more code out of query macros)
 - #153671 (Make Enzyme has dependent on LLVM hash)
 - #153710 (remove `.ftl` checks from tidy)
 - #153720 (doc/rustc: clarify how to contact arm-maintainers)
@rust-bors rust-bors bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 11, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 11, 2026

💔 Test for b5d3e7e failed: CI. Failed job:

@JonathanBrouwer
Copy link
Contributor Author

@bors retry

@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 Mar 11, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 11, 2026

⌛ Testing commit 67b0309 with merge 937011f...

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

rust-bors bot pushed a commit that referenced this pull request Mar 11, 2026
…uwer

Rollup of 9 pull requests

Successful merges:

 - #153571 (Avoid ICE when an EII declaration conflicts with a constructor)
 - #153581 (Simplify `type_of_opaque`.)
 - #153611 (interpret: go back to regular string interpolation for error messages)
 - #153635 (Unify same-span labels in move error diagnostics)
 - #153660 (mir-opt: Drop invalid debuginfos after SingleUseConsts.)
 - #153685 (Introduce `for_each_query_vtable!` to move more code out of query macros)
 - #153671 (Make Enzyme has dependent on LLVM hash)
 - #153710 (remove `.ftl` checks from tidy)
 - #153720 (doc/rustc: clarify how to contact arm-maintainers)
@rust-log-analyzer

This comment was marked as outdated.

@JonathanBrouwer

This comment was marked as outdated.

@rust-bors

This comment was marked as outdated.

@JonathanBrouwer
Copy link
Contributor Author

@bors treeopen

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 11, 2026

Tree is now open for merging.

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-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-tidy Area: The tidy tool 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.