-
Notifications
You must be signed in to change notification settings - Fork 183
Add lifetime outlives goal #451
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
Conversation
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.
So... what I did in my other branch was similar to this, but with one difference. There was a 'meta goal' like
AddRegionConstraint('a, 'b)
that part of the Goal
enum. In the simplify
logic, this goal is simply converted to a region constraint and (for now) always provable. Then we can have
Outlives('a, 'b) :- AddRegionConstraint('a, 'b)
This feels like a more elegant setup to me than what's in the PR, in that it adds a kind of "special meta goal" but otherwise leaves things untouched. I also converted unification so that it never produces region constraints but instead only adds new subgoals.
The next step, which I didn't yet take, would be to (a) only apply AddRegionConstraint
for things in the root universe (perhaps it fails for lifetimes in other universes, for example) and (b) have some other rules for handling outlives for higher-ranked things (this is what I was in the midst of exploring when I realized that, to encode the rules the way I wanted, we needed the semantic-vs-synctactic equality split).
edd03a8
to
7e3e570
Compare
@nikomatsakis Okay so I rebased this to master. But I'm a little unsure how to continue here.
|
7e3e570
to
46658a6
Compare
tests/test/misc.rs
Outdated
exists<'a, 'b> { | ||
Bar: Foo<'a, 'b> | ||
} | ||
} yields[SolverChoice::slg(10, None)] { |
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.
ah I guess that's why you have slg
here
So, I think that your current branch is effectively "hard-coding" the I don't quite understand your point about having refactored the I think I still prefer to have a special goal like As for the interaction with higher-ranked, let's shelve it for now, I don't think it's relevant to this PR yet. |
c.c. #435
I'm not sure if this is exactly the approach we want to take here, but I figured I would open this for comments at least