]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/match_expr_like_matches_macro.stderr
Rollup merge of #100076 - tspiteri:const_slice_split_at, r=oli-obk
[rust.git] / src / tools / clippy / 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: match expression looks like `matches!` macro
52   --> $DIR/match_expr_like_matches_macro.rs:58:20
53    |
54 LL |           let _ans = match x {
55    |  ____________________^
56 LL | |             E::A(_) => true,
57 LL | |             E::B(_) => true,
58 LL | |             _ => false,
59 LL | |         };
60    | |_________^ help: try this: `matches!(x, E::A(_) | E::B(_))`
61
62 error: match expression looks like `matches!` macro
63   --> $DIR/match_expr_like_matches_macro.rs:68:20
64    |
65 LL |           let _ans = match x {
66    |  ____________________^
67 LL | |             E::A(_) => {
68 LL | |                 true
69 LL | |             }
70 LL | |             E::B(_) => true,
71 LL | |             _ => false,
72 LL | |         };
73    | |_________^ help: try this: `matches!(x, E::A(_) | E::B(_))`
74
75 error: match expression looks like `matches!` macro
76   --> $DIR/match_expr_like_matches_macro.rs:78:20
77    |
78 LL |           let _ans = match x {
79    |  ____________________^
80 LL | |             E::B(_) => false,
81 LL | |             E::C => false,
82 LL | |             _ => true,
83 LL | |         };
84    | |_________^ help: try this: `!matches!(x, E::B(_) | E::C)`
85
86 error: match expression looks like `matches!` macro
87   --> $DIR/match_expr_like_matches_macro.rs:138:18
88    |
89 LL |           let _z = match &z {
90    |  __________________^
91 LL | |             Some(3) => true,
92 LL | |             _ => false,
93 LL | |         };
94    | |_________^ help: try this: `matches!(z, Some(3))`
95
96 error: match expression looks like `matches!` macro
97   --> $DIR/match_expr_like_matches_macro.rs:147:18
98    |
99 LL |           let _z = match &z {
100    |  __________________^
101 LL | |             Some(3) => true,
102 LL | |             _ => false,
103 LL | |         };
104    | |_________^ help: try this: `matches!(&z, Some(3))`
105
106 error: match expression looks like `matches!` macro
107   --> $DIR/match_expr_like_matches_macro.rs:164:21
108    |
109 LL |               let _ = match &z {
110    |  _____________________^
111 LL | |                 AnEnum::X => true,
112 LL | |                 _ => false,
113 LL | |             };
114    | |_____________^ help: try this: `matches!(&z, AnEnum::X)`
115
116 error: match expression looks like `matches!` macro
117   --> $DIR/match_expr_like_matches_macro.rs:178:20
118    |
119 LL |           let _res = match &val {
120    |  ____________________^
121 LL | |             &Some(ref _a) => true,
122 LL | |             _ => false,
123 LL | |         };
124    | |_________^ help: try this: `matches!(&val, &Some(ref _a))`
125
126 error: match expression looks like `matches!` macro
127   --> $DIR/match_expr_like_matches_macro.rs:190:20
128    |
129 LL |           let _res = match &val {
130    |  ____________________^
131 LL | |             &Some(ref _a) => true,
132 LL | |             _ => false,
133 LL | |         };
134    | |_________^ help: try this: `matches!(&val, &Some(ref _a))`
135
136 error: aborting due to 13 previous errors
137