Skip to content

Borrowck cleanups part trois - #163357

Merged
rust-bors[bot] merged 5 commits into
rust-lang:mainfrom
lqd:deferred-liveness-tokyo-drift
Sep 26, 2026
Merged

rust-bors[bot] merged 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
rust-bors Bot pushed a commit that referenced this pull request Sep 26, 2026
Rollup of 13 pull requests

Successful merges:

 - #160695 (Detect bad number of generics caused by bad derive)
 - #162883 (No longer auto-inline `f16` and `f128` on well-supported platforms)
 - #163133 ([rustdoc] Fix invalid jump to def link when `#[rustc_allow_incoherent_impl]` is involved)
 - #163215 (Fix suggestion for Option to bool with proper precedence handling)
 - #163266 (More deferred liveness cleanups)
 - #163274 (Support -Z merge-functions with gcc and add stack-protector asm tests)
 - #163290 (Merge `ForceWarning`/`Allow`/`Expect` into `Warning`)
 - #163298 (Don't emit sugg for pub-reexport extern std)
 - #163312 (Add rustdoc regression test for glob import of a crate that re-exports)
 - #163357 (Borrowck cleanups part trois)
 - #161710 (Stabilize `mem::conjure_zst`)
 - #163332 (Add some docs to `Global`)
 - #163362 (simplify ndk compiler test)
@rust-bors
rust-bors Bot merged commit 303b5a7 into rust-lang:main Sep 26, 2026
13 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Sep 26, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 26, 2026
Rollup merge of #163357 - lqd:deferred-liveness-tokyo-drift, r=jackh726

Borrowck cleanups part trois

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
lqd deleted the deferred-liveness-tokyo-drift branch September 26, 2026 10:52
pull Bot pushed a commit to LeeeeeeM/miri that referenced this pull request Sep 27, 2026
Rollup of 13 pull requests

Successful merges:

 - rust-lang/rust#160695 (Detect bad number of generics caused by bad derive)
 - rust-lang/rust#162883 (No longer auto-inline `f16` and `f128` on well-supported platforms)
 - rust-lang/rust#163133 ([rustdoc] Fix invalid jump to def link when `#[rustc_allow_incoherent_impl]` is involved)
 - rust-lang/rust#163215 (Fix suggestion for Option to bool with proper precedence handling)
 - rust-lang/rust#163266 (More deferred liveness cleanups)
 - rust-lang/rust#163274 (Support -Z merge-functions with gcc and add stack-protector asm tests)
 - rust-lang/rust#163290 (Merge `ForceWarning`/`Allow`/`Expect` into `Warning`)
 - rust-lang/rust#163298 (Don't emit sugg for pub-reexport extern std)
 - rust-lang/rust#163312 (Add rustdoc regression test for glob import of a crate that re-exports)
 - rust-lang/rust#163357 (Borrowck cleanups part trois)
 - rust-lang/rust#161710 (Stabilize `mem::conjure_zst`)
 - rust-lang/rust#163332 (Add some docs to `Global`)
 - rust-lang/rust#163362 (simplify ndk compiler test)
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