You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
This would be linting on a whole feature, that got accepted through an RFC, which Clippy normally doesn't do.
But Clippy has the restriction lint group, where such a lint would be possible, but then has to be enabled explicitly. This lint would first require this feature to be implemented in rustc though.
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.
Reacted by Jonas Platte, Kornel and Mateusz Mikuła
Activity
flip1995 commentedon Apr 2, 2020
You mean a lint, that fires on every use of implicit args?
dylni commentedon Apr 2, 2020
Yes. If clippy stops after the first usage, that would work too, but I haven't found that to be how lints typically behave.
flip1995 commentedon Apr 2, 2020
This would be linting on a whole feature, that got accepted through an RFC, which Clippy normally doesn't do.
But Clippy has the
restrictionlint group, where such a lint would be possible, but then has to be enabled explicitly. This lint would first require this feature to be implemented in rustc though.dylni commentedon Apr 2, 2020
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.
MightyPork commentedon Apr 29, 2022
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.
dylni commentedon May 9, 2022
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