Skip to content

Add error explanations for all error codes #32777

Closed
@GuillaumeGomez

Description

@GuillaumeGomez

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:

$ ./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

cc @steveklabnik

Metadata

Metadata

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsA-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-help-wantedCall for participation: Help is requested to fix this issue.P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions