-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Lint against format_implicit_args #5404
Comments
You mean a lint, that fires on every use of implicit args? |
Yes. If clippy stops after the first usage, that would work too, but I haven't found that to be how lints typically behave. |
This would be linting on a whole feature, that got accepted through an RFC, which Clippy normally doesn't do. But Clippy has the |
The restriction group definitely makes the most sense. I figured it would need to be implemented in rustc first, but I wanted to create the issue now to see if this would even be considered with the RFC being accepted. There was some opposition on the RFC though, which also showed in the voting, so I think this could be generally useful. |
I would actually be interested in the opposite lint of the proposal here, a lint warning about the old syntax in format macros. It could even have automatic fix available. |
This could be similar to implicit_return and needless_return, which both exist for both styles. Also, this issue can now be unblocked. @rustbot labels: -S-blocked |
Would you consider a lint to warn for uses of the "format_implicit_args" feature now that rust-lang/rfcs#2795 has been merged?
As far as I'm aware, it's the only way the standard library provides for a string to be interpreted as a variable. It can be done using procedural macros, but that would require adding a crate as a dependency. So, I would prefer a lint against this, because I believe it to be an anti-pattern.
The text was updated successfully, but these errors were encountered: