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 upindirect restrictions on Self in trait where clauses are not available when the trait is used as a bound #25409
Comments
steveklabnik
added
A-typesystem
A-traits
labels
May 18, 2015
This comment has been minimized.
This comment has been minimized.
|
This is a known issue - only supertraits are elaborated. This is required to ensure a trait-ref elaborates only finitely many others. As a workaround, you can always duplicate the where-clause. |
This comment has been minimized.
This comment has been minimized.
|
Thank you for the information and the suggested workaround, I don't think that idea crossed my mind at the time. Now if I could only remember what I needed this for in the first place... |
TimNN
referenced this issue
Jun 13, 2016
Open
Associated type equality not followed through multiple traits #34257
This comment has been minimized.
This comment has been minimized.
|
This is what stable says today about the test case:
|
brson
added
T-lang
I-nominated
labels
Jan 26, 2017
This comment has been minimized.
This comment has been minimized.
|
Lang team can you P-tag? |
This comment has been minimized.
This comment has been minimized.
|
NVM P-low |
brson
added
P-low
and removed
I-nominated
labels
Jan 26, 2017
This comment has been minimized.
This comment has been minimized.
|
Dupe of #20671 ? |
This comment has been minimized.
This comment has been minimized.
|
I think so. Closing as a duplicate of #20671. |
Mark-Simulacrum
closed this
May 20, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TimNN commentedMay 14, 2015
As you can see, the compiler enforces the bound in the traits where clause when implementing the trait, but seems to be unaware of it when the trait is used itself as a bound.
I don't know if the traits where clause should be valid or not, however if it is valid, the compiler should be aware of the additional information provided by it.
At least if I haven't completely misunderstood something.