Confusing error message if you forget the width of the * format specifier #49384
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Playground link: https://play.rust-lang.org/?gist=fea3e7d4c4151751bb66b69ba906ea88&version=stable
If the
*
formatting specifier is used, it expects an additional argument. But it does not account for this when printing an error message, so in the above example where an argument was forgotten, the error is "error: 1 positional argument in format string, but there is 1 argument". It should indicate that there are in fact 2 positional arguments in the format string, due to*
.The text was updated successfully, but these errors were encountered: