1 // run-rustfix
2 
3 #![warn(clippy::mismatched_target_os)]
4 #![allow(unused)]
5 
6 #[cfg(linux)]
linux()7 fn linux() {}
8 
9 #[cfg(freebsd)]
freebsd()10 fn freebsd() {}
11 
12 #[cfg(dragonfly)]
dragonfly()13 fn dragonfly() {}
14 
15 #[cfg(openbsd)]
openbsd()16 fn openbsd() {}
17 
18 #[cfg(netbsd)]
netbsd()19 fn netbsd() {}
20 
21 #[cfg(macos)]
macos()22 fn macos() {}
23 
24 #[cfg(ios)]
ios()25 fn ios() {}
26 
27 #[cfg(android)]
android()28 fn android() {}
29 
30 #[cfg(emscripten)]
emscripten()31 fn emscripten() {}
32 
33 #[cfg(fuchsia)]
fuchsia()34 fn fuchsia() {}
35 
36 #[cfg(haiku)]
haiku()37 fn haiku() {}
38 
39 #[cfg(illumos)]
illumos()40 fn illumos() {}
41 
42 #[cfg(l4re)]
l4re()43 fn l4re() {}
44 
45 #[cfg(redox)]
redox()46 fn redox() {}
47 
48 #[cfg(solaris)]
solaris()49 fn solaris() {}
50 
51 #[cfg(vxworks)]
vxworks()52 fn vxworks() {}
53 
54 // list with conditions
55 #[cfg(all(not(any(solaris, linux)), freebsd))]
list()56 fn list() {}
57 
58 // correct use, should be ignored
59 #[cfg(target_os = "freebsd")]
correct()60 fn correct() {}
61 
main()62 fn main() {}
63