Skip to content

Implement clone_from for BorrowckDomain - #164089

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
TaKO8Ki:borrowck-domain-clone-from
Oct 12, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
TaKO8Ki:borrowck-domain-clone-from

Conversation

@TaKO8Ki

@TaKO8Ki TaKO8Ki commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

I've added a similar implementation for BorrowckDomain as for rustc_const_eval::check_consts::resolver::State.

impl Clone for State {
fn clone(&self) -> Self {
State { qualif: self.qualif.clone(), borrow: self.borrow.clone() }
}
// Data flow engine when possible uses `clone_from` for domain values.
// Providing an implementation will avoid some intermediate memory allocations.
fn clone_from(&mut self, other: &Self) {
self.qualif.clone_from(&other.qualif);
self.borrow.clone_from(&other.borrow);
}
}

@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 Oct 10, 2026
@TaKO8Ki

TaKO8Ki commented Oct 10, 2026

Copy link
Copy Markdown
Member Author

@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

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Oct 10, 2026
Implement `clone_from` for `BorrowckDomain`
@rust-bors

rust-bors Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: f776b65 (f776b65df91f16f1ee06fb6deba9f1aea2f35ee5)
Base parent: 5ec56e3 (5ec56e3902656f2460259fc3ac0f6e2255f94417)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (f776b65): comparison URL.

Overall result: ✅ improvements - 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 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
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.2% [-0.3%, -0.1%] 17
Improvements ✅
(secondary)
-0.2% [-0.3%, -0.1%] 13
All ❌✅ (primary) -0.2% [-0.3%, -0.1%] 17

Max RSS (memory usage)

Results (primary -2.6%, 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)
4.4% [4.4%, 4.4%] 1
Improvements ✅
(primary)
-2.6% [-2.6%, -2.6%] 1
Improvements ✅
(secondary)
-4.1% [-4.1%, -4.1%] 1
All ❌✅ (primary) -2.6% [-2.6%, -2.6%] 1

Cycles

Results (primary 0.7%, secondary 4.5%)

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

mean range count
Regressions ❌
(primary)
2.6% [2.6%, 2.6%] 2
Regressions ❌
(secondary)
4.5% [4.5%, 4.5%] 1
Improvements ✅
(primary)
-3.2% [-3.2%, -3.2%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.7% [-3.2%, 2.6%] 3

Binary size

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

Bootstrap: 487.044s -> 488.946s (0.39%)
Artifact size: 406.45 MiB -> 406.61 MiB (0.04%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 10, 2026
@TaKO8Ki
TaKO8Ki marked this pull request as ready for review October 11, 2026 11:45
@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 Oct 11, 2026
@rustbot

rustbot commented Oct 11, 2026

Copy link
Copy Markdown
Collaborator

r? @mati865

rustbot has assigned @mati865.
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: borrowck, compiler
  • borrowck, compiler expanded to 77 candidates
  • Random selection from 20 candidates

@mati865 mati865 left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rust-bors

rust-bors Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 208a58d has been approved by mati865

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
@JonathanBrouwer

Copy link
Copy Markdown
Member

@bors rollup=iffy
Adding this to a rollup of perf-sensitive PRs

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 645a281 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 #164089 - TaKO8Ki:borrowck-domain-clone-from, r=mati865

Implement `clone_from` for `BorrowckDomain`

I've added a similar implementation for `BorrowckDomain` as for `rustc_const_eval::check_consts::resolver::State`.

https://github.com/rust-lang/rust/blob/208a58d8c1b22a5b43c8e671077ed5ac4032abde/compiler/rustc_const_eval/src/check_consts/resolver.rs#L270-L281
@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 (078dd24): 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
Improvements ✅
(primary)
-0.2% [-0.6%, -0.1%] 21
Improvements ✅
(secondary)
-0.4% [-0.8%, -0.1%] 53
All ❌✅ (primary) -0.2% [-0.6%, -0.1%] 21

Max RSS (memory usage)

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

Cycles

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

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

Artifact size: 406.63 MiB -> 406.94 MiB (0.08%)

@TaKO8Ki
TaKO8Ki deleted the borrowck-domain-clone-from branch October 15, 2026 06:58
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