-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Nonsense suggestion for concat!(x)
#52347
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
@csmoe, we might get away with |
It'd be ideal if we could also keep the |
@estebank I suspect this issue is more complex than I thought, here is a testcase: fn main() {
concat!(a); // ERROR: ("{}", a)
println!(a); // FINE: ("{}", a)
} playground The only way I can think of is splitting |
What I think should be done is for the suggestion to be moved to |
Improve suggestion for missing fmt str in println Avoid using `concat!(fmt, "\n")` to improve the diagnostics being emitted when the first `println!()` argument isn't a formatting string literal. Fix #52347.
Improve suggestion for missing fmt str in println Avoid using `concat!(fmt, "\n")` to improve the diagnostics being emitted when the first `println!()` argument isn't a formatting string literal. Fix #52347.
Improve suggestion for missing fmt str in println Avoid using `concat!(fmt, "\n")` to improve the diagnostics being emitted when the first `println!()` argument isn't a formatting string literal. Fix #52347.
Improve suggestion for missing fmt str in println Avoid using `concat!(fmt, "\n")` to improve the diagnostics being emitted when the first `println!()` argument isn't a formatting string literal. Fix #52347.
The error for
concat!(x)
is:That suggestion will clearly not work and gets worse when there are more arguments:
This suggestion was added by #51614. cc. @csmoe, @estebank
The text was updated successfully, but these errors were encountered: