Skip to content

Borrowck cleanups part trois - #163357

Open
lqd wants to merge 5 commits into
rust-lang:mainfrom
lqd:deferred-liveness-tokyo-drift
Open

lqd wants to merge 5 commits into
rust-lang:mainfrom
lqd:deferred-liveness-tokyo-drift

Conversation

@lqd

@lqd lqd commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

As discussed on zulip, this followup to #163266 contains a few cleanups (and much like the Godfather Trilogy, the 3rd one is not as good as the previous 2):

  • small renamings we forgot last time
  • there are some regioncx functions that panic when called on the pre-solved regionx, so I moved them to the immutable context so that they don't panic
  • so I also reduced a bunch of fields visibility to limit the API surface as well
  • merges the new and solve functions into a unique RegionInferenceContext::solve entry point, because it was indeed funny to only do both of these together. This is the biggest change in the PR but is mostly moving these two functions' code into one, and renaming self 3 or 4 times at most.

This makes me realize we surely broke some tiny parts of consumers.rs in the previous (because functions that were pub are now pub(crate)) but since we don't know what they're used for, on the immutable or mutable regioncx, it's impossible to know how to fix until the consumers tell us. It's fine.

r? @jackh726

lqd added 5 commits September 25, 2026 22:41
we previously always created an unsolved regioncx to immediately solve it, but can create
the solved regioncx in a single step.

this is done by merging `UnsolvedRegionInferenceContext`'s `new` and `solve` into one constructor.
@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 Sep 25, 2026
@jackh726

Copy link
Copy Markdown
Member

@bors r+

@rust-bors

rust-bors Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 29c3e37 has been approved by jackh726

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 Sep 26, 2026

This branch has not been deployed

No deployments
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.

3 participants