mirror of
https://github.com/allankoechke/rust.git
synced 2026-12-04 17:22:19 +00:00
Borrowck cleanups part trois As discussed on zulip, this followup to rust-lang/rust#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