-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Bad suggestion: nonminimal_bool
suggests replacing !cfg!(windows)
with true
.
#1885
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
This is likely related to this issue: https://github.com/Manishearth/rust-clippy/issues/1877 Basically clippy is losing its mind on macros right now. |
Okay let's see if this will be fixed after rust-lang/rust#43179 is shipped. |
Nope not fixed by it... Gotta figure out what else changed :/ |
It's not just clippy. Even rustc goes crazy: while cfg!(unix) {} // better use a `loop` here, because "infinite loop" and "reasons" xD EDIT: nevermind, it always did that :/ |
Maybe we should suggest a fix in rustc then |
rust-lang/rust#43268 done |
Test case:
Clippy will warn:
The suggestion (
try `true`
) is wrong because the code will lose portability. Instead Clippy should suggestcfg!(not(windows))
or just don't emit the warning.The text was updated successfully, but these errors were encountered: