rust-clippy/tests/ui/mismatched_target_os_non_unix.rs

28 lines
410 B
Rust
Raw Normal View History

//@run-rustfix
2020-04-26 19:26:19 +00:00
#![warn(clippy::mismatched_target_os)]
#![allow(unused)]
#[cfg(hermit)]
fn hermit() {}
#[cfg(wasi)]
fn wasi() {}
#[cfg(none)]
fn none() {}
// list with conditions
2020-10-27 13:10:31 +00:00
#[cfg(all(not(windows), wasi))]
2020-04-26 19:26:19 +00:00
fn list() {}
// windows is a valid target family, should be ignored
#[cfg(windows)]
fn windows() {}
// correct use, should be ignored
#[cfg(target_os = "hermit")]
fn correct() {}
fn main() {}