1 error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
2 --> $DIR/matches.rs:26:5
4 26 | / match ExprNode::Butterflies {
5 27 | | ExprNode::ExprAddrOf => Some(&NODE),
6 28 | | _ => { let x = 5; None },
8 | |_____^ help: try this: `if let ExprNode::ExprAddrOf = ExprNode::Butterflies { Some(&NODE) } else { let x = 5; None }`
10 = note: `-D single-match-else` implied by `-D warnings`
12 error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
13 --> $DIR/matches.rs:35:5
16 36 | | Some(y) => { println!("{:?}", y); }
19 | |_____^ help: try this: `if let Some(y) = x { println!("{:?}", y); }`
21 = note: `-D single-match` implied by `-D warnings`
23 error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
24 --> $DIR/matches.rs:41:5
27 42 | | (2...3, 7...9) => dummy(),
30 | |_____^ help: try this: `if let (2...3, 7...9) = z { dummy() }`
32 error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
33 --> $DIR/matches.rs:63:5
36 64 | | Some(y) => dummy(),
39 | |_____^ help: try this: `if let Some(y) = x { dummy() }`
41 error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
42 --> $DIR/matches.rs:68:5
45 69 | | Ok(y) => dummy(),
48 | |_____^ help: try this: `if let Ok(y) = y { dummy() }`
50 error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
51 --> $DIR/matches.rs:75:5
54 76 | | Cow::Borrowed(..) => dummy(),
55 77 | | Cow::Owned(..) => (),
57 | |_____^ help: try this: `if let Cow::Borrowed(..) = c { dummy() }`
59 error: this boolean expression can be simplified
60 --> $DIR/matches.rs:117:11
62 117 | match test && test {
63 | ^^^^^^^^^^^^ help: try: `test`
65 = note: `-D nonminimal-bool` implied by `-D warnings`
67 error: you seem to be trying to match on a boolean expression
68 --> $DIR/matches.rs:96:5
74 | |_____^ help: consider using an if/else expression: `if test { 0 } else { 42 }`
76 = note: `-D match-bool` implied by `-D warnings`
78 error: you seem to be trying to match on a boolean expression
79 --> $DIR/matches.rs:102:5
81 102 | / match option == 1 {
85 | |_____^ help: consider using an if/else expression: `if option == 1 { 1 } else { 0 }`
87 error: you seem to be trying to match on a boolean expression
88 --> $DIR/matches.rs:107:5
92 109 | | false => { println!("Noooo!"); }
94 | |_____^ help: consider using an if/else expression: `if !test { println!("Noooo!"); }`
96 error: you seem to be trying to match on a boolean expression
97 --> $DIR/matches.rs:112:5
100 113 | | false => { println!("Noooo!"); }
103 | |_____^ help: consider using an if/else expression: `if !test { println!("Noooo!"); }`
105 error: you seem to be trying to match on a boolean expression
106 --> $DIR/matches.rs:117:5
108 117 | / match test && test {
109 118 | | false => { println!("Noooo!"); }
112 | |_____^ help: consider using an if/else expression: `if !(test && test) { println!("Noooo!"); }`
114 error: equal expressions as operands to `&&`
115 --> $DIR/matches.rs:117:11
117 117 | match test && test {
120 = note: `-D eq-op` implied by `-D warnings`
122 error: you seem to be trying to match on a boolean expression
123 --> $DIR/matches.rs:122:5
126 123 | | false => { println!("Noooo!"); }
127 124 | | true => { println!("Yes!"); }
129 | |_____^ help: consider using an if/else expression: `if test { println!("Yes!"); } else { println!("Noooo!"); }`
131 error: you don't need to add `&` to all patterns
132 --> $DIR/matches.rs:138:9
135 139 | | &Some(v) => println!("{:?}", v),
136 140 | | &None => println!("none"),
140 = note: `-D match-ref-pats` implied by `-D warnings`
141 help: instead of prefixing all patterns with `&`, you can dereference the expression
144 139 | Some(v) => println!("{:?}", v),
145 140 | None => println!("none"),
148 error: you don't need to add `&` to all patterns
149 --> $DIR/matches.rs:148:5
152 149 | | &(v, 1) => println!("{}", v),
153 150 | | _ => println!("none"),
156 help: instead of prefixing all patterns with `&`, you can dereference the expression
159 149 | (v, 1) => println!("{}", v),
162 error: you don't need to add `&` to both the expression and the patterns
163 --> $DIR/matches.rs:154:5
166 155 | | &Some(v) => println!("{:?}", v),
167 156 | | &None => println!("none"),
173 155 | Some(v) => println!("{:?}", v),
174 156 | None => println!("none"),
177 error: you don't need to add `&` to all patterns
178 --> $DIR/matches.rs:165:5
180 165 | / if let &None = a {
181 166 | | println!("none");
184 help: instead of prefixing all patterns with `&`, you can dereference the expression
186 165 | if let None = *a {
189 error: you don't need to add `&` to both the expression and the patterns
190 --> $DIR/matches.rs:170:5
192 170 | / if let &None = &b {
193 171 | | println!("none");
198 170 | if let None = b {
201 error: some ranges overlap
202 --> $DIR/matches.rs:179:9
204 179 | 0 ... 10 => println!("0 ... 10"),
207 = note: `-D match-overlapping-arm` implied by `-D warnings`
208 note: overlaps with this
209 --> $DIR/matches.rs:180:9
211 180 | 0 ... 11 => println!("0 ... 11"),
214 error: some ranges overlap
215 --> $DIR/matches.rs:185:9
217 185 | 0 ... 5 => println!("0 ... 5"),
220 note: overlaps with this
221 --> $DIR/matches.rs:187:9
223 187 | FOO ... 11 => println!("0 ... 11"),
226 error: some ranges overlap
227 --> $DIR/matches.rs:193:9
229 193 | 0 ... 5 => println!("0 ... 5"),
232 note: overlaps with this
233 --> $DIR/matches.rs:192:9
235 192 | 2 => println!("2"),
238 error: some ranges overlap
239 --> $DIR/matches.rs:199:9
241 199 | 0 ... 2 => println!("0 ... 2"),
244 note: overlaps with this
245 --> $DIR/matches.rs:198:9
247 198 | 2 => println!("2"),
250 error: some ranges overlap
251 --> $DIR/matches.rs:222:9
253 222 | 0 .. 11 => println!("0 .. 11"),
256 note: overlaps with this
257 --> $DIR/matches.rs:223:9
259 223 | 0 ... 11 => println!("0 ... 11"),
262 error: Err(_) will match all errors, maybe not a good idea
263 --> $DIR/matches.rs:240:9
265 240 | Err(_) => panic!("err")
268 = note: `-D match-wild-err-arm` implied by `-D warnings`
269 = note: to remove this warning, match each error seperately or use unreachable macro
271 error: this `match` has identical arm bodies
272 --> $DIR/matches.rs:239:18
274 239 | Ok(_) => println!("ok"),
277 = note: `-D match-same-arms` implied by `-D warnings`
279 --> $DIR/matches.rs:238:18
281 238 | Ok(3) => println!("ok"),
283 note: consider refactoring into `Ok(3) | Ok(_)`
284 --> $DIR/matches.rs:238:18
286 238 | Ok(3) => println!("ok"),
288 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
290 error: Err(_) will match all errors, maybe not a good idea
291 --> $DIR/matches.rs:246:9
293 246 | Err(_) => {panic!()}
296 = note: to remove this warning, match each error seperately or use unreachable macro
298 error: this `match` has identical arm bodies
299 --> $DIR/matches.rs:245:18
301 245 | Ok(_) => println!("ok"),
305 --> $DIR/matches.rs:244:18
307 244 | Ok(3) => println!("ok"),
309 note: consider refactoring into `Ok(3) | Ok(_)`
310 --> $DIR/matches.rs:244:18
312 244 | Ok(3) => println!("ok"),
314 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
316 error: Err(_) will match all errors, maybe not a good idea
317 --> $DIR/matches.rs:252:9
319 252 | Err(_) => {panic!();}
322 = note: to remove this warning, match each error seperately or use unreachable macro
324 error: this `match` has identical arm bodies
325 --> $DIR/matches.rs:251:18
327 251 | Ok(_) => println!("ok"),
331 --> $DIR/matches.rs:250:18
333 250 | Ok(3) => println!("ok"),
335 note: consider refactoring into `Ok(3) | Ok(_)`
336 --> $DIR/matches.rs:250:18
338 250 | Ok(3) => println!("ok"),
340 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
342 error: this `match` has identical arm bodies
343 --> $DIR/matches.rs:258:18
345 258 | Ok(_) => println!("ok"),
349 --> $DIR/matches.rs:257:18
351 257 | Ok(3) => println!("ok"),
353 note: consider refactoring into `Ok(3) | Ok(_)`
354 --> $DIR/matches.rs:257:18
356 257 | Ok(3) => println!("ok"),
358 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
360 error: this `match` has identical arm bodies
361 --> $DIR/matches.rs:265:18
363 265 | Ok(_) => println!("ok"),
367 --> $DIR/matches.rs:264:18
369 264 | Ok(3) => println!("ok"),
371 note: consider refactoring into `Ok(3) | Ok(_)`
372 --> $DIR/matches.rs:264:18
374 264 | Ok(3) => println!("ok"),
376 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
378 error: this `match` has identical arm bodies
379 --> $DIR/matches.rs:271:18
381 271 | Ok(_) => println!("ok"),
385 --> $DIR/matches.rs:270:18
387 270 | Ok(3) => println!("ok"),
389 note: consider refactoring into `Ok(3) | Ok(_)`
390 --> $DIR/matches.rs:270:18
392 270 | Ok(3) => println!("ok"),
394 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
396 error: this `match` has identical arm bodies
397 --> $DIR/matches.rs:277:18
399 277 | Ok(_) => println!("ok"),
403 --> $DIR/matches.rs:276:18
405 276 | Ok(3) => println!("ok"),
407 note: consider refactoring into `Ok(3) | Ok(_)`
408 --> $DIR/matches.rs:276:18
410 276 | Ok(3) => println!("ok"),
412 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
414 error: this `match` has identical arm bodies
415 --> $DIR/matches.rs:298:29
417 298 | (Ok(_), Some(x)) => println!("ok {}", x),
418 | ^^^^^^^^^^^^^^^^^^^^
421 --> $DIR/matches.rs:297:29
423 297 | (Ok(x), Some(_)) => println!("ok {}", x),
424 | ^^^^^^^^^^^^^^^^^^^^
425 note: consider refactoring into `(Ok(x), Some(_)) | (Ok(_), Some(x))`
426 --> $DIR/matches.rs:297:29
428 297 | (Ok(x), Some(_)) => println!("ok {}", x),
429 | ^^^^^^^^^^^^^^^^^^^^
430 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
432 error: this `match` has identical arm bodies
433 --> $DIR/matches.rs:313:18
435 313 | Ok(_) => println!("ok"),
439 --> $DIR/matches.rs:312:18
441 312 | Ok(3) => println!("ok"),
443 note: consider refactoring into `Ok(3) | Ok(_)`
444 --> $DIR/matches.rs:312:18
446 312 | Ok(3) => println!("ok"),
448 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
450 error: use as_ref() instead
451 --> $DIR/matches.rs:320:33
453 320 | let borrowed: Option<&()> = match owned {
454 | _________________________________^
455 321 | | None => None,
456 322 | | Some(ref v) => Some(v),
458 | |_____^ help: try this: `owned.as_ref()`
460 = note: `-D match-as-ref` implied by `-D warnings`
462 error: use as_mut() instead
463 --> $DIR/matches.rs:326:39
465 326 | let borrow_mut: Option<&mut ()> = match mut_owned {
466 | _______________________________________^
467 327 | | None => None,
468 328 | | Some(ref mut v) => Some(v),
470 | |_____^ help: try this: `mut_owned.as_mut()`
472 error: aborting due to 38 previous errors