1 error: this match arm has an identical body to the `_` wildcard arm
2 --> $DIR/match_same_arms2.rs:15:9
6 LL | | let mut a = 42 + [23].len() as i32;
11 | |_________^ help: try removing the arm
13 = help: or try changing either arm body
14 note: `_` wildcard arm here
15 --> $DIR/match_same_arms2.rs:24:9
18 LL | | //~ ERROR match arms have same body
20 LL | | let mut a = 42 + [23].len() as i32;
25 = note: `-D clippy::match-same-arms` implied by `-D warnings`
27 error: this match arm has an identical body to another arm
28 --> $DIR/match_same_arms2.rs:38:9
30 LL | 51 => foo(), //~ ERROR match arms have same body
33 | help: try merging the arm patterns: `51 | 42`
35 = help: or try changing either arm body
37 --> $DIR/match_same_arms2.rs:37:9
42 error: this match arm has an identical body to another arm
43 --> $DIR/match_same_arms2.rs:44:9
45 LL | None => 24, //~ ERROR match arms have same body
48 | help: try merging the arm patterns: `None | Some(_)`
50 = help: or try changing either arm body
52 --> $DIR/match_same_arms2.rs:43:9
57 error: this match arm has an identical body to another arm
58 --> $DIR/match_same_arms2.rs:66:9
60 LL | (None, Some(a)) => bar(a), //~ ERROR match arms have same body
61 | ---------------^^^^^^^^^^
63 | help: try merging the arm patterns: `(None, Some(a)) | (Some(a), None)`
65 = help: or try changing either arm body
67 --> $DIR/match_same_arms2.rs:65:9
69 LL | (Some(a), None) => bar(a),
70 | ^^^^^^^^^^^^^^^^^^^^^^^^^
72 error: this match arm has an identical body to another arm
73 --> $DIR/match_same_arms2.rs:71:9
75 LL | (Some(a), ..) => bar(a),
76 | -------------^^^^^^^^^^
78 | help: try merging the arm patterns: `(Some(a), ..) | (.., Some(a))`
80 = help: or try changing either arm body
82 --> $DIR/match_same_arms2.rs:72:9
84 LL | (.., Some(a)) => bar(a), //~ ERROR match arms have same body
85 | ^^^^^^^^^^^^^^^^^^^^^^^
87 error: this match arm has an identical body to another arm
88 --> $DIR/match_same_arms2.rs:105:9
90 LL | (Ok(x), Some(_)) => println!("ok {}", x),
91 | ----------------^^^^^^^^^^^^^^^^^^^^^^^^
93 | help: try merging the arm patterns: `(Ok(x), Some(_)) | (Ok(_), Some(x))`
95 = help: or try changing either arm body
97 --> $DIR/match_same_arms2.rs:106:9
99 LL | (Ok(_), Some(x)) => println!("ok {}", x),
100 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
102 error: this match arm has an identical body to another arm
103 --> $DIR/match_same_arms2.rs:121:9
105 LL | Ok(_) => println!("ok"),
106 | -----^^^^^^^^^^^^^^^^^^
108 | help: try merging the arm patterns: `Ok(_) | Ok(3)`
110 = help: or try changing either arm body
112 --> $DIR/match_same_arms2.rs:120:9
114 LL | Ok(3) => println!("ok"),
115 | ^^^^^^^^^^^^^^^^^^^^^^^
117 error: this match arm has an identical body to another arm
118 --> $DIR/match_same_arms2.rs:148:9
121 | ^ help: try merging the arm patterns: `1 | 0`
128 = help: or try changing either arm body
130 --> $DIR/match_same_arms2.rs:145:9
137 error: match expression looks like `matches!` macro
138 --> $DIR/match_same_arms2.rs:166:16
140 LL | let _ans = match x {
142 LL | | E::A => false,
143 LL | | E::B => false,
146 | |_____^ help: try this: `!matches!(x, E::A | E::B)`
148 = note: `-D clippy::match-like-matches-macro` implied by `-D warnings`
150 error: this match arm has an identical body to another arm
151 --> $DIR/match_same_arms2.rs:198:9
156 | help: try merging the arm patterns: `Foo::X(0) | Foo::Z(_)`
158 = help: or try changing either arm body
160 --> $DIR/match_same_arms2.rs:200:9
165 error: this match arm has an identical body to another arm
166 --> $DIR/match_same_arms2.rs:208:9
171 | help: try merging the arm patterns: `Foo::Z(_) | Foo::X(0)`
173 = help: or try changing either arm body
175 --> $DIR/match_same_arms2.rs:206:9
180 error: this match arm has an identical body to another arm
181 --> $DIR/match_same_arms2.rs:231:9
183 LL | Some(Bar { y: 0, x: 5, .. }) => 1,
184 | ----------------------------^^^^^
186 | help: try merging the arm patterns: `Some(Bar { y: 0, x: 5, .. }) | Some(Bar { x: 0, y: 5, .. })`
188 = help: or try changing either arm body
190 --> $DIR/match_same_arms2.rs:228:9
192 LL | Some(Bar { x: 0, y: 5, .. }) => 1,
193 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
195 error: aborting due to 12 previous errors