]> git.lizzy.rs Git - rust.git/blob - tests/ui/match_expr_like_matches_macro.stderr
Auto merge of #5980 - matsujika:create-dir, r=flip1995
[rust.git] / tests / ui / match_expr_like_matches_macro.stderr
1 error: match expression looks like `matches!` macro
2   --> $DIR/match_expr_like_matches_macro.rs:10:14
3    |
4 LL |       let _y = match x {
5    |  ______________^
6 LL | |         Some(0) => true,
7 LL | |         _ => false,
8 LL | |     };
9    | |_____^ help: try this: `matches!(x, Some(0))`
10    |
11    = note: `-D clippy::match-like-matches-macro` implied by `-D warnings`
12
13 error: match expression looks like `matches!` macro
14   --> $DIR/match_expr_like_matches_macro.rs:16:14
15    |
16 LL |       let _w = match x {
17    |  ______________^
18 LL | |         Some(_) => true,
19 LL | |         _ => false,
20 LL | |     };
21    | |_____^ help: try this: `matches!(x, Some(_))`
22
23 error: redundant pattern matching, consider using `is_none()`
24   --> $DIR/match_expr_like_matches_macro.rs:22:14
25    |
26 LL |       let _z = match x {
27    |  ______________^
28 LL | |         Some(_) => false,
29 LL | |         None => true,
30 LL | |     };
31    | |_____^ help: try this: `x.is_none()`
32    |
33    = note: `-D clippy::redundant-pattern-matching` implied by `-D warnings`
34
35 error: match expression looks like `matches!` macro
36   --> $DIR/match_expr_like_matches_macro.rs:28:15
37    |
38 LL |       let _zz = match x {
39    |  _______________^
40 LL | |         Some(r) if r == 0 => false,
41 LL | |         _ => true,
42 LL | |     };
43    | |_____^ help: try this: `!matches!(x, Some(r) if r == 0)`
44
45 error: if let .. else expression looks like `matches!` macro
46   --> $DIR/match_expr_like_matches_macro.rs:34:16
47    |
48 LL |     let _zzz = if let Some(5) = x { true } else { false };
49    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `matches!(x, Some(5))`
50
51 error: aborting due to 5 previous errors
52