Description
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).
$ rustc --explain E0489 # "type/lifetime parameter not in scope here"
error: no extended information for E0489
$ rustc --explain E9999nonexisting
error: no extended information for E9999nonexisting
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 editing expand_build_diagnostic_array
to give us a [(&str, Option<&str>)]
of code–maybe-explanation pairs instead of a [(&str, &str)]
of code–explanation pairs, editing errors::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.