mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-15 01:55:03 +00:00
31 lines
544 B
Rust
31 lines
544 B
Rust
// run-rustfix
|
|
|
|
#![warn(clippy::mismatched_target_os)]
|
|
#![allow(unused)]
|
|
|
|
#[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
|
|
#[cfg(all(not(any(windows, target_os = "cloudabi")), target_os = "wasi"))]
|
|
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() {}
|