Skip to content

Conversation

@amandasystems
Copy link
Contributor

@amandasystems amandasystems commented Jan 26, 2026

This change backports some changes from the now abandoned #142623.

Notably, it simplifies the PlaceholderReachability enum by replacing the case when no placeholders were reached with a standard Option::None.

It also rewrites the API for scc::Annotations to be update-mut rather than a more Functional programming style. This showed some slight performance impact in early tests of the PR and definitely makes the implementation simpler.

This probably wants a perf run just for good measure.

r? @lcnr

@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 Jan 26, 2026
@rustbot

This comment has been minimized.

@amandasystems amandasystems force-pushed the scc-annotations-update branch from 3989564 to 56873b6 Compare January 26, 2026 16:15
@rustbot

This comment has been minimized.

@JayanAXHF JayanAXHF added the A-borrow-checker Area: The borrow checker label Jan 26, 2026
@lcnr
Copy link
Contributor

lcnr commented Jan 27, 2026

merge conflict :3

@amandasystems
Copy link
Contributor Author

amandasystems commented Jan 27, 2026

merge conflict :3

WITH UPSTREAM!

I must have accidentally based this on an old fork or something.

This simplifies the `PlaceholderReachability` `enum` by
replacing the case when no placeholders were reached with
a standard `Option::None`.

It also rewrites the API for `scc::Annotations` to be update-mut
rather than a more Functional programming style. This showed some slight
performance impact in early tests of the PR and definitely makes
the implementation simpler.
@amandasystems amandasystems force-pushed the scc-annotations-update branch from 56873b6 to 4bdccab Compare January 27, 2026 13:23
@rustbot
Copy link
Collaborator

rustbot commented Jan 27, 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.

@lqd
Copy link
Member

lqd commented Jan 27, 2026

This probably wants a perf run just for good measure.

@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 Jan 27, 2026
Borrowck: Simplify SCC annotation computation, placeholder rewriting
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 27, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 27, 2026

☀️ Try build successful (CI)
Build commit: f2cb709 (f2cb709a16d35d694e66c79b47d4bf630cfbe07d, parent: 94a0cd15f5976fa35e5e6784e621c04e9f958e57)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f2cb709): comparison URL.

Overall result: ❌✅ regressions and improvements - no action needed

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.

@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%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.0% [-0.1%, -0.0%] 3
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -2.3%, secondary -2.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)
-2.3% [-2.4%, -2.2%] 2
Improvements ✅
(secondary)
-2.0% [-2.8%, -1.6%] 3
All ❌✅ (primary) -2.3% [-2.4%, -2.2%] 2

Cycles

Results (secondary 0.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)
3.4% [2.1%, 4.9%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.6% [-7.0%, -2.7%] 3
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 473.018s -> 472.115s (-0.19%)
Artifact size: 385.68 MiB -> 383.70 MiB (-0.52%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 27, 2026
@amandasystems
Copy link
Contributor Author

amandasystems commented Jan 27, 2026

Uuuh ok so I wasn’t excepting that kind of memory use improvement and it might be a fluke but I’LL TAKE IT.

I guess it’s possible an option may sometimes be cheaper than a 3-value enum, who knows compilers are weird 🤷‍♀️

@lcnr
Copy link
Contributor

lcnr commented Jan 28, 2026

@bors r+

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 28, 2026

📌 Commit 4bdccab has been approved by lcnr

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 Jan 28, 2026
@lcnr
Copy link
Contributor

lcnr commented Jan 28, 2026

No idea how serious to take memory use changes here, I treat this PR as mostly perf neutral. The code is nicer though :3

@lqd
Copy link
Member

lqd commented Jan 28, 2026

No idea how serious to take memory use changes here

They look like the usual variance/noise, yes. So this is safe to rollup.

@bors rollup=maybe

rust-bors bot pushed a commit that referenced this pull request Jan 28, 2026
…uwer

Rollup of 12 pull requests

Successful merges:

 - #150491 (resolve: Mark items under exported ambiguous imports as exported)
 - #150720 (Do not suggest `derive` if there is already an impl)
 - #150968 (compiler-builtins: Remove the no-f16-f128 feature)
 - #151493 ([RFC] rustc_parse: improve the error diagnostic for "missing let in let chain")
 - #151660 (Bump `std`'s `backtrace`'s `rustc-demangle`)
 - #151696 (Borrowck: Simplify SCC annotation computation, placeholder rewriting)
 - #151704 (Implement `set_output_kind` for Emscripten linker)
 - #151706 (Remove Fuchsia from target OS list in unix.rs for sleep)
 - #151769 (fix undefined behavior in VecDeque::splice)
 - #151779 (stdarch subtree update)
 - #151449 ([rustdoc] Add regression test for #151411)
 - #151773 (clean up checks for constant promotion of integer division/remainder operations)
@rust-bors rust-bors bot merged commit d0a9dac into rust-lang:main Jan 29, 2026
12 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Jan 29, 2026
rust-timer added a commit that referenced this pull request Jan 29, 2026
Rollup merge of #151696 - amandasystems:scc-annotations-update, r=lcnr

Borrowck: Simplify SCC annotation computation, placeholder rewriting

This change backports some changes from the now abandoned #142623.

Notably, it simplifies the `PlaceholderReachability` `enum` by replacing the case when no placeholders were reached with a standard `Option::None`.

It also rewrites the API for `scc::Annotations` to be update-mut rather than a more Functional programming style. This showed some slight performance impact in early tests of the PR and definitely makes the implementation simpler.

This probably wants a perf run just for good measure.

r? @lcnr
github-actions bot pushed a commit to rust-lang/compiler-builtins that referenced this pull request Jan 29, 2026
…uwer

Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#150491 (resolve: Mark items under exported ambiguous imports as exported)
 - rust-lang/rust#150720 (Do not suggest `derive` if there is already an impl)
 - rust-lang/rust#150968 (compiler-builtins: Remove the no-f16-f128 feature)
 - rust-lang/rust#151493 ([RFC] rustc_parse: improve the error diagnostic for "missing let in let chain")
 - rust-lang/rust#151660 (Bump `std`'s `backtrace`'s `rustc-demangle`)
 - rust-lang/rust#151696 (Borrowck: Simplify SCC annotation computation, placeholder rewriting)
 - rust-lang/rust#151704 (Implement `set_output_kind` for Emscripten linker)
 - rust-lang/rust#151706 (Remove Fuchsia from target OS list in unix.rs for sleep)
 - rust-lang/rust#151769 (fix undefined behavior in VecDeque::splice)
 - rust-lang/rust#151779 (stdarch subtree update)
 - rust-lang/rust#151449 ([rustdoc] Add regression test for rust-lang/rust#151411)
 - rust-lang/rust#151773 (clean up checks for constant promotion of integer division/remainder operations)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-borrow-checker Area: The borrow checker 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.

6 participants