1error: this `match` has identical arm bodies 2 --> $DIR/match_same_arms2.rs:20:14 3 | 4LL | _ => { 5 | ______________^ 6LL | | //~ ERROR match arms have same body 7LL | | foo(); 8LL | | let mut a = 42 + [23].len() as i32; 9... | 10LL | | a 11LL | | }, 12 | |_________^ 13 | 14 = note: `-D clippy::match-same-arms` implied by `-D warnings` 15note: same as this 16 --> $DIR/match_same_arms2.rs:11:15 17 | 18LL | 42 => { 19 | _______________^ 20LL | | foo(); 21LL | | let mut a = 42 + [23].len() as i32; 22LL | | if true { 23... | 24LL | | a 25LL | | }, 26 | |_________^ 27note: `42` has the same arm body as the `_` wildcard, consider removing it 28 --> $DIR/match_same_arms2.rs:11:15 29 | 30LL | 42 => { 31 | _______________^ 32LL | | foo(); 33LL | | let mut a = 42 + [23].len() as i32; 34LL | | if true { 35... | 36LL | | a 37LL | | }, 38 | |_________^ 39 40error: this `match` has identical arm bodies 41 --> $DIR/match_same_arms2.rs:34:15 42 | 43LL | 51 => foo(), //~ ERROR match arms have same body 44 | ^^^^^ 45 | 46note: same as this 47 --> $DIR/match_same_arms2.rs:33:15 48 | 49LL | 42 => foo(), 50 | ^^^^^ 51help: consider refactoring into `42 | 51` 52 --> $DIR/match_same_arms2.rs:33:9 53 | 54LL | 42 => foo(), 55 | ^^ 56 = help: ...or consider changing the match arm bodies 57 58error: this `match` has identical arm bodies 59 --> $DIR/match_same_arms2.rs:40:17 60 | 61LL | None => 24, //~ ERROR match arms have same body 62 | ^^ 63 | 64note: same as this 65 --> $DIR/match_same_arms2.rs:39:20 66 | 67LL | Some(_) => 24, 68 | ^^ 69help: consider refactoring into `Some(_) | None` 70 --> $DIR/match_same_arms2.rs:39:9 71 | 72LL | Some(_) => 24, 73 | ^^^^^^^ 74 = help: ...or consider changing the match arm bodies 75 76error: this `match` has identical arm bodies 77 --> $DIR/match_same_arms2.rs:62:28 78 | 79LL | (None, Some(a)) => bar(a), //~ ERROR match arms have same body 80 | ^^^^^^ 81 | 82note: same as this 83 --> $DIR/match_same_arms2.rs:61:28 84 | 85LL | (Some(a), None) => bar(a), 86 | ^^^^^^ 87help: consider refactoring into `(Some(a), None) | (None, Some(a))` 88 --> $DIR/match_same_arms2.rs:61:9 89 | 90LL | (Some(a), None) => bar(a), 91 | ^^^^^^^^^^^^^^^ 92 = help: ...or consider changing the match arm bodies 93 94error: this `match` has identical arm bodies 95 --> $DIR/match_same_arms2.rs:68:26 96 | 97LL | (.., Some(a)) => bar(a), //~ ERROR match arms have same body 98 | ^^^^^^ 99 | 100note: same as this 101 --> $DIR/match_same_arms2.rs:67:26 102 | 103LL | (Some(a), ..) => bar(a), 104 | ^^^^^^ 105help: consider refactoring into `(Some(a), ..) | (.., Some(a))` 106 --> $DIR/match_same_arms2.rs:67:9 107 | 108LL | (Some(a), ..) => bar(a), 109 | ^^^^^^^^^^^^^ 110 = help: ...or consider changing the match arm bodies 111 112error: this `match` has identical arm bodies 113 --> $DIR/match_same_arms2.rs:102:29 114 | 115LL | (Ok(_), Some(x)) => println!("ok {}", x), 116 | ^^^^^^^^^^^^^^^^^^^^ 117 | 118note: same as this 119 --> $DIR/match_same_arms2.rs:101:29 120 | 121LL | (Ok(x), Some(_)) => println!("ok {}", x), 122 | ^^^^^^^^^^^^^^^^^^^^ 123help: consider refactoring into `(Ok(x), Some(_)) | (Ok(_), Some(x))` 124 --> $DIR/match_same_arms2.rs:101:9 125 | 126LL | (Ok(x), Some(_)) => println!("ok {}", x), 127 | ^^^^^^^^^^^^^^^^ 128 = help: ...or consider changing the match arm bodies 129 = note: this error originates in the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info) 130 131error: this `match` has identical arm bodies 132 --> $DIR/match_same_arms2.rs:117:18 133 | 134LL | Ok(_) => println!("ok"), 135 | ^^^^^^^^^^^^^^ 136 | 137note: same as this 138 --> $DIR/match_same_arms2.rs:116:18 139 | 140LL | Ok(3) => println!("ok"), 141 | ^^^^^^^^^^^^^^ 142help: consider refactoring into `Ok(3) | Ok(_)` 143 --> $DIR/match_same_arms2.rs:116:9 144 | 145LL | Ok(3) => println!("ok"), 146 | ^^^^^ 147 = help: ...or consider changing the match arm bodies 148 = note: this error originates in the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info) 149 150error: this `match` has identical arm bodies 151 --> $DIR/match_same_arms2.rs:144:14 152 | 153LL | 1 => { 154 | ______________^ 155LL | | empty!(0); 156LL | | }, 157 | |_________^ 158 | 159note: same as this 160 --> $DIR/match_same_arms2.rs:141:14 161 | 162LL | 0 => { 163 | ______________^ 164LL | | empty!(0); 165LL | | }, 166 | |_________^ 167help: consider refactoring into `0 | 1` 168 --> $DIR/match_same_arms2.rs:141:9 169 | 170LL | 0 => { 171 | ^ 172 = help: ...or consider changing the match arm bodies 173 174error: match expression looks like `matches!` macro 175 --> $DIR/match_same_arms2.rs:162:16 176 | 177LL | let _ans = match x { 178 | ________________^ 179LL | | E::A => false, 180LL | | E::B => false, 181LL | | _ => true, 182LL | | }; 183 | |_____^ help: try this: `!matches!(x, E::A | E::B)` 184 | 185 = note: `-D clippy::match-like-matches-macro` implied by `-D warnings` 186 187error: aborting due to 9 previous errors 188 189