Invalid format string with certain fill characters yields incorrect suggestion #139104
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
The following line that's missing an alignment specifier between the (intended) fill character
_
and width+precision1.4
:makes the compiler think we're trying to access a tuple field and helpfully but incorrectly suggests replacing it with
which is, of course, invalid syntax. The same holds for any alphabetic character as well as
.
.Current output
Desired output
Other cases
Using a non-alphanumeric fill character that's not
[._+-]
yields a different error message that is not incorrect but is perhaps not very helpful:Rust Version
The text was updated successfully, but these errors were encountered: