-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rustc_borrowck
cleanups
#132250
rustc_borrowck
cleanups
#132250
Conversation
compiler/rustc_borrowck/src/type_check/free_region_relations.rs
Outdated
Show resolved
Hide resolved
f3ad954
to
41c968e
Compare
I've removed the commits you didn't like, should be good to go now. |
Reducing the visibility of items in this crate might break tools using the |
41c968e
to
b4fca11
Compare
I checked. Nothing in the |
as they’ve already started reviewing, r? compiler-errors |
☔ The latest upstream changes (presumably #132349) made this pull request unmergeable. Please resolve the merge conflicts. |
b4fca11
to
0bcd936
Compare
@compiler-errors: I rebased, ready for review again, thanks. |
r=me after rebasing |
So they're all in the one place. Also prepend with `crate::`, à la the `unqualified_local_imports` lint.
Mostly by wrapping overly long comment lines, plus a few other things.
It's strange to have a struct that contains a single anonymous field that is an enum. This commit merges them. This does require increasing the visibility of `TypeOfInfo` to `pub(crate)`, but that seems worthwhile.
Because there is no real reason for it to be a separate struct. - It has no methods. - It's easy to confuse with the nearby `BorrowckInferContext` (which does have methods). - The `mut` ref to it in `TypeChecker` makes it seem like any of the fields within might be mutable, but only two (`all_facts` and `constraints`) actually are. - Two of the fields are `pub(crate)` but can be private. This change makes a lot of code more concise and readable.
It has four different `insert` methods, with some duplication. This commit finds the commonality and removes them all.
- Store a mut ref to a `BorrowckDiags` in `MirBorrowckCtxt` instead of owning it, to save having to pass ownership in and out of `promoted_mbcx`. - Use `buffer_error` in a couple of suitable places.
0bcd936
to
e0e7a43
Compare
@bors r=compiler-errors |
☀️ Test successful - checks-actions |
Finished benchmarking commit (ca87b53): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results (secondary -2.5%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 779.582s -> 779.908s (0.04%) |
…2, r=<try> `rustc_borrowck` cleanups, part 2 The code under `do_mir_borrowck` is pretty messy, especially the various types like `MirBorrowckCtxt`, `BorrowckInferCtxt`, `MirTypeckResults`, `MirTypeckRegionConstraints`, `CreateResult`, `TypeChecker`, `TypeVerifier`, `LivenessContext`, `LivenessResults`. This PR does some tidying up, though there's still plenty of mess left afterwards. A sequel to rust-lang#132250. r? `@compiler-errors`
…2, r=<try> `rustc_borrowck` cleanups, part 2 The code under `do_mir_borrowck` is pretty messy, especially the various types like `MirBorrowckCtxt`, `BorrowckInferCtxt`, `MirTypeckResults`, `MirTypeckRegionConstraints`, `CreateResult`, `TypeChecker`, `TypeVerifier`, `LivenessContext`, `LivenessResults`. This PR does some tidying up, though there's still plenty of mess left afterwards. A sequel to rust-lang#132250. r? `@compiler-errors`
…2, r=Nadrieril `rustc_borrowck` cleanups, part 2 The code under `do_mir_borrowck` is pretty messy, especially the various types like `MirBorrowckCtxt`, `BorrowckInferCtxt`, `MirTypeckResults`, `MirTypeckRegionConstraints`, `CreateResult`, `TypeChecker`, `TypeVerifier`, `LivenessContext`, `LivenessResults`. This PR does some tidying up, though there's still plenty of mess left afterwards. A sequel to rust-lang#132250. r? `@compiler-errors`
A bunch of cleanups I made while reading over this crate.
r? @lqd