Skip to content

Rustc pull update#2802

Merged
reddevilmidzy merged 9 commits intomainfrom
rustc-pull
Mar 23, 2026
Merged

Rustc pull update#2802
reddevilmidzy merged 9 commits intomainfrom
rustc-pull

Conversation

@workflows-rustc-dev-guide
Copy link

Latest update from rustc.

bors and others added 9 commits March 18, 2026 15:01
…ochenkov

Abstract AST lowering resolver



This PR adds new methods for `ResolverAstLoweringExt` for future use in rust-lang/rust#153489 and abstracts resolver in lowering through generic parameters.

> ~This PR splits resolver for AST lowering into two parts: mutable and readonly. This will allow us to use borrowed resolver in rust-lang/rust#153489, when we will not steal but borrow resolver from resolve stage.~

Second step for rust-lang/rust#153489.

r? @petrochenkov
Add missing `track_caller` to overflowing trait methods

Fixes rust-lang/rust#152599 by adding `#[track_caller]` to arithmetic trait methods (`Neg`, `Shl`, `ShlAssign`, `Shr` and `ShrAssign`) so overflow panics report the correct call site instead of the trait definition.
Do not shallow resolve to root var while fudging



Fixes rust-lang/rust#153816 and fixes rust-lang/rust#153849

In rust-lang/rust#151380, I thought that whether shallow resolve to root var or not wouldn't affect the actual type inferencing, but it isn't true for the fudge, in which we discard all newly created relationships between unresolved inference variables 😅

r? lcnr
These queries appear to have been using `anon` for its side-effect of making
them ineligible for forcing.

According to their comments and also `tests/incremental/issue-61323.rs`, these
queries want to avoid forcing so that if a cycle does occur, the whole cycle
will be on the query stack for the cycle handler to find.
We still have some anon-task machinery for `DepKind::TraitSelect` tasks, but
there are no longer any queries that use the `anon` modifier.
Remove the `anon` query modifier



Prior experiments:
- rust-lang/rust#152268
- rust-lang/rust#153996

[Zulip thread: *Removing the `anon` query modifier*](https://rust-lang.zulipchat.com/#narrow/channel/582699-t-compiler.2Fquery-system/topic/Removing.20the.20.60anon.60.20query.20modifier/with/580760962)

---

There are currently three queries that use the `anon` modifier:
- `check_representability`
- `check_representability_adt_ty`
- `erase_and_anonymize_regions_ty`

It seems that none of them are using `anon` in an essential way.

According to comments and tests, the *representability* queries mainly care about not being eligible for forcing (despite having a recoverable key type), so that if a cycle does occur then the entire cycle will be on the query stack. Replacing `anon` with a new `no_force` modifier gives a modest perf improvement.

The `erase_and_anonymize_regions_ty` query appears to be using `anon` to reduce the dep-graph overhead of a query that is expected to not call any other queries (and thus have no dependencies). Replacing `anon` with either `no_hash` or nothing appears to give only a very small perf hit on `cargo` benchmarks, which is justified by the fact that it lets us remove a lot of machinery for anonymous queries.

We still need to retain some of the machinery for anonymous *tasks*, because the non-query task `DepKind::TraitSelect` still uses it.

---

I have some ideas for a follow-up that will reduce dep-graph overhead by replacing *all* zero-dependency nodes with a singleton node, but I want to keep that separate in case it causes unexpected issues and needs to be bisected or reverted.
This updates the rust-version file to 562dee4820c458d823175268e41601d4c060588a.
@rustbot
Copy link
Collaborator

rustbot commented Mar 23, 2026

Thanks for the PR. If you have write access, feel free to merge this PR if it does not need reviews. You can request a review using r? rustc-dev-guide or r? <username>.

@rustbot rustbot added the S-waiting-on-review Status: this PR is waiting for a reviewer to verify its content label Mar 23, 2026
@reddevilmidzy reddevilmidzy merged commit 034fcbf into main Mar 23, 2026
1 check passed
@rustbot rustbot removed the S-waiting-on-review Status: this PR is waiting for a reviewer to verify its content label Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants