Skip to content

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

Merged
merged 9 commits into from
Sep 15, 2015
Merged

Adding detailed error text for E0118 #28263

merged 9 commits into from
Sep 15, 2015

Conversation

alexispurslane
Copy link
Contributor

Contributing to the Rust error explanations. Should I also add a better error for it by default?

@rust-highfive
Copy link
Contributor

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):
Copy link
Contributor

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.

@nikomatsakis
Copy link
Contributor

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?

@alexispurslane
Copy link
Contributor Author

@nikomatsakis I did fix the incorrect error explanation, will you take a look at this (and maybe merge)?

@alexispurslane
Copy link
Contributor Author

In fact, I fixed it a while ago.

@alexispurslane
Copy link
Contributor Author

Can this be merged?

@alexispurslane
Copy link
Contributor Author

Is this going to be merged, @nikomatsakis? Should I close this PR?

@nikomatsakis
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Sep 14, 2015

📌 Commit eb53461 has been approved by nikomatsakis

@nikomatsakis
Copy link
Contributor

sorry for the delay :)

@bors
Copy link
Collaborator

bors commented Sep 15, 2015

⌛ Testing commit eb53461 with merge d2e13e8...

bors added a commit that referenced this pull request Sep 15, 2015
Contributing to the Rust error explanations. Should I also add a better error for it by default?
steveklabnik added a commit to steveklabnik/rust that referenced this pull request Sep 15, 2015
…nikomatsakis

Contributing to the Rust error explanations. Should I also add a better error for it by default?
@bors bors merged commit eb53461 into rust-lang:master Sep 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants