Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upNested associated type projection is overly conservative #38078
Comments
aturon
added
the
A-traits
label
Nov 29, 2016
This comment has been minimized.
This comment has been minimized.
|
Note that the issue title may be overly specific; I haven't deeply investigated the cases where this kind of projection fails. |
This comment has been minimized.
This comment has been minimized.
|
In my experience at least |
This comment has been minimized.
This comment has been minimized.
|
FWIW, |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
In terms of the compiler's implementation, this isn't really about projection. It's not actually getting that far. Rather, it fails when lowering the AST into types, which is the point where we have to pick a trait. @eddyb has been doing a lot of heroic work refactoring the type-end to remove that limitation, which is fairly tricky -- the problem is that to do it properly, one must reason about the where-clauses that are in scope and do trait selection, but to know what where-clauses are in scope, one must lower them, and that is what we are trying to do. To resolve this, @eddyb has been refactoring the compiler to cope with partially lowered sets of where-clauses, basically. |
This comment has been minimized.
This comment has been minimized.
neuronsguy
commented
Mar 15, 2017
|
So, is @eddyb's fix for this being developed openly somewhere it's possible to track progress (or help?) This issue is causing me some frustration, so I'd love to know what I could do to help resolve it. |
This comment has been minimized.
This comment has been minimized.
|
I think he wound up taking another approach. I'm not sure what's the shortest path here just now. |
This comment has been minimized.
This comment has been minimized.
|
Perhaps keying the |
Mark-Simulacrum
referenced this issue
May 16, 2017
Closed
Unclear ambiguity on nested Associated Types #31372
Mark-Simulacrum
added
the
C-bug
label
Jul 26, 2017
This comment has been minimized.
This comment has been minimized.
|
This is a huge paper cut for me: I have a lot of code of the form There are two cases where this cuts me:
Having to disambiguate is the smaller paper cut. It would already be infinitely helpful if the error message would tell me if there is an actual ambiguity and where, or if it would tell me that there isn't an ambiguity. |
This comment has been minimized.
This comment has been minimized.
|
Maybe the problem is that what I understand by ambiguous (e.g. that two associated types are named equal) and what the compiler understands by ambiguous are different things. |
This comment has been minimized.
This comment has been minimized.
|
I've tried using syntax, that one would expect to work just fine, and have wound up with this issue. It's quite clear to any human that there exist no ambiguities in this code, yet the compiler unnecessarily requires extra (and ugly) syntax to accept the code. This is extremely inconvenient. |
This comment has been minimized.
This comment has been minimized.
alexlitty
commented
Apr 17, 2018
|
I'm not sure if chiming in and saying "me too" at this point is more annoying than helpful, but me too :) I think this one's hard on novice Rustaceans because we're interpreting the situation as human error, as if we've unintentionally made the situation ambiguous and there's something we can do to correct it. |
This comment has been minimized.
This comment has been minimized.
tiby312
commented
May 5, 2018
|
I would also love this. I've been "shortening" it like this, but this way there is an extra associated type that structs have to implement for no reason:
|
kennytm
referenced this issue
May 20, 2018
Closed
"ambiguous associated type" when there's not ambiguity #50905
This comment has been minimized.
This comment has been minimized.
purpleposeidon
commented
Jun 28, 2018
|
At the very least, the error message should be improved; it gives bad advice: |
aturon commentedNov 29, 2016
The following setup
produces the error
It would be great for the less explicit projection to work here.
cc @nikomatsakis