Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement GATs #116
Comments
This was referenced May 7, 2018
Merged
Merged
added a commit
that referenced
this issue
May 9, 2018
tmandry
self-assigned this
May 12, 2018
This comment has been minimized.
This comment has been minimized.
|
Follow-up (should be straightforward): support quantified bounds on GATs, both in the grammar and in the rules, e.g. trait Foo {
type Item<V>: forall<'a> Fn(&'a V);
} |
nikomatsakis
closed this
in
#134
May 24, 2018
This comment has been minimized.
This comment has been minimized.
|
(Reopening because of the follow-up) |
scalexm
reopened this
May 24, 2018
nikomatsakis
closed this
in
#145
Jun 19, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
scalexm commentedMay 1, 2018
Step 1
The grammar needs to be extended to support bounds and (quantified) where clauses on associated types like in:
The grammar is located parser.lalrpop, and the AST in ast.rs.
When this is done, this item:
chalk/chalk-parse/src/parser.lalrpop
Lines 204 to 207 in eeb2182
won't be needed anymore because we will be using
QuantifiedWhereClauseseverywhere.We would also remove where clauses on associated type values because they are useless:
chalk/chalk-parse/src/parser.lalrpop
Lines 104 to 111 in eeb2182
Step 2
Currently, a where clause of the form
where T: Foo<Item = U>translated to a single domain goalProjectionEq(<T as Foo>::Item = U). We would need this clause to be translated to two distinct domain goals:ProjectionEq(<T as Foo>::Item = U)as beforeImplemented(T: Foo)Currently, we cannot translate one AST where clause to multiple IR domain goals. This means that the following trait:
chalk/src/lower/mod.rs
Lines 437 to 439 in eeb2182
should be changed into something like:
Step 3
Now we should be in a position where we can implement the various rules written in this comment (niko's comment just below can be ignored, it was basically merged into the main one). This includes:
Note: the organization of these two files will change after #114 is fixed, so the preceding text may become obsolete.
Step 4
At that point, the domain goal
WellFormed(ProjectionEq)will be unused. See #115 for the next steps.cc @rust-lang-nursery/wg-traits