Skip to content

Do not modify resolver outputs during lowering#155460

Open
cjgillot wants to merge 3 commits intorust-lang:mainfrom
cjgillot:unmut-resolver-ast
Open

Do not modify resolver outputs during lowering#155460
cjgillot wants to merge 3 commits intorust-lang:mainfrom
cjgillot:unmut-resolver-ast

Conversation

@cjgillot
Copy link
Copy Markdown
Contributor

@cjgillot cjgillot commented Apr 17, 2026

View all comments

Split from #142830

I believe this achieves the same thing as #153656 but in a much simpler way.

This PR forces AST->HIR lowering to stop mutating resolver outputs. Instead, it manages a few override maps that only live during lowering and are dropped afterwards.

r? @petrochenkov
cc @aerooneqq

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 17, 2026

Some changes occurred in compiler/rustc_ast_lowering/src/format.rs

cc @m-ou-se

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler 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. labels Apr 17, 2026
@cjgillot
Copy link
Copy Markdown
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Apr 17, 2026
Do not modify resolver outputs during lowering
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 17, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 17, 2026

☀️ Try build successful (CI)
Build commit: fd1275a (fd1275a2d0718b26a05018665073cb854870b511, parent: f29256dd1420dc681bf4956e3012ffe9eccdc7e7)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (fd1275a): comparison URL.

Overall result: ❌✅ regressions and improvements - please read:

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +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.1% [0.0%, 0.1%] 5
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.1% [-0.2%, -0.0%] 4
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 2.8%, secondary 3.2%)

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

mean range count
Regressions ❌
(primary)
2.8% [0.9%, 7.3%] 123
Regressions ❌
(secondary)
3.2% [0.9%, 8.0%] 48
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.8% [0.9%, 7.3%] 123

Cycles

Results (secondary -3.7%)

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)
2.0% [2.0%, 2.0%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-5.1% [-8.0%, -2.3%] 4
All ❌✅ (primary) - - 0

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 490.91s -> 488.306s (-0.53%)
Artifact size: 394.18 MiB -> 395.94 MiB (0.45%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Apr 18, 2026
Comment thread compiler/rustc_middle/src/queries.rs Outdated
Comment thread compiler/rustc_middle/src/hir/mod.rs Outdated
Comment thread compiler/rustc_ast_lowering/src/lib.rs Outdated
Comment thread compiler/rustc_ast_lowering/src/lib.rs
@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 20, 2026
@cjgillot cjgillot force-pushed the unmut-resolver-ast branch from 1e6ae8e to a9cee38 Compare April 21, 2026 23:48
@rustbot

This comment has been minimized.

@cjgillot
Copy link
Copy Markdown
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 21, 2026
rust-bors Bot pushed a commit that referenced this pull request Apr 21, 2026
Do not modify resolver outputs during lowering
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 22, 2026

☀️ Try build successful (CI)
Build commit: 1c6d6e2 (1c6d6e2c1b3985c72ee1ae7801921428e8a66b2e, parent: 9ec5d5f32e19d250c7fbeaa90978c79105b39dee)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (1c6d6e2): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This perf run didn't have relevant results for this metric.

Max RSS (memory usage)

This perf run didn't have relevant results for this metric.

Cycles

Results (secondary -14.1%)

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)
4.7% [4.7%, 4.7%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-17.8% [-24.1%, -3.5%] 5
All ❌✅ (primary) - - 0

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 489.594s -> 487.712s (-0.38%)
Artifact size: 394.45 MiB -> 394.22 MiB (-0.06%)

@rustbot rustbot removed S-waiting-on-perf Status: Waiting on a perf run to be completed. perf-regression Performance regression. labels Apr 22, 2026
@rust-bors

This comment has been minimized.

@cjgillot cjgillot force-pushed the unmut-resolver-ast branch from a9cee38 to 4d5b6b5 Compare April 24, 2026 02:34
@rustbot

This comment has been minimized.

@oli-obk
Copy link
Copy Markdown
Contributor

oli-obk commented Apr 24, 2026

Please squash the first two commits to avoid the back and forth in the diff

@rust-bors

This comment has been minimized.

@cjgillot cjgillot force-pushed the unmut-resolver-ast branch from 4d5b6b5 to 4433512 Compare April 24, 2026 23:59
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 24, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@oli-obk
Copy link
Copy Markdown
Contributor

oli-obk commented Apr 25, 2026

@bors r+

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 25, 2026

📌 Commit 4433512 has been approved by oli-obk

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 25, 2026
@petrochenkov
Copy link
Copy Markdown
Contributor

petrochenkov commented Apr 25, 2026

(I was waiting for the S-waiting-on-review label to approve the PR.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants