]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/redundant_pattern_matching.stderr
Rollup merge of #76981 - pickfire:patch-5, r=Mark-Simulacrum
[rust.git] / src / tools / clippy / tests / ui / redundant_pattern_matching.stderr
1 error: redundant pattern matching, consider using `is_ok()`
2   --> $DIR/redundant_pattern_matching.rs:15:12
3    |
4 LL |     if let Ok(_) = &result {}
5    |     -------^^^^^---------- help: try this: `if result.is_ok()`
6    |
7    = note: `-D clippy::redundant-pattern-matching` implied by `-D warnings`
8
9 error: redundant pattern matching, consider using `is_ok()`
10   --> $DIR/redundant_pattern_matching.rs:17:12
11    |
12 LL |     if let Ok(_) = Ok::<i32, i32>(42) {}
13    |     -------^^^^^--------------------- help: try this: `if Ok::<i32, i32>(42).is_ok()`
14
15 error: redundant pattern matching, consider using `is_err()`
16   --> $DIR/redundant_pattern_matching.rs:19:12
17    |
18 LL |     if let Err(_) = Err::<i32, i32>(42) {}
19    |     -------^^^^^^---------------------- help: try this: `if Err::<i32, i32>(42).is_err()`
20
21 error: redundant pattern matching, consider using `is_none()`
22   --> $DIR/redundant_pattern_matching.rs:21:12
23    |
24 LL |     if let None = None::<()> {}
25    |     -------^^^^------------- help: try this: `if None::<()>.is_none()`
26
27 error: redundant pattern matching, consider using `is_some()`
28   --> $DIR/redundant_pattern_matching.rs:23:12
29    |
30 LL |     if let Some(_) = Some(42) {}
31    |     -------^^^^^^^----------- help: try this: `if Some(42).is_some()`
32
33 error: redundant pattern matching, consider using `is_some()`
34   --> $DIR/redundant_pattern_matching.rs:25:12
35    |
36 LL |     if let Some(_) = Some(42) {
37    |     -------^^^^^^^----------- help: try this: `if Some(42).is_some()`
38
39 error: redundant pattern matching, consider using `is_some()`
40   --> $DIR/redundant_pattern_matching.rs:31:15
41    |
42 LL |     while let Some(_) = Some(42) {}
43    |     ----------^^^^^^^----------- help: try this: `while Some(42).is_some()`
44
45 error: redundant pattern matching, consider using `is_none()`
46   --> $DIR/redundant_pattern_matching.rs:33:15
47    |
48 LL |     while let None = Some(42) {}
49    |     ----------^^^^----------- help: try this: `while Some(42).is_none()`
50
51 error: redundant pattern matching, consider using `is_none()`
52   --> $DIR/redundant_pattern_matching.rs:35:15
53    |
54 LL |     while let None = None::<()> {}
55    |     ----------^^^^------------- help: try this: `while None::<()>.is_none()`
56
57 error: redundant pattern matching, consider using `is_ok()`
58   --> $DIR/redundant_pattern_matching.rs:37:15
59    |
60 LL |     while let Ok(_) = Ok::<i32, i32>(10) {}
61    |     ----------^^^^^--------------------- help: try this: `while Ok::<i32, i32>(10).is_ok()`
62
63 error: redundant pattern matching, consider using `is_err()`
64   --> $DIR/redundant_pattern_matching.rs:39:15
65    |
66 LL |     while let Err(_) = Ok::<i32, i32>(10) {}
67    |     ----------^^^^^^--------------------- help: try this: `while Ok::<i32, i32>(10).is_err()`
68
69 error: redundant pattern matching, consider using `is_some()`
70   --> $DIR/redundant_pattern_matching.rs:42:15
71    |
72 LL |     while let Some(_) = v.pop() {
73    |     ----------^^^^^^^---------- help: try this: `while v.pop().is_some()`
74
75 error: redundant pattern matching, consider using `is_ok()`
76   --> $DIR/redundant_pattern_matching.rs:58:5
77    |
78 LL | /     match Ok::<i32, i32>(42) {
79 LL | |         Ok(_) => true,
80 LL | |         Err(_) => false,
81 LL | |     };
82    | |_____^ help: try this: `Ok::<i32, i32>(42).is_ok()`
83
84 error: redundant pattern matching, consider using `is_err()`
85   --> $DIR/redundant_pattern_matching.rs:63:5
86    |
87 LL | /     match Ok::<i32, i32>(42) {
88 LL | |         Ok(_) => false,
89 LL | |         Err(_) => true,
90 LL | |     };
91    | |_____^ help: try this: `Ok::<i32, i32>(42).is_err()`
92
93 error: redundant pattern matching, consider using `is_err()`
94   --> $DIR/redundant_pattern_matching.rs:68:5
95    |
96 LL | /     match Err::<i32, i32>(42) {
97 LL | |         Ok(_) => false,
98 LL | |         Err(_) => true,
99 LL | |     };
100    | |_____^ help: try this: `Err::<i32, i32>(42).is_err()`
101
102 error: redundant pattern matching, consider using `is_ok()`
103   --> $DIR/redundant_pattern_matching.rs:73:5
104    |
105 LL | /     match Err::<i32, i32>(42) {
106 LL | |         Ok(_) => true,
107 LL | |         Err(_) => false,
108 LL | |     };
109    | |_____^ help: try this: `Err::<i32, i32>(42).is_ok()`
110
111 error: redundant pattern matching, consider using `is_some()`
112   --> $DIR/redundant_pattern_matching.rs:78:5
113    |
114 LL | /     match Some(42) {
115 LL | |         Some(_) => true,
116 LL | |         None => false,
117 LL | |     };
118    | |_____^ help: try this: `Some(42).is_some()`
119
120 error: redundant pattern matching, consider using `is_none()`
121   --> $DIR/redundant_pattern_matching.rs:83:5
122    |
123 LL | /     match None::<()> {
124 LL | |         Some(_) => false,
125 LL | |         None => true,
126 LL | |     };
127    | |_____^ help: try this: `None::<()>.is_none()`
128
129 error: redundant pattern matching, consider using `is_none()`
130   --> $DIR/redundant_pattern_matching.rs:88:13
131    |
132 LL |       let _ = match None::<()> {
133    |  _____________^
134 LL | |         Some(_) => false,
135 LL | |         None => true,
136 LL | |     };
137    | |_____^ help: try this: `None::<()>.is_none()`
138
139 error: redundant pattern matching, consider using `is_ok()`
140   --> $DIR/redundant_pattern_matching.rs:93:20
141    |
142 LL |     let _ = if let Ok(_) = Ok::<usize, ()>(4) { true } else { false };
143    |             -------^^^^^--------------------- help: try this: `if Ok::<usize, ()>(4).is_ok()`
144
145 error: redundant pattern matching, consider using `is_some()`
146   --> $DIR/redundant_pattern_matching.rs:96:20
147    |
148 LL |     let x = if let Some(_) = opt { true } else { false };
149    |             -------^^^^^^^------ help: try this: `if opt.is_some()`
150
151 error: redundant pattern matching, consider using `is_some()`
152   --> $DIR/redundant_pattern_matching.rs:102:20
153    |
154 LL |     let _ = if let Some(_) = gen_opt() {
155    |             -------^^^^^^^------------ help: try this: `if gen_opt().is_some()`
156
157 error: redundant pattern matching, consider using `is_none()`
158   --> $DIR/redundant_pattern_matching.rs:104:19
159    |
160 LL |     } else if let None = gen_opt() {
161    |            -------^^^^------------ help: try this: `if gen_opt().is_none()`
162
163 error: redundant pattern matching, consider using `is_ok()`
164   --> $DIR/redundant_pattern_matching.rs:106:19
165    |
166 LL |     } else if let Ok(_) = gen_res() {
167    |            -------^^^^^------------ help: try this: `if gen_res().is_ok()`
168
169 error: redundant pattern matching, consider using `is_err()`
170   --> $DIR/redundant_pattern_matching.rs:108:19
171    |
172 LL |     } else if let Err(_) = gen_res() {
173    |            -------^^^^^^------------ help: try this: `if gen_res().is_err()`
174
175 error: redundant pattern matching, consider using `is_some()`
176   --> $DIR/redundant_pattern_matching.rs:141:19
177    |
178 LL |         while let Some(_) = r#try!(result_opt()) {}
179    |         ----------^^^^^^^----------------------- help: try this: `while r#try!(result_opt()).is_some()`
180
181 error: redundant pattern matching, consider using `is_some()`
182   --> $DIR/redundant_pattern_matching.rs:142:16
183    |
184 LL |         if let Some(_) = r#try!(result_opt()) {}
185    |         -------^^^^^^^----------------------- help: try this: `if r#try!(result_opt()).is_some()`
186
187 error: redundant pattern matching, consider using `is_some()`
188   --> $DIR/redundant_pattern_matching.rs:148:12
189    |
190 LL |     if let Some(_) = m!() {}
191    |     -------^^^^^^^------- help: try this: `if m!().is_some()`
192
193 error: redundant pattern matching, consider using `is_some()`
194   --> $DIR/redundant_pattern_matching.rs:149:15
195    |
196 LL |     while let Some(_) = m!() {}
197    |     ----------^^^^^^^------- help: try this: `while m!().is_some()`
198
199 error: redundant pattern matching, consider using `is_ok()`
200   --> $DIR/redundant_pattern_matching.rs:156:12
201    |
202 LL |     if let Ok(_) = Ok::<i32, i32>(42) {}
203    |     -------^^^^^--------------------- help: try this: `if Ok::<i32, i32>(42).is_ok()`
204
205 error: redundant pattern matching, consider using `is_err()`
206   --> $DIR/redundant_pattern_matching.rs:158:12
207    |
208 LL |     if let Err(_) = Err::<i32, i32>(42) {}
209    |     -------^^^^^^---------------------- help: try this: `if Err::<i32, i32>(42).is_err()`
210
211 error: redundant pattern matching, consider using `is_some()`
212   --> $DIR/redundant_pattern_matching.rs:160:12
213    |
214 LL |     if let Some(_) = Some(42) {}
215    |     -------^^^^^^^----------- help: try this: `if Some(42).is_some()`
216
217 error: redundant pattern matching, consider using `is_none()`
218   --> $DIR/redundant_pattern_matching.rs:162:12
219    |
220 LL |     if let None = None::<()> {}
221    |     -------^^^^------------- help: try this: `if None::<()>.is_none()`
222
223 error: redundant pattern matching, consider using `is_ok()`
224   --> $DIR/redundant_pattern_matching.rs:164:15
225    |
226 LL |     while let Ok(_) = Ok::<i32, i32>(10) {}
227    |     ----------^^^^^--------------------- help: try this: `while Ok::<i32, i32>(10).is_ok()`
228
229 error: redundant pattern matching, consider using `is_err()`
230   --> $DIR/redundant_pattern_matching.rs:166:15
231    |
232 LL |     while let Err(_) = Ok::<i32, i32>(10) {}
233    |     ----------^^^^^^--------------------- help: try this: `while Ok::<i32, i32>(10).is_err()`
234
235 error: redundant pattern matching, consider using `is_some()`
236   --> $DIR/redundant_pattern_matching.rs:168:15
237    |
238 LL |     while let Some(_) = Some(42) {}
239    |     ----------^^^^^^^----------- help: try this: `while Some(42).is_some()`
240
241 error: redundant pattern matching, consider using `is_none()`
242   --> $DIR/redundant_pattern_matching.rs:170:15
243    |
244 LL |     while let None = None::<()> {}
245    |     ----------^^^^------------- help: try this: `while None::<()>.is_none()`
246
247 error: redundant pattern matching, consider using `is_ok()`
248   --> $DIR/redundant_pattern_matching.rs:172:5
249    |
250 LL | /     match Ok::<i32, i32>(42) {
251 LL | |         Ok(_) => true,
252 LL | |         Err(_) => false,
253 LL | |     };
254    | |_____^ help: try this: `Ok::<i32, i32>(42).is_ok()`
255
256 error: redundant pattern matching, consider using `is_err()`
257   --> $DIR/redundant_pattern_matching.rs:177:5
258    |
259 LL | /     match Err::<i32, i32>(42) {
260 LL | |         Ok(_) => false,
261 LL | |         Err(_) => true,
262 LL | |     };
263    | |_____^ help: try this: `Err::<i32, i32>(42).is_err()`
264
265 error: redundant pattern matching, consider using `is_some()`
266   --> $DIR/redundant_pattern_matching.rs:182:5
267    |
268 LL | /     match Some(42) {
269 LL | |         Some(_) => true,
270 LL | |         None => false,
271 LL | |     };
272    | |_____^ help: try this: `Some(42).is_some()`
273
274 error: redundant pattern matching, consider using `is_none()`
275   --> $DIR/redundant_pattern_matching.rs:187:5
276    |
277 LL | /     match None::<()> {
278 LL | |         Some(_) => false,
279 LL | |         None => true,
280 LL | |     };
281    | |_____^ help: try this: `None::<()>.is_none()`
282
283 error: aborting due to 41 previous errors
284