3 #[derive(Copy, Clone, PartialEq, Eq)]
4 pub struct Opcode(pub u8);
7 pub const OP1: Opcode = Opcode(0x1);
10 pub fn example1(msg_type: Opcode) -> impl FnMut(&[u8]) {
11 move |i| match msg_type {
12 //~^ ERROR: non-exhaustive patterns: `Opcode(0_u8)` and `Opcode(2_u8..=u8::MAX)` not covered
13 Opcode::OP1 => unimplemented!(),
17 #[derive(Copy, Clone, PartialEq, Eq)]
18 pub struct Opcode2(Opcode);
21 pub const OP2: Opcode2 = Opcode2(Opcode(0x1));
25 pub fn example2(msg_type: Opcode2) -> impl FnMut(&[u8]) {
27 move |i| match msg_type {
28 //~^ ERROR: non-exhaustive patterns: `Opcode2(Opcode(0_u8))` and `Opcode2(Opcode(2_u8..=u8::MAX))` not covered
29 Opcode2::OP2=> unimplemented!(),