Open
Description
Lint name: mismatched_target_os
I tried this code:
fn main() {
// Clippy throws error
//#[cfg(linux)]
//println!("Hello, Linux!");
// Clippy doesn't care
if cfg!(linux) {
println!("Hello, Linux!");
}
}
I expected to see the error operating system used in target family position
here like you would see if you used the attribute #[cfg(linux)]
Instead, clippy doesn't give any error.
Meta
Rust version (rustc -Vv
):
rustc 1.52.1 (9bc8c42bb 2021-05-09)
binary: rustc
commit-hash: 9bc8c42bb2f19e745a63f3445f1ac248fb015e53
commit-date: 2021-05-09
host: x86_64-pc-windows-msvc
release: 1.52.1
LLVM version: 12.0.0