]> git.lizzy.rs Git - rust.git/blob - tests/ui/single_match_else.stderr
removing unsafe from test fn's && renaming shrink to sugg_span
[rust.git] / tests / ui / single_match_else.stderr
1 error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
2   --> $DIR/single_match_else.rs:14:5
3    |
4 LL | /     match ExprNode::Butterflies {
5 LL | |         ExprNode::ExprAddrOf => Some(&NODE),
6 LL | |         _ => {
7 LL | |             let x = 5;
8 LL | |             None
9 LL | |         },
10 LL | |     }
11    | |_____^
12    |
13    = note: `-D clippy::single-match-else` implied by `-D warnings`
14 help: try this
15    |
16 LL ~     if let ExprNode::ExprAddrOf = ExprNode::Butterflies { Some(&NODE) } else {
17 LL +         let x = 5;
18 LL +         None
19 LL +     }
20    |
21
22 error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
23   --> $DIR/single_match_else.rs:70:5
24    |
25 LL | /     match Some(1) {
26 LL | |         Some(a) => println!("${:?}", a),
27 LL | |         None => {
28 LL | |             println!("else block");
29 LL | |             return
30 LL | |         },
31 LL | |     }
32    | |_____^
33    |
34 help: try this
35    |
36 LL ~     if let Some(a) = Some(1) { println!("${:?}", a) } else {
37 LL +         println!("else block");
38 LL +         return
39 LL +     }
40    |
41
42 error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
43   --> $DIR/single_match_else.rs:79:5
44    |
45 LL | /     match Some(1) {
46 LL | |         Some(a) => println!("${:?}", a),
47 LL | |         None => {
48 LL | |             println!("else block");
49 LL | |             return;
50 LL | |         },
51 LL | |     }
52    | |_____^
53    |
54 help: try this
55    |
56 LL ~     if let Some(a) = Some(1) { println!("${:?}", a) } else {
57 LL +         println!("else block");
58 LL +         return;
59 LL +     }
60    |
61
62 error: aborting due to 3 previous errors
63