-
Notifications
You must be signed in to change notification settings - Fork 522
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
Add lowering rules for GATs #147
Conversation
67f1414
to
d8d13a8
Compare
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.
I left two small comments.
src/traits-lowering-rules.md
Outdated
// XXX how exactly should we set this up? Have to be careful; | ||
// presumably this has to be a kind of `FromEnv` setup. | ||
// Rule Implied-Bound-From-AssocTy | ||
forall<Self, P1..Pn, Pn+1..Pm> { |
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.
Could you add: « for each Bound
in the set of Bounds
» or something like this, to emphasize the fact that we output one FromEnv
rule at a time
src/traits-lowering-rules.md
Outdated
|
||
```text | ||
// Rule Normalize-From-Impl | ||
forall<P0..Pm> { | ||
forall<Pn+1..Pm> { | ||
Normalize(<A0 as Trait<A1..An>>::AssocType<Pn+1..Pm> -> T) :- | ||
WC && WC1 | ||
WC_impl && WC1 |
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.
WC_impl
can actually be replaced with Implemented(A0: Trait)
(and that’s what we do in chalk)
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.
Done. Do you think it's more or less confusing to keep WC_impl
around then? :)
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.
Let’s keep it, so that it looks like a general enough impl.
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.
Moreover, your comment just below about what the impl can rely on is very informative.
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.
Sounds good. I added a note about WC_impl
being unused just so it doesn't seem like a mistake.
d8d13a8
to
80e9918
Compare
80e9918
to
8a98e39
Compare
Add the lowering rules from rust-lang/chalk#12 (comment) that were added to Chalk in rust-lang/chalk#134.
cc #137, @scalexm, @nikomatsakis