Skip to content

Abstract AST lowering resolver#153656

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
aerooneqq:split-ast-lowering-resolver
Mar 18, 2026
Merged

Abstract AST lowering resolver#153656
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
aerooneqq:split-ast-lowering-resolver

Conversation

@aerooneqq
Copy link
Contributor

@aerooneqq aerooneqq commented Mar 10, 2026

View all comments

This PR adds new methods for ResolverAstLoweringExt for future use in #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 #153489, when we will not steal but borrow resolver from resolve stage.

Second step for #153489.

r? @petrochenkov

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 10, 2026
@petrochenkov
Copy link
Contributor

@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 Mar 10, 2026
Split AST lowering resolver into mutable and readonly parts
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 10, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 10, 2026

☀️ Try build successful (CI)
Build commit: 34c6408 (34c640855259775e106a9bb690dca6e253708e88, parent: 3bc6ea5673e3e292db1e5b6ecaaaa883ca5af0b8)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (34c6408): comparison URL.

Overall result: ❌ regressions - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@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.3% [0.1%, 0.5%] 88
Regressions ❌
(secondary)
0.2% [0.0%, 0.4%] 24
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.3% [0.1%, 0.5%] 88

Max RSS (memory usage)

Results (secondary -2.3%)

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

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

Results (primary -0.0%, secondary -0.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)
- - 0
Improvements ✅
(primary)
-0.0% [-0.0%, -0.0%] 15
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.0%] 5
All ❌✅ (primary) -0.0% [-0.0%, -0.0%] 15

Bootstrap: 479.559s -> 479.738s (0.04%)
Artifact size: 394.94 MiB -> 394.96 MiB (0.00%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Mar 10, 2026
@petrochenkov
Copy link
Contributor

@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 Mar 11, 2026
Split AST lowering resolver into mutable and readonly parts
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 11, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 11, 2026

☀️ Try build successful (CI)
Build commit: fd90094 (fd900941fd5f18ffa2e76d2485bc973cbe4785b5, parent: d1c79458b5d13bd0179d7dbafd5ca4ea9ae3e6aa)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (fd90094): comparison URL.

Overall result: ❌ regressions - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@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.3% [0.1%, 0.5%] 73
Regressions ❌
(secondary)
0.2% [0.1%, 0.3%] 20
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.3% [0.1%, 0.5%] 73

Max RSS (memory usage)

Results (secondary -3.3%)

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)
0.9% [0.9%, 0.9%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-7.4% [-7.4%, -7.4%] 1
All ❌✅ (primary) - - 0

Cycles

Results (primary -1.8%, secondary 0.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)
2.1% [2.1%, 2.1%] 1
Improvements ✅
(primary)
-1.8% [-1.8%, -1.8%] 1
Improvements ✅
(secondary)
-2.0% [-2.0%, -2.0%] 1
All ❌✅ (primary) -1.8% [-1.8%, -1.8%] 1

Binary size

Results (primary 0.0%, secondary 0.1%)

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

mean range count
Regressions ❌
(primary)
0.0% [0.0%, 0.1%] 26
Regressions ❌
(secondary)
0.1% [0.0%, 0.1%] 19
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [0.0%, 0.1%] 26

Bootstrap: 479.3s -> 481.187s (0.39%)
Artifact size: 396.94 MiB -> 394.92 MiB (-0.51%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 11, 2026
@aerooneqq aerooneqq force-pushed the split-ast-lowering-resolver branch from 6ddfe68 to 8158d7f Compare March 12, 2026 13:50
@petrochenkov
Copy link
Contributor

@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 Mar 12, 2026
Split AST lowering resolver into mutable and readonly parts
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 12, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 12, 2026

☀️ Try build successful (CI)
Build commit: 3cf00c2 (3cf00c237b8526db29ae46b6f794e2b7b20cbe09, parent: d1ee5e59a964a419b84b760812a35075034f4861)

@rust-timer

This comment has been minimized.

@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 Mar 18, 2026
@petrochenkov
Copy link
Contributor

The PR description needs some update, the lowering resolver was already abstracted through ResolverAstLoweringExt, this PR just adds more methods to that abstraction (because the future PR #XXXXX needs them for this and that).

@aerooneqq
Copy link
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 18, 2026
@petrochenkov
Copy link
Contributor

r=me after squashing commits.
@rustbot author

@rustbot rustbot 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 Mar 18, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 18, 2026

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@aerooneqq aerooneqq force-pushed the split-ast-lowering-resolver branch from 69f6ab2 to 3656fbf Compare March 18, 2026 14:31
@aerooneqq
Copy link
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 18, 2026
@petrochenkov
Copy link
Contributor

@bors r+

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 18, 2026

📌 Commit 3656fbf has been approved by petrochenkov

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-review Status: Awaiting review from the assignee but also interested parties. labels Mar 18, 2026
@rust-bors

This comment has been minimized.

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

rust-bors bot commented Mar 18, 2026

☀️ Test successful - CI
Approved by: petrochenkov
Duration: 3h 11m 21s
Pushing fd0c901 to main...

@rust-bors rust-bors bot merged commit fd0c901 into rust-lang:main Mar 18, 2026
12 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Mar 18, 2026
@github-actions
Copy link
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 53d60bb (parent) -> fd0c901 (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 fd0c901b00ee1e08a250039cdb90258603497e20 --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. aarch64-apple: 3h 43m -> 2h 50m (-23.8%)
  2. i686-gnu-nopt-1: 2h 24m -> 2h 1m (-15.9%)
  3. test-various: 2h 10m -> 1h 51m (-14.7%)
  4. dist-apple-various: 1h 34m -> 1h 46m (+12.8%)
  5. x86_64-gnu: 2h 22m -> 2h 5m (-12.2%)
  6. i686-gnu-1: 2h 10m -> 1h 56m (-11.4%)
  7. pr-check-1: 31m 38s -> 28m 5s (-11.2%)
  8. x86_64-gnu-tools: 1h 3m -> 56m 10s (-11.0%)
  9. dist-aarch64-apple: 1h 51m -> 2h 1m (+9.2%)
  10. aarch64-gnu-debug: 1h 16m -> 1h 9m (-8.9%)
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
Collaborator

Finished benchmarking commit (fd0c901): 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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.2% [0.1%, 0.3%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 479.87s -> 481.003s (0.24%)
Artifact size: 397.03 MiB -> 396.91 MiB (-0.03%)

@aerooneqq aerooneqq deleted the split-ast-lowering-resolver branch March 18, 2026 19:43
makai410 pushed a commit to makai410/rust that referenced this pull request Mar 20, 2026
…r, r=petrochenkov

Abstract AST lowering resolver



This PR adds new methods for `ResolverAstLoweringExt` for future use in rust-lang#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#153489, when we will not steal but borrow resolver from resolve stage.~

Second step for rust-lang#153489.

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

Labels

merged-by-bors This PR was explicitly merged by bors. 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.

5 participants