-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Add error explaination for E0182, E0230 and E0399 #37244
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 @GuillaumeGomez (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. Due to 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. |
src/librustc_typeck/diagnostics.rs
Outdated
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.
"Erroneous code example" sentence needs to be on its own line.
src/librustc_typeck/diagnostics.rs
Outdated
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.
It's better to avoid putting the main function in the examples.
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.
Are you thinking it would be better to just have that line floating after the trait impl?
trait Foo {
type A;
fn bar() -> isize;
}
impl Foo for isize {
type A = usize;
fn bar() -> isize { 42 }
}
// error: unexpected binding of associated item in expression path
let x: isize = Foo::<A=usize>::bar();
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.
Yes. The point is to avoid any unneeded "noise". Everyone knows that code needs to go inside a function and it's not what we're trying to do in here. In the generated output, everything (or almost) is put inside a main function so don't worry about it.
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.
You didn't fix this one.
src/librustc_typeck/diagnostics.rs
Outdated
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.
"its"
src/librustc_typeck/diagnostics.rs
Outdated
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.
Missing empty line before this one.
src/librustc_typeck/diagnostics.rs
Outdated
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.
"params" -> "parameters"
"compilation" -> "the compilation" (I find it better this way but totally open to debate)
src/librustc_typeck/diagnostics.rs
Outdated
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.
"its"
src/librustc_typeck/diagnostics.rs
Outdated
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.
"its"
src/librustc_typeck/diagnostics.rs
Outdated
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.
The explanation isn't really explaining anything in here. :-/
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.
Maybe "To fix this, add an implementation for each default method from the trait:"?
src/librustc_typeck/diagnostics.rs
Outdated
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.
I wonder if there are enough details or not... Hard to say from my point of view... :-/
What do you think of this @steveklabnik ?
Thanks for your work! Just a few typos/nits/improvements and it should be good. :) |
@GuillaumeGomez Just pushed up another commit with the fixes |
All good, thanks again! @bors: r+ rollup |
📌 Commit 94c1220 has been approved by |
@bors: r- |
src/librustc_typeck/diagnostics.rs
Outdated
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.
You didn't fix this one.
src/librustc_typeck/diagnostics.rs
Outdated
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.
"Example of erroneous code example" should be on its own line.
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.
D'oh, good catch.
Sorry, missed remaining things... Also, once done, can you squash the extra commits please (just keep the 3 first ones). If you don't know how to do it, take a look here. |
94c1220
to
9365586
Compare
@GuillaumeGomez No problem, I must have missed that. I fixed up the original 3 commits to include the fixes. |
Ok, now it's good! Thanks again. :) @bors: r+ rollup |
📌 Commit 9365586 has been approved by |
…r=GuillaumeGomez Add error explaination for E0182, E0230 and E0399 This PR adds some error descriptions requested in issue rust-lang#32777. r? @GuillaumeGomez Specifically this adds descriptions for E0182 - unexpected binding of associated item in expression path E0230 - missing type parameter from on_unimplemented description E0399 - overriding a trait type without re-implementing default methods
This PR adds some error descriptions requested in issue #32777.
r? @GuillaumeGomez
Specifically this adds descriptions for
E0182 - unexpected binding of associated item in expression path
E0230 - missing type parameter from on_unimplemented description
E0399 - overriding a trait type without re-implementing default methods