-
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
Add error explanations for all error codes (tracking issue). #24407
Comments
This is going to be a good thing, but do not forget to add the following lists: |
Thanks! I wasn't aware of those! |
I'll take E0152 through E0170, thanks! Question: Should I squash all the additions into a single commit, or keep them separate? |
I'll take E0009 (a little start to begin). |
@lfairy: Either is fine. If there are logical slabs of messages that could also work well. @GuillaumeGomez: Sounds good 😄 |
Thanks! |
I’ll take E0297 through E0302 (the ones in check_match). Edit: I’ll take E0162 and E0165 as well. I have not been able to come up with an example that causes 298, 299 or 300. Does anybody have a snippet that causes these? Anything I try fails with a type mismatch. Similarly, I have not been able to produce 158 yet, but there is an unnumbered error with a similar message. (Maybe those should be reconciled?) |
@ruud-v-a I'm already working on 158/162/165 (see my comment above) |
Sorry Chris, I only just noticed this now... If you have anything to add to Ruud's descriptions go ahead! I was hoping I could transform the list into a more complete one, but my script is somewhat broken so I'm looking into better ways to extract error information (uniqueness checking, finding errors without descriptions, HTML output). For now I've marked who's working on what in the current list. |
I just did E0296. |
I'll also take the loop ones, E0267 and E0268. |
@michaelsproul No worries :) I'll take E0306 and E0307. |
Could I try E0308-E0311? |
@cactorium: Go for it! 😄 |
@lfairy: oops, my apologies. I hope you don’t mind. |
I've tried my hand at E0015 and E0020 |
I now take E0018 (should I open a new PR for it or not ?). |
@GuillaumeGomez: You'll need a new PR as your previous one was just approved |
@michaelsproul: Yes, I just saw that. |
I've updated the diagnostic registration plugin so that it validates error descriptions. An error description is only valid if it starts and ends with a newline, and contains no more than 80 characters per line. The plugin forced me to fix E0005 and E0006 which had escaped manual attention! I've also added errors for E0267, E0268, E0296, whilst updating E0303 as per discussion in rust-lang#24143. cc rust-lang#24407
thanks :) |
As title :-) Part of #24407. r? @Manishearth
As title :-) Part of #24407. r? @Manishearth
…arth As title :-) Part of rust-lang#24407. r? @Manishearth
…arth As title :-) Part of rust-lang#24407. r? @Manishearth
…arth As title :-) Part of rust-lang#24407. r? @Manishearth
…arth As title :-) Part of rust-lang#24407. r? @Manishearth
…arth As title :-) Part of rust-lang#24407. r? @Manishearth
I'd like to see some description added to a specific error message: I notice that this is not in the spreadsheet/no EXXXX designation is associated with it. Is there any specific reason there is no error code associated with it? |
@joelmccracken No reason, we should fix that. @GuillaumeGomez has been working on these That's basically the "next step" of this issue.
|
I will take a more global look when I have time. Thanks for reporting this @joelmccracken. |
`--explain` support for E0163 and E0164. Part of #24407
OK, it's clearly time for me to admit that I'm not going to find time to get 321 done - apologies! Reproduction below: aux321.rs:
321.rs:
Should yield E0321. |
@AlisdairO: Thanks! I'll write in the next days then. PS: I post the RFC here: https://github.com/rust-lang/rfcs/blob/master/text/0019-opt-in-builtin-traits.md#default-and-negative-impls rust/src/librustc_typeck/coherence/orphan.rs Lines 295 to 318 in e3cd872
|
This is a metabug for
rustc --explain
error descriptions.All the errors in need of descriptions are listed in this spreadsheet. If you'd like to help out, comment with the bunch of errors you'd like to tackle, and list yourself as assigned on the spreadsheet!
Choosing a few errors in the same file is probably a good way to start.
How to add an error explanation
Error explanations live in
src/librustc*/diagnostics.rs
. To add a new explanation you have to delete the error from theregister_diagnostics!
invocation and add it to theregister_long_diagnostics!
invocation, along with the explanation. The format for the explanation is 80 characters per line, with a newline at the very start and end of the string. Including code examples is encouraged, with full markdown formatting (single-tick for inline, triple for blocks). Copy the format of the existing errors and you should be good!Once you've added an explanation you can test it out by compiling and running stage1 as follows:
If you want to see how it renders as HTML you'll have to build the error index, which requires stage2:
You can add
-j 4
to use 4 parallelmake
processes.Once you're happy with the result, submit a pull request and we'll review it.
Progress
We're tracking progress with a shared spreadsheet. If you'd like to write an error message, put your name down for one of the unassigned errors.
Rust Error Diagnostic Spreadsheet (click me!)
As you complete error descriptions it would also be great if you could mark the errors as "merged" on the spreadsheet 😄
The text was updated successfully, but these errors were encountered: