2020-04-22 16:01:25 -05:00
|
|
|
// run-rustfix
|
|
|
|
|
|
|
|
#![warn(clippy::mismatched_target_os)]
|
|
|
|
#![allow(unused)]
|
|
|
|
|
2020-04-25 13:55:46 -05:00
|
|
|
// unix
|
|
|
|
|
2020-04-22 16:01:25 -05:00
|
|
|
#[cfg(target_os = "linux")]
|
|
|
|
fn linux() {}
|
|
|
|
|
|
|
|
#[cfg(target_os = "freebsd")]
|
|
|
|
fn freebsd() {}
|
|
|
|
|
|
|
|
#[cfg(target_os = "dragonfly")]
|
|
|
|
fn dragonfly() {}
|
|
|
|
|
|
|
|
#[cfg(target_os = "openbsd")]
|
|
|
|
fn openbsd() {}
|
|
|
|
|
|
|
|
#[cfg(target_os = "netbsd")]
|
|
|
|
fn netbsd() {}
|
|
|
|
|
|
|
|
#[cfg(target_os = "macos")]
|
|
|
|
fn macos() {}
|
|
|
|
|
|
|
|
#[cfg(target_os = "ios")]
|
|
|
|
fn ios() {}
|
|
|
|
|
|
|
|
#[cfg(target_os = "android")]
|
|
|
|
fn android() {}
|
|
|
|
|
2020-04-25 13:55:46 -05:00
|
|
|
#[cfg(target_os = "emscripten")]
|
|
|
|
fn emscripten() {}
|
|
|
|
|
|
|
|
#[cfg(target_os = "fuchsia")]
|
|
|
|
fn fuchsia() {}
|
|
|
|
|
|
|
|
#[cfg(target_os = "haiku")]
|
|
|
|
fn haiku() {}
|
|
|
|
|
|
|
|
#[cfg(target_os = "redox")]
|
|
|
|
fn redox() {}
|
|
|
|
|
|
|
|
#[cfg(target_os = "solaris")]
|
|
|
|
fn solaris() {}
|
|
|
|
|
|
|
|
#[cfg(target_os = "vxworks")]
|
|
|
|
fn vxworks() {}
|
|
|
|
|
|
|
|
// non-unix
|
|
|
|
|
|
|
|
#[cfg(target_os = "cloudabi")]
|
|
|
|
fn cloudabi() {}
|
|
|
|
|
|
|
|
#[cfg(target_os = "hermit")]
|
|
|
|
fn hermit() {}
|
|
|
|
|
|
|
|
#[cfg(target_os = "wasi")]
|
|
|
|
fn wasi() {}
|
|
|
|
|
|
|
|
#[cfg(target_os = "none")]
|
|
|
|
fn none() {}
|
|
|
|
|
|
|
|
// list with conditions
|
2020-04-22 16:01:25 -05:00
|
|
|
#[cfg(all(not(any(windows, target_os = "linux")), target_os = "freebsd"))]
|
|
|
|
fn list() {}
|
|
|
|
|
|
|
|
// windows is a valid target family, should be ignored
|
|
|
|
#[cfg(windows)]
|
|
|
|
fn windows() {}
|
|
|
|
|
|
|
|
// correct use, should be ignored
|
|
|
|
#[cfg(target_os = "freebsd")]
|
|
|
|
fn freebsd() {}
|
|
|
|
|
|
|
|
fn main() {}
|