3 #![deny(clippy::wildcard_enum_match_arm)]
4 #![allow(unreachable_code, unused_variables, dead_code, clippy::single_match)]
6 use std::io::ErrorKind;
8 #[derive(Clone, Copy, Debug, Eq, PartialEq)]
18 fn is_monochrome(self) -> bool {
20 Color::Red | Color::Green | Color::Blue => true,
21 Color::Rgb(r, g, b) => r | g == 0 || r | b == 0 || g | b == 0,
28 let color = Color::Rgb(0, 0, 127);
30 Color::Red => println!("Red"),
31 Color::Green | Color::Blue | Color::Rgb(..) | Color::Cyan => eprintln!("Not red"),
34 Color::Red => println!("Red"),
35 _not_red @ Color::Green | _not_red @ Color::Blue | _not_red @ Color::Rgb(..) | _not_red @ Color::Cyan => eprintln!("Not red"),
37 let _str = match color {
38 Color::Red => "Red".to_owned(),
39 not_red @ Color::Green | not_red @ Color::Blue | not_red @ Color::Rgb(..) | not_red @ Color::Cyan => format!("{:?}", not_red),
46 c if c.is_monochrome() => {},
47 Color::Rgb(_, _, _) => {},
49 let _str = match color {
51 c @ Color::Green | c @ Color::Blue | c @ Color::Rgb(_, _, _) | c @ Color::Cyan => "Not red",
54 Color::Rgb(r, _, _) if r > 0 => "Some red",
55 Color::Red | Color::Green | Color::Blue | Color::Rgb(..) | Color::Cyan => "No red",
58 Color::Red | Color::Green | Color::Blue | Color::Cyan => {},
61 let x: u8 = unimplemented!();
67 // We need to use an enum not defined in this test because non_exhaustive is ignored for the
68 // purposes of dead code analysis within a crate.
69 let error_kind = ErrorKind::NotFound;
71 ErrorKind::NotFound => {},
72 std::io::ErrorKind::PermissionDenied | std::io::ErrorKind::ConnectionRefused | std::io::ErrorKind::ConnectionReset | std::io::ErrorKind::ConnectionAborted | std::io::ErrorKind::NotConnected | std::io::ErrorKind::AddrInUse | std::io::ErrorKind::AddrNotAvailable | std::io::ErrorKind::BrokenPipe | std::io::ErrorKind::AlreadyExists | std::io::ErrorKind::WouldBlock | std::io::ErrorKind::InvalidInput | std::io::ErrorKind::InvalidData | std::io::ErrorKind::TimedOut | std::io::ErrorKind::WriteZero | std::io::ErrorKind::Interrupted | std::io::ErrorKind::Other | std::io::ErrorKind::UnexpectedEof | _ => {},
75 ErrorKind::NotFound => {},
76 ErrorKind::PermissionDenied => {},
77 ErrorKind::ConnectionRefused => {},
78 ErrorKind::ConnectionReset => {},
79 ErrorKind::ConnectionAborted => {},
80 ErrorKind::NotConnected => {},
81 ErrorKind::AddrInUse => {},
82 ErrorKind::AddrNotAvailable => {},
83 ErrorKind::BrokenPipe => {},
84 ErrorKind::AlreadyExists => {},
85 ErrorKind::WouldBlock => {},
86 ErrorKind::InvalidInput => {},
87 ErrorKind::InvalidData => {},
88 ErrorKind::TimedOut => {},
89 ErrorKind::WriteZero => {},
90 ErrorKind::Interrupted => {},
91 ErrorKind::Other => {},
92 ErrorKind::UnexpectedEof => {},