-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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, part 2
#132623
rustc_borrowck
cleanups, part 2
#132623
Conversation
I don't have the time to review this right now (edit: sorry for the tone on the original message!) r? compiler |
@@ -2783,12 +2772,12 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> { | |||
) -> ty::InstantiatedPredicates<'tcx> { | |||
if let Some(closure_requirements) = &tcx.mir_borrowck(def_id).closure_requirements { | |||
constraint_conversion::ConstraintConversion::new( | |||
self.infcx, | |||
self.infcx, // njn: change to BorrowckInferCtxt? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should probably convert this to a fixme or address it
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
…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`
All good for me, I checked the logic and the changes are pretty unambiguously improvements. Much appreciation for the small and well-explained commits. I second Err's remark about the FIXME comment; r=me once that is fixed if perf is good. |
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
☔ The latest upstream changes (presumably #133120) made this pull request unmergeable. Please resolve the merge conflicts. |
976ba9e
to
99e2f2d
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
…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`
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (f40e933): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary 1.5%, secondary 5.1%)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.
CyclesResults (primary -2.1%)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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 788.58s -> 790.819s (0.28%) |
I think the perf results are just noise. @rustbot label: +perf-regression-triaged |
☔ The latest upstream changes (presumably #132460) made this pull request unmergeable. Please resolve the merge conflicts. |
`TypeChecker` already has it in a field.
This avoids the need to arena allocate it. `ConstraintConversion` needs some simple lifetime adjustments to allow this.
No reason not to be, and it's simpler that way.
There is an `Rc<UniversalRegions>` within `UniversalRegionRelations`, and yet the two types get passed around in tandem a lot. This commit makes `UniversalRegionRelations` own `UniversalRegions`, removing the `Rc` (which wasn't truly needed) and the tandem-passing. This requires adding a `universal_relations` method to `UniversalRegionRelations`, and renaming a couple of existing methods producing iterators to avoid a name clash.
It can be computed from `tcx` on demand, instead of computing it eagerly and passing it around.
It has a single call site.
It's not necessary.
Instead of destructuring it in advance and passing all the components individually. It's less code that way.
Because they get passed around together a lot.
It's simpler that way, and we don't need the explicit `drop`.
7b0619d
to
75108b6
Compare
I rebased. @bors r=Nadrieril |
☀️ Test successful - checks-actions |
Finished benchmarking commit (7d40450): comparison URL. Overall result: ❌ regressions - no action needed@rustbot label: -perf-regression Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary -0.6%)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.
CyclesResults (secondary 1.7%)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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 792.888s -> 795.261s (0.30%) |
I did some local measurements that strongly indicated that the final commit was responsible for the wg-grammar regression. So I filed #133220 to revert that commit, but the perf run there showed it had no effect. Weird. I don't think it's worth spending more time on a mysterious regression that affects just a single secondary benchmark. |
The code under
do_mir_borrowck
is pretty messy, especially the various types likeMirBorrowckCtxt
,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 #132250.
r? @compiler-errors