Skip to content

Add error explanations for all error codes #32777

Open
GuillaumeGomez opened this Issue · 2 comments

2 participants

@GuillaumeGomez
The Rust Programming Language member

This is a reopening of #24407 issue. So I took back what was already there and updated it:

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:

To add a new explanation you have to delete the error from the register_diagnostics! invocation and add it to the register_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.

Please refer to this RFC when you'll write your error explanation (it can also helps you to start if don't know how to write it).

Once you've added an explanation you can test it out by compiling and running stage1 as follows:

$ make rustc-stage1
$ export PATH=x86_64-unknown-linux-gnu/stage1/bin:$PATH
$ export LD_LIBRARY_PATH=x86_64-unknown-linux-gnu/stage1/lib:$LD_LIBRARY_PATH
$ rustc --explain EXXXX

If you want to see how it renders as HTML you'll have to build the error index, which requires stage2:

$ make doc/error-index.html

You can add -j 4 to use 4 parallel make processes:

$ make rustc-stage1 -j4
$ make doc/error-index.html -j4

Once you're happy with the result, submit a pull request and we'll review it.

Progress

  • E0090
  • E0103
  • E0104
  • E0167
  • E0174
  • E0182
  • E0183
  • E0196
  • E0203
  • E0208
  • E0212
  • E0224
  • E0226
  • E0227
  • E0228
  • E0230
  • E0231
  • E0238
  • E0242
  • E0245
  • E0254
  • E0278
  • E0279
  • E0280
  • E0284
  • E0298
  • E0299
  • E0311
  • E0312
  • E0313
  • E0314
  • E0315
  • E0316
  • E0320
  • E0328
  • E0374
  • E0375
  • E0376
  • E0377
  • E0385
  • E0388
  • E0389
  • E0393
  • E0399
  • E0402
  • E0406
  • E0408
  • E0409
  • E0410
  • E0414
  • E0418
  • E0420
  • E0421
  • E0427
  • E0429
  • E0434
  • E0436
  • E0453
  • E0455
  • E0456
  • E0457
  • E0460
  • E0461
  • E0462
  • E0464
  • E0465
  • E0466
  • E0467
  • E0468
  • E0469
  • E0470
  • E0471
  • E0472
  • E0473
  • E0474
  • E0475
  • E0476
  • E0477
  • E0478
  • E0479
  • E0480
  • E0481
  • E0482
  • E0483
  • E0484
  • E0485
  • E0486
  • E0487
  • E0488
  • E0489
  • E0490
  • E0491
  • E0495
  • E0498
  • E0500
  • E0501
  • E0502
  • E0503
  • E0504
  • E0505
  • E0506
  • E0507
  • E0508
  • E0509
  • E0513
  • E0514
  • E0519
  • E0520
  • E0521
  • E0523

cc @steveklabnik

@GuillaumeGomez GuillaumeGomez added E-easy and removed E-easy labels
@marti1125

I would like to take this =D How to I can start?

@wesleywiser wesleywiser added a commit to wesleywiser/rust that referenced this issue
@wesleywiser wesleywiser Add error description for E0436
Part of #32777
1fea13a
@GuillaumeGomez GuillaumeGomez self-assigned this
@GuillaumeGomez
The Rust Programming Language member

@marti1125: I guess the first step is to find one of the listed error codes into the rust source code (github search makes it easy) and then try to get the error with rust code. From there, just follow the description of this issue and if you need help, you can always ask (here or on IRC on #rust-docs chan).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.