Skip to content

Do not modify resolver outputs during lowering - #155460

Merged
rust-bors[bot] merged 3 commits into
rust-lang:mainfrom
cjgillot:unmut-resolver-ast
Apr 25, 2026
Merged

Do not modify resolver outputs during lowering#155460
rust-bors[bot] merged 3 commits into
rust-lang:mainfrom
cjgillot:unmut-resolver-ast

Conversation

@cjgillot

@cjgillotcjgillot commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

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

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

cc @m-ou-se

@rustbotrustbot 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
ContributorAuthor

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

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

rust-borsBot commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

☀️ 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.

meanrangecount
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.

meanrangecount
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.

meanrangecount
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%)

@rustbotrustbot 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 threadcompiler/rustc_middle/src/queries.rs Outdated
Comment threadcompiler/rustc_middle/src/hir/mod.rs Outdated
Comment threadcompiler/rustc_ast_lowering/src/lib.rs Outdated
Comment threadcompiler/rustc_ast_lowering/src/lib.rs
@petrochenkovpetrochenkov 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
@rustbot

This comment has been minimized.

@cjgillot

Copy link
Copy Markdown
ContributorAuthor

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

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

rust-borsBot commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

☀️ 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.

meanrangecount
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%)

@rustbotrustbot 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.

@rustbot

This comment has been minimized.

@oli-obk

Copy link
Copy Markdown
Contributor

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

@rust-bors

This comment has been minimized.

@rustbot

Copy link
Copy Markdown
Collaborator

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

@bors r+

@rust-bors

rust-borsBot commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 4433512 has been approved by oli-obk

It is now in the queue for this repository.

@rust-borsrust-borsBot 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

petrochenkov commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

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

@rust-bors

This comment has been minimized.

@rust-borsrust-borsBot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 25, 2026
@rust-bors

rust-borsBot commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: oli-obk
Duration: 3h 23m 47s
Pushing fb76025 to main...

@rust-bors
rust-borsBot merged commit fb76025 into rust-lang:mainApr 25, 2026
12 checks passed
@rustbotrustbot added this to the 1.97.0 milestone Apr 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor
What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 7e0430f (parent) -> fb76025 (this PR)

Test differences

Show 3 test diffs

3 doctest diffs were found. These are ignored, as they are noisy.

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard fb76025f2fe6a1c8ce03fe0931f941c8077a2c34 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. pr-check-1: 20m 54s -> 32m (+53.1%)
  2. x86_64-rust-for-linux: 35m 58s -> 51m 13s (+42.4%)
  3. dist-x86_64-msvc-alt: 2h 10m -> 2h 50m (+30.8%)
  4. x86_64-msvc-ext3: 1h 24m -> 1h 43m (+23.1%)
  5. dist-x86_64-illumos: 1h 44m -> 1h 23m (-20.1%)
  6. dist-x86_64-apple: 2h 18m -> 1h 52m (-19.0%)
  7. dist-i686-mingw: 2h 35m -> 2h 12m (-14.8%)
  8. x86_64-gnu-llvm-22-3: 1h 54m -> 1h 37m (-14.5%)
  9. x86_64-gnu-miri: 1h 22m -> 1h 33m (+13.8%)
  10. x86_64-gnu-tools: 55m 27s -> 1h 2m (+13.4%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (fb76025): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

meanrangecount
Regressions ❌
(primary)
0.2%[0.2%, 0.2%]2
Regressions ❌
(secondary)
--0
Improvements ✅
(primary)
--0
Improvements ✅
(secondary)
--0
All ❌✅ (primary)0.2%[0.2%, 0.2%]2

Max RSS (memory usage)

Results (primary -0.7%, secondary -1.2%)

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

meanrangecount
Regressions ❌
(primary)
--0
Regressions ❌
(secondary)
2.9%[2.9%, 2.9%]1
Improvements ✅
(primary)
-0.7%[-0.7%, -0.7%]1
Improvements ✅
(secondary)
-5.4%[-5.4%, -5.4%]1
All ❌✅ (primary)-0.7%[-0.7%, -0.7%]1

Cycles

Results (primary -2.3%, secondary -2.8%)

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

meanrangecount
Regressions ❌
(primary)
--0
Regressions ❌
(secondary)
--0
Improvements ✅
(primary)
-2.3%[-2.3%, -2.3%]1
Improvements ✅
(secondary)
-2.8%[-2.8%, -2.8%]1
All ❌✅ (primary)-2.3%[-2.3%, -2.3%]1

Binary size

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

Bootstrap: 491.487s -> 487.131s (-0.89%)
Artifact size: 394.23 MiB -> 394.07 MiB (-0.04%)

@cjgillot
cjgillot deleted the unmut-resolver-ast branch April 25, 2026 14:06
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-borsThis PR was explicitly merged by bors.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-rustdocRelevant 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

@cjgillot@rustbot@rust-timer@oli-obk@petrochenkov@aerooneqq