Skip to content

Commit d7c8950

Browse files
committed
tell people what to do when removing an error code
1 parent b60f7b5 commit d7c8950

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Diff for: compiler/rustc_error_codes/src/error_codes.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,8 @@ E0793: include_str!("./error_codes/E0793.md"),
516516
E0794: include_str!("./error_codes/E0794.md"),
517517
}
518518

519-
// Undocumented removed error codes. Note that many removed error codes are documented.
519+
// Undocumented removed error codes. Note that many removed error codes are kept in the list above
520+
// and marked as no-longer emitted with a note in the markdown file (see E0001 for an example).
520521
// E0006, // merged with E0005
521522
// E0008, // cannot bind by-move into a pattern guard
522523
// E0019, // merged into E0015

Diff for: src/tools/tidy/src/error_codes.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,11 @@ fn check_error_codes_used(
354354

355355
for code in error_codes {
356356
if !found_codes.contains(code) && !no_longer_emitted.contains(code) {
357-
errors.push(format!("Error code `{code}` exists, but is not emitted by the compiler!"))
357+
errors.push(format!(
358+
"Error code `{code}` exists, but is not emitted by the compiler!\n\
359+
Please mark the code as no longer emitted by adding the following note to the top of the `EXXXX.md` file:\n\
360+
`#### Note: this error code is no longer emitted by the compiler`"
361+
));
358362
}
359363

360364
if found_codes.contains(code) && no_longer_emitted.contains(code) {

0 commit comments

Comments
 (0)