Skip to content

Avoid cloning impl trait AST nodes in late resolution - #164074

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
TaKO8Ki:resolve-borrow-impl-trait-ast
Oct 12, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
TaKO8Ki:resolve-borrow-impl-trait-ast

Conversation

@TaKO8Ki

@TaKO8Ki TaKO8Ki commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

I have removed unnecessary AST clones by storing &'ast references. This is just a refactoring and does not change behavior. I did not use an LLM in this pull request.

@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. labels Oct 10, 2026
@rustbot

rustbot commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

r? @petrochenkov

rustbot has assigned @petrochenkov.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 77 candidates
  • Random selection from 16 candidates

@Kobzol

Kobzol commented Oct 10, 2026

Copy link
Copy Markdown
Member

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 10, 2026
rust-bors Bot pushed a commit that referenced this pull request Oct 10, 2026
Avoid cloning impl trait AST nodes in late resolution
@rust-bors

This comment has been minimized.

@rust-bors

rust-bors Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: f4214dd (f4214ddcf5edeb4511cfa0a81b59bb2689303060)
Base parent: 34f4a80 (34f4a807e2d84184fff4e42d4539092569b6fcd6)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (f4214dd): comparison URL.

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

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

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=iffy rustc-perf
@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.2% [0.2%, 0.3%] 6
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.2% [-0.4%, -0.1%] 22
Improvements ✅
(secondary)
-0.3% [-0.3%, -0.2%] 3
All ❌✅ (primary) -0.1% [-0.4%, 0.3%] 28

Max RSS (memory usage)

Results (primary 0.6%, secondary 2.4%)

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

mean range count
Regressions ❌
(primary)
1.7% [0.7%, 2.7%] 6
Regressions ❌
(secondary)
2.4% [0.7%, 4.2%] 13
Improvements ✅
(primary)
-1.5% [-2.5%, -1.0%] 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.6% [-2.5%, 2.7%] 9

Cycles

Results (primary 2.7%, secondary -1.4%)

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

mean range count
Regressions ❌
(primary)
2.7% [2.7%, 2.7%] 1
Regressions ❌
(secondary)
5.2% [4.6%, 5.7%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-7.9% [-9.8%, -6.0%] 2
All ❌✅ (primary) 2.7% [2.7%, 2.7%] 1

Binary size

Results (primary -0.0%, secondary -0.0%)

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.1%, -0.0%] 4
Improvements ✅
(secondary)
-0.0% [-0.1%, -0.0%] 2
All ❌✅ (primary) -0.0% [-0.1%, -0.0%] 4

Bootstrap: 489.09s -> 489.309s (0.04%)
Artifact size: 406.52 MiB -> 407.36 MiB (0.21%)

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

Copy link
Copy Markdown
Contributor

@bors r+

@rust-bors

rust-bors Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

📌 Commit c446785 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 Oct 12, 2026
rust-bors Bot pushed a commit that referenced this pull request Oct 12, 2026
…uwer

Rollup of 4 perf-sensitive pull requests

Successful merges:

 - #163425 (Treat union fields as aliasing each other in value_analysis)
 - #164074 (Avoid cloning impl trait AST nodes in late resolution)
 - #164089 (Implement `clone_from` for `BorrowckDomain`)
 - #164150 (Reserve more capacity for Symbol interner)
@rust-bors
rust-bors Bot merged commit 6dc7dd5 into rust-lang:main Oct 12, 2026
15 checks passed
@rustbot rustbot added this to the 1.101.0 milestone Oct 12, 2026
rust-bors Bot pushed a commit that referenced this pull request Oct 12, 2026
Rollup merge of #164074 - TaKO8Ki:resolve-borrow-impl-trait-ast, r=petrochenkov

Avoid cloning impl trait AST nodes in late resolution

I have removed unnecessary AST clones by storing `&'ast` references. This is just a refactoring and does not change behavior. I did not use an LLM in this pull request.
@rust-timer

Copy link
Copy Markdown
Collaborator

Note

This PR was benchmarked as part of triage of its containing rollup: triage URL.

Finished benchmarking commit (c5438cd): comparison URL.

Overall result: ✅ improvements - 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.2%, 0.2%] 1
Improvements ✅
(primary)
-0.3% [-0.6%, -0.1%] 29
Improvements ✅
(secondary)
-0.4% [-0.8%, -0.1%] 40
All ❌✅ (primary) -0.3% [-0.6%, -0.1%] 29

Max RSS (memory usage)

Results (primary 0.8%, secondary 2.6%)

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

mean range count
Regressions ❌
(primary)
0.8% [0.8%, 0.8%] 1
Regressions ❌
(secondary)
2.6% [2.6%, 2.6%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.8% [0.8%, 0.8%] 1

Cycles

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

Binary size

Results (primary 0.1%, 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.1% [0.0%, 0.2%] 83
Regressions ❌
(secondary)
0.1% [0.0%, 0.2%] 47
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [0.0%, 0.2%] 83

Artifact size: 406.63 MiB -> 406.92 MiB (0.07%)

@rustbot rustbot removed the perf-regression Performance regression. label Oct 13, 2026
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants