1 error: this `match` has identical arm bodies
2 --> $DIR/match_same_arms2.rs:20:14
6 LL | | //~ ERROR match arms have same body
8 LL | | let mut a = 42 + [23].len() as i32;
14 = note: `-D clippy::match-same-arms` implied by `-D warnings`
16 --> $DIR/match_same_arms2.rs:11:15
21 LL | | let mut a = 42 + [23].len() as i32;
27 note: `42` has the same arm body as the `_` wildcard, consider removing it
28 --> $DIR/match_same_arms2.rs:11:15
33 LL | | let mut a = 42 + [23].len() as i32;
40 error: this `match` has identical arm bodies
41 --> $DIR/match_same_arms2.rs:34:15
43 LL | 51 => foo(), //~ ERROR match arms have same body
47 --> $DIR/match_same_arms2.rs:33:15
51 help: consider refactoring into `42 | 51`
52 --> $DIR/match_same_arms2.rs:33:9
56 = help: ...or consider changing the match arm bodies
58 error: this `match` has identical arm bodies
59 --> $DIR/match_same_arms2.rs:40:17
61 LL | None => 24, //~ ERROR match arms have same body
65 --> $DIR/match_same_arms2.rs:39:20
69 help: consider refactoring into `Some(_) | None`
70 --> $DIR/match_same_arms2.rs:39:9
74 = help: ...or consider changing the match arm bodies
76 error: this `match` has identical arm bodies
77 --> $DIR/match_same_arms2.rs:62:28
79 LL | (None, Some(a)) => bar(a), //~ ERROR match arms have same body
83 --> $DIR/match_same_arms2.rs:61:28
85 LL | (Some(a), None) => bar(a),
87 help: consider refactoring into `(Some(a), None) | (None, Some(a))`
88 --> $DIR/match_same_arms2.rs:61:9
90 LL | (Some(a), None) => bar(a),
92 = help: ...or consider changing the match arm bodies
94 error: this `match` has identical arm bodies
95 --> $DIR/match_same_arms2.rs:68:26
97 LL | (.., Some(a)) => bar(a), //~ ERROR match arms have same body
101 --> $DIR/match_same_arms2.rs:67:26
103 LL | (Some(a), ..) => bar(a),
105 help: consider refactoring into `(Some(a), ..) | (.., Some(a))`
106 --> $DIR/match_same_arms2.rs:67:9
108 LL | (Some(a), ..) => bar(a),
110 = help: ...or consider changing the match arm bodies
112 error: this `match` has identical arm bodies
113 --> $DIR/match_same_arms2.rs:102:29
115 LL | (Ok(_), Some(x)) => println!("ok {}", x),
116 | ^^^^^^^^^^^^^^^^^^^^
119 --> $DIR/match_same_arms2.rs:101:29
121 LL | (Ok(x), Some(_)) => println!("ok {}", x),
122 | ^^^^^^^^^^^^^^^^^^^^
123 help: consider refactoring into `(Ok(x), Some(_)) | (Ok(_), Some(x))`
124 --> $DIR/match_same_arms2.rs:101:9
126 LL | (Ok(x), Some(_)) => println!("ok {}", x),
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)
131 error: this `match` has identical arm bodies
132 --> $DIR/match_same_arms2.rs:117:18
134 LL | Ok(_) => println!("ok"),
138 --> $DIR/match_same_arms2.rs:116:18
140 LL | Ok(3) => println!("ok"),
142 help: consider refactoring into `Ok(3) | Ok(_)`
143 --> $DIR/match_same_arms2.rs:116:9
145 LL | Ok(3) => println!("ok"),
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)
150 error: this `match` has identical arm bodies
151 --> $DIR/match_same_arms2.rs:144:14
160 --> $DIR/match_same_arms2.rs:141:14
167 help: consider refactoring into `0 | 1`
168 --> $DIR/match_same_arms2.rs:141:9
172 = help: ...or consider changing the match arm bodies
174 error: match expression looks like `matches!` macro
175 --> $DIR/match_same_arms2.rs:162:16
177 LL | let _ans = match x {
179 LL | | E::A => false,
180 LL | | E::B => false,
183 | |_____^ help: try this: `!matches!(x, E::A | E::B)`
185 = note: `-D clippy::match-like-matches-macro` implied by `-D warnings`
187 error: aborting due to 9 previous errors