-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Named format arguments introduce implicit positional arguments #93378
Comments
@rustbot prioritize |
Oh dear. We should fix this quickly, before any code starts depending on this. |
|
Yes, but that's not as bad, and arguably the right thing. The problem we should fix is the implicit captures getting used for |
This should fix it: #93394 |
I just ran into this as well and reported #93415; I've tightened that one to just the fact that named arguments count as positional, so discussion on that can happen there. |
Assigning priority as discussed in the prioritization working group. |
We discussed this in today's @rust-lang/lang meeting, and we agreed that 1) we'd like this to stop being accepted, ASAP, and 2) we don't consider the PR fixing this to need T-lang review or approval. |
Don't allow {} to refer to implicit captures in format_args. Fixes rust-lang#93378
Don't allow {} to refer to implicit captures in format_args. Fixes rust-lang#93378
I tried this code:
I expected to see a compile error that says that there are missing positional arguments or that it is prohibited to mix positional and named parameters.
Instead, this compiles and prints the following:
This code is available on the playground.
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: