Repository navigation
Support leak check for new style region constraint - #164350
adwinwhite wants to merge 1 commit into
Conversation
|
|
| // FIXME: unsure about whether the inherited `VisibleForLeakCheck` is correct. | ||
| candidates.push(RegionOutlives(ub, lb, visible_for_leak_check, ())); |
There was a problem hiding this comment.
unsure about whether the inheriting is correct 🤔
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
f6f35d0 to
ffcd541
Compare
This comment has been minimized.
This comment has been minimized.
ffcd541 to
9881c37
Compare
This comment has been minimized.
This comment has been minimized.
9881c37 to
f13478b
Compare
This comment has been minimized.
This comment has been minimized.
f13478b to
ebd9501
Compare
This comment has been minimized.
This comment has been minimized.
ebd9501 to
2510c7f
Compare
This comment has been minimized.
This comment has been minimized.
2510c7f to
654913b
Compare
This comment has been minimized.
This comment has been minimized.
654913b to
94a0df6
Compare
This comment has been minimized.
This comment has been minimized.
94a0df6 to
cd9eb02
Compare
This comment has been minimized.
This comment has been minimized.
a2eaf90 to
ce951ee
Compare
| 'b: 'a, | ||
| 'a: 'b, | ||
| 'b: 'a, | ||
| } |
There was a problem hiding this comment.
We probably should make region constraint comparison order insenstitive in the DSL.
|
not certain I understand the reason why this is the solution arrived at so just gonna ramble a bit and you can tell me if I'm understanding correctly or not xd So as far as I can tell the main difficulty here is snapshot-based leak checks, which look at This is a difficulty because we need to make sure to actually have an As far as I understand it the solution in this PR is to:
This allows you to implement proper undo behaviour for the I have few thoughts on this where I'm not sure if I'm missing something. First, why do we wish to store It feels unexpected to me for it to not be part of The other thing is that I would ideally prefer not to have a separate list of leaf constraints to track the |
Oh, I felt the PR description was too short but couldn't realize what was missing. This is the missing part.
Yeah, your understanding is totally correct, I think.
The main reason is that even if we store it in the region constraint storage, we still have to track un-deduplicated
We can totally put Another solution I tried is putting both |
Ah interesting that makes sense. I think of it kinda from the other direction- the reason we cant deduplicate is because we always need an Having it be in the storage feels like leaking leak check details into the storage whereas having it in the
this makes sense to me 🤔 thinking of visible for leak check as a thing the storage associates with each constraint, instead of a thing on each constraint, actually seems kinda nice conceptually to me. especially with one of my ideas about reworking the existing storage to be more of a "list of constraints" rather than one big combined constraint. I think that in the short term I would quite like us to clean up the storage to have it just be a I'm happy to not do that in this PR though because I would really quite like to have leak check support abby constraints 😅 Could you slap a FIXME on |
| #[instrument(skip(self), level = "trace")] | ||
| fn regions(&mut self, a: Region<I>, b: Region<I>) -> RelateResult<I, Region<I>> { | ||
| self.infcx.equate_regions(a, b, VisibleForLeakCheck::Yes, self.span); | ||
| if self.cx().assumptions_on_binders() { |
There was a problem hiding this comment.
what got you to catch on to the fact that we were silently dropping constraints here
There was a problem hiding this comment.
One of the tests was not working and I was upset :3
|
@rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
ce951ee to
f528291
Compare
We'd still need
Cool solution to the Or constraints blow up and this deduplication problem ✨ |
This comment has been minimized.
This comment has been minimized.
f528291 to
6873a64
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
6873a64 to
77e14fe
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@rustbot ready |
View all comments
To support snapshot-based leak check, we need to record the
VisibleForLeakCheckfield for each leaf registering.We can't merge visibilities since that's lossy and can't be rolled back.
A separate list is used to record all info that's lost in solver region constraint deduplication. It's unfortunate but necessary in my view.
Close rust-lang/project-assumptions-on-binders#30
Close rust-lang/project-assumptions-on-binders#56
r? Boxyuwu