--explain
should disambiguate nonexistent from underdocumented error codes
#44710
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
E-mentor
Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
The
--explain EXXX
functionality (does anyone still uses this now that it's no longer advertised so hard?) gives the same "no extended information" message for real error codes that don't have a "long" explanation written, and nonexistent codes. These messages should be disambiguated (as "no extended information for E0XXX" vs. "E0XXX does not exist" or similar).I thought this would be straightforward to implement: we do keep track of codes without explanations (which get successfully plumbed through to the error index, although the CSS hides them), only to throw that information away when macroexpanding the arrays that ultimately stock the
--explain
functionality. So this should, you would think, just be a matter of editingexpand_build_diagnostic_array
to give us a[(&str, Option<&str>)]
of code–maybe-explanation pairs instead of a[(&str, &str)]
of code–explanation pairs, editingerrors::Registry
reflect that, and making the driver care.But when I actually do this (zackmdavis/rust@048dde26e) ... my changes to
expand_build_diagnostic_array
seem to have absolutely no effect (!?!); we still get a[(&str, &str)]
even though I thought my code pretty clearly said otherwise, on more than one day that I've looked at this. I hereby give up in despair, bafflement, and tears.This issue has been assigned to @jakevossen5 via this comment.
The text was updated successfully, but these errors were encountered: