Description
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:
- librustc
- librustc_trans
- librustc_passes
- librustc_plugin
- librustc_typeck
- librustc_privacy
- librustc_resolve
- librustc_borrowck
- librustc_metadata
- librustc_const_eval
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:
$ ./x.py test src/test/ui -- 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
You can add --jobs 4
to use 4 parallel make processes:
$ ./x.py build --stage 1 --jobs4
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