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