11error: match expression looks like `matches!` macro
2- --> tests/ui/match_like_matches_macro.rs:13 :14
2+ --> tests/ui/match_like_matches_macro.rs:14 :14
33 |
44LL | let _y = match x {
55 | ______________^
@@ -20,7 +20,7 @@ LL + let _y = matches!(x, Some(0));
2020 |
2121
2222error: redundant pattern matching, consider using `is_some()`
23- --> tests/ui/match_like_matches_macro.rs:20 :14
23+ --> tests/ui/match_like_matches_macro.rs:21 :14
2424 |
2525LL | let _w = match x {
2626 | ______________^
@@ -33,7 +33,7 @@ LL | | };
3333 = help: to override `-D warnings` add `#[allow(clippy::redundant_pattern_matching)]`
3434
3535error: redundant pattern matching, consider using `is_none()`
36- --> tests/ui/match_like_matches_macro.rs:27 :14
36+ --> tests/ui/match_like_matches_macro.rs:28 :14
3737 |
3838LL | let _z = match x {
3939 | ______________^
@@ -43,7 +43,7 @@ LL | | };
4343 | |_____^ help: try: `x.is_none()`
4444
4545error: match expression looks like `matches!` macro
46- --> tests/ui/match_like_matches_macro.rs:34 :15
46+ --> tests/ui/match_like_matches_macro.rs:35 :15
4747 |
4848LL | let _zz = match x {
4949 | _______________^
@@ -62,7 +62,7 @@ LL + let _zz = !matches!(x, Some(r) if r == 0);
6262 |
6363
6464error: `if let .. else` expression looks like `matches!` macro
65- --> tests/ui/match_like_matches_macro.rs:41 :16
65+ --> tests/ui/match_like_matches_macro.rs:42 :16
6666 |
6767LL | let _zzz = if let Some(5) = x { true } else { false };
6868 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -74,7 +74,7 @@ LL + let _zzz = matches!(x, Some(5));
7474 |
7575
7676error: match expression looks like `matches!` macro
77- --> tests/ui/match_like_matches_macro.rs:66 :20
77+ --> tests/ui/match_like_matches_macro.rs:67 :20
7878 |
7979LL | let _ans = match x {
8080 | ____________________^
@@ -95,7 +95,7 @@ LL + let _ans = matches!(x, E::A(_) | E::B(_));
9595 |
9696
9797error: match expression looks like `matches!` macro
98- --> tests/ui/match_like_matches_macro.rs:77 :20
98+ --> tests/ui/match_like_matches_macro.rs:78 :20
9999 |
100100LL | let _ans = match x {
101101 | ____________________^
@@ -119,7 +119,7 @@ LL + let _ans = matches!(x, E::A(_) | E::B(_));
119119 |
120120
121121error: match expression looks like `matches!` macro
122- --> tests/ui/match_like_matches_macro.rs:88 :20
122+ --> tests/ui/match_like_matches_macro.rs:89 :20
123123 |
124124LL | let _ans = match x {
125125 | ____________________^
@@ -140,7 +140,7 @@ LL + let _ans = !matches!(x, E::B(_) | E::C);
140140 |
141141
142142error: match expression looks like `matches!` macro
143- --> tests/ui/match_like_matches_macro.rs:149 :18
143+ --> tests/ui/match_like_matches_macro.rs:150 :18
144144 |
145145LL | let _z = match &z {
146146 | __________________^
@@ -159,7 +159,7 @@ LL + let _z = matches!(z, Some(3));
159159 |
160160
161161error: match expression looks like `matches!` macro
162- --> tests/ui/match_like_matches_macro.rs:159 :18
162+ --> tests/ui/match_like_matches_macro.rs:160 :18
163163 |
164164LL | let _z = match &z {
165165 | __________________^
@@ -178,7 +178,7 @@ LL + let _z = matches!(&z, Some(3));
178178 |
179179
180180error: match expression looks like `matches!` macro
181- --> tests/ui/match_like_matches_macro.rs:177 :21
181+ --> tests/ui/match_like_matches_macro.rs:178 :21
182182 |
183183LL | let _ = match &z {
184184 | _____________________^
@@ -197,7 +197,7 @@ LL + let _ = matches!(&z, AnEnum::X);
197197 |
198198
199199error: match expression looks like `matches!` macro
200- --> tests/ui/match_like_matches_macro.rs:192 :20
200+ --> tests/ui/match_like_matches_macro.rs:193 :20
201201 |
202202LL | let _res = match &val {
203203 | ____________________^
@@ -216,7 +216,7 @@ LL + let _res = matches!(&val, &Some(ref _a));
216216 |
217217
218218error: match expression looks like `matches!` macro
219- --> tests/ui/match_like_matches_macro.rs:205 :20
219+ --> tests/ui/match_like_matches_macro.rs:206 :20
220220 |
221221LL | let _res = match &val {
222222 | ____________________^
@@ -235,7 +235,7 @@ LL + let _res = matches!(&val, &Some(ref _a));
235235 |
236236
237237error: match expression looks like `matches!` macro
238- --> tests/ui/match_like_matches_macro.rs:264 :14
238+ --> tests/ui/match_like_matches_macro.rs:265 :14
239239 |
240240LL | let _y = match Some(5) {
241241 | ______________^
@@ -254,7 +254,7 @@ LL + let _y = matches!(Some(5), Some(0));
254254 |
255255
256256error: match expression looks like `matches!` macro
257- --> tests/ui/match_like_matches_macro.rs:274 :13
257+ --> tests/ui/match_like_matches_macro.rs:275 :13
258258 |
259259LL | let _ = match opt {
260260 | _____________^
@@ -272,5 +272,35 @@ LL - };
272272LL + let _ = matches!(opt, Some(first) if (if let Some(second) = first { true } else { todo!() }));
273273 |
274274
275- error: aborting due to 15 previous errors
275+ error: match expression looks like `matches!` macro
276+ --> tests/ui/match_like_matches_macro.rs:296:5
277+ |
278+ LL | / match typeid!(T) {
279+ LL | | _ => true,
280+ LL | | _ => false,
281+ LL | | };
282+ | |_____^
283+ |
284+ help: use `matches!` directly
285+ |
286+ LL - match typeid!(T) {
287+ LL - _ => true,
288+ LL - _ => false,
289+ LL - };
290+ LL + matches!(typeid!(T), _);
291+ |
292+
293+ error: `if let .. else` expression looks like `matches!` macro
294+ --> tests/ui/match_like_matches_macro.rs:302:5
295+ |
296+ LL | if let _ = typeid!(U) { true } else { false }
297+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
298+ |
299+ help: use `matches!` directly
300+ |
301+ LL - if let _ = typeid!(U) { true } else { false }
302+ LL + matches!(typeid!(U), _)
303+ |
304+
305+ error: aborting due to 17 previous errors
276306
0 commit comments