-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Adding detailed error text for E0118 #28263
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
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nikomatsakis (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
E0118: r##" | ||
Rust can't find a base type for an implementation you are providing, or the type | ||
cannot have an implementation. For example, a typedef can't have an | ||
implementation, since it isn't its own type (this was done in PR #6087): |
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.
This text isn't quite accurate. Whether something is a type alias is not relevant. See for example this code on play. The rule is that you can only do an inherent impl (meaning, an impl without a trait) for a named type (struct, enum, or trait) defined in the local crate. The reason that your example below is prohibited is because the type [char, ..9]
is an array type, which is not a named type.
Thanks for the suggestion -- updating the help text is always appreciated. That said, I left a correction here: #28263 (comment) Can you update the text accordingly? |
@nikomatsakis I did fix the incorrect error explanation, will you take a look at this (and maybe merge)? |
In fact, I fixed it a while ago. |
Can this be merged? |
Is this going to be merged, @nikomatsakis? Should I close this PR? |
@bors r+ rollup |
📌 Commit eb53461 has been approved by |
sorry for the delay :) |
Contributing to the Rust error explanations. Should I also add a better error for it by default?
…nikomatsakis Contributing to the Rust error explanations. Should I also add a better error for it by default?
Contributing to the Rust error explanations. Should I also add a better error for it by default?