-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Error E0399 regression on nightly from beta. #27377
Comments
That's completely intentional. In fact, 1.2.0 will soon warn on that condition too (#27364). |
@arielb1 Why is that intentional? It makes implementing traits that have a lot of default types and methods annoying, since often it makes having default types and methods useless, since if you override one, you've got to override everything. |
Having looked at the relevant part in the RFC, I can't see why that approach was taken. It makes more sense to me for the default function implementations to only be allowed to assume the constraints on the associated types, not their default types. |
@dylanede See #26728 (comment) -- we are planning to feature gate defaulted associated types, and will likely alter the semantics away from the RFC toward a design like the one you suggest. |
Should this issue be closed? |
If it is going to be closed then an issue about the changes to the design from the RFC that @aturon talked about should be opened first. |
I'm going to give this one a close, in favor of #29661 , the one tracking stabilizing associated types. |
I have found that with a trait of the form
I get the following error message on nightly (as of the time of this post), but not on beta.
I can possibly understand
get_a
needing to be reimplemented, butB
andget_b
as well?I don't get the error message when types do not have defaults, like so:
Note that it no longer errors out saying that the methods need to be reimplemented.
The text was updated successfully, but these errors were encountered: