-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
False positive: print_literal and env! #2657
Comments
Yeah this is a tricky one... using a late pass converts all macros, so |
@oli-obk @phansch So I looked a bit more into this. I added a test for
I then tried to inspect what's going on as well as use Looking into the args at the time it's linted in
I'm very curious what the way to proceed here would be. I'm thinking this might require an EarlyLintPass, but I'm not entirely sure how to chain both together. |
I assumed I fixed this with rust-lang/rust#44248 Maybe it regressed again in rustc? |
Still present on rustc 1.29.0-nightly (64f7de9 2018-07-12), clipp 0.0.211. |
I can't reproduce this on the playground anymore, so I'm going ahead and will close this issue. Feel free to re-open if this still happens with a recent Clippy version. |
Found with clippy 0.0.193
I'm fairly certain that there isn't a way to shorten this as the docs suggest.
It looks as if this was discussed in #2617 and #2608. Whilst it's true that
println!(env!("FOO"))
is better thanprintln!("{}", env!("FOO"))
, I don't think there is an equivalent forprintln!("bar: {}", env!("FOO"))
.The text was updated successfully, but these errors were encountered: