Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid diagnostic for 'extra required argument' for explicit numbered precision argument. #100995

Closed
m-ou-se opened this issue Aug 25, 2022 · 0 comments · Fixed by #101000
Closed
Assignees
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.

Comments

@m-ou-se
Copy link
Member

m-ou-se commented Aug 25, 2022

error: 2 positional arguments in format string, but no arguments were given
 --> src/main.rs:2:14
  |
2 |     format!("{:.0$}");
  |              ^^---^
  |                |
  |                this precision flag adds an extra required argument at position 0, which is why there are 2 arguments expected
  |

It says there are two arguments expected, but that's not true. This only needs one argument.

@m-ou-se m-ou-se added 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. labels Aug 25, 2022
@m-ou-se m-ou-se self-assigned this Aug 25, 2022
@bors bors closed this as completed in 0b6faca Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant