Consider captured regions for opaque type region liveness.#156027
Consider captured regions for opaque type region liveness.#156027jackh726 wants to merge 5 commits into
Conversation
|
Until I can look at this next week, @bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Consider captured regions for opaque type region liveness.
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (97f0332): comparison URL. Overall result: no relevant changes - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -perf-regression Instruction countThis perf run didn't have relevant results for this metric. Max RSS (memory usage)Results (primary -2.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary 2.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 0.2%, secondary 0.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 481.713s -> 483.106s (0.29%) |
There was a problem hiding this comment.
I also started down this direction so some of this makes sense to me. We stopped because it felt fragile and test coverage was, and still is, weak. So with that caveat this generally feels fine to me, but again, I don't know enough about this area to say what problems there could be.
This direction felt less nice than what lcnr described in the t-types meeting where we described the issue, so I'll defer to them.
| // Thinking about it, I was originally a bit concerned about something like `'a: 'static`, and | ||
| // whether or not we need to mark `'a` as live. I don't think *today* we do, since I think regions | ||
| // that outlive `'static` are special enough, but I *could* imagine some world where we need to be | ||
| // more careful about this. Given I can't find a test that goes wrong, I'm going to leave in this | ||
| // optimization. |
There was a problem hiding this comment.
I was also a bit worried, and we should expand test coverage here. I'm not confident enough in any of this to trust the two tests we have.
| // Unfortunately, we have to use a new `InferCtxt` each call, because | ||
| // region constraints get added and solved there and we need to test each | ||
| // call individually. |
There was a problem hiding this comment.
This is also unfortunate, combined with the fact that it's being called a quadratic number of times (thankfully the N should be small in most cases).
This comment has been minimized.
This comment has been minimized.
0718cad to
ca97579
Compare
Fixes #153215
For opaques, when we're calculating liveness for opaques, we want to consider any captured lifetimes that can outlive the opaque type, which is more than just the outlives bounds.
r? lqd