-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Provide a better error on anonymous parameters in unexpected locations #120357
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
Comments
Which version did it last work on? |
RFC 1685 says 2015 edition allows anonymous parameters in trait methods, and this still works. Anonymous parameters in concrete methods appears to never have compiled. |
@rustbot label A-diagnostics |
Ah, my bad. I did have issues compiling some old crates due to this, but I suppose it's possible they had |
The Reference seems to agree: https://doc.rust-lang.org/reference/items/functions.html#fn-param-2015 |
It was made a warning in 1.53 (#82918) I think it has only been supported inside trait definitions though: rust/tests/ui/no-patterns-in-args-2.rs Line 10 in 69db514
|
In edition 2015, the following is supposed to be legal (playground):
It is essentially semantically equivalent to
Unfortunately, even though edition 2015 is enabled, the following error is generated:
which explains that it was "removed in the 2018 edition". This should be irrelevant, as neither that edition, nor any later edition, is enabled.
RFC 1685 does not appear to describe breaking this in edition 2015, so I believe this to be a bug.
It causes a good amount of (quite old) crates to be impossible to build for no reason, which is unfortunate.
The text was updated successfully, but these errors were encountered: