]> git.lizzy.rs Git - rust.git/blob - tests/ui/single_match_else.stderr
Merge branch 'master' into rustfmt_tests
[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:21:5
3    |
4 21 | /     match ExprNode::Butterflies {
5 22 | |         ExprNode::ExprAddrOf => Some(&NODE),
6 23 | |         _ => {
7 24 | |             let x = 5;
8 25 | |             None
9 26 | |         },
10 27 | |     }
11    | |_____^
12    |
13    = note: `-D clippy::single-match-else` implied by `-D warnings`
14 help: try this
15    |
16 21 |     if let ExprNode::ExprAddrOf = ExprNode::Butterflies { Some(&NODE) } else {
17 22 |     let x = 5;
18 23 |     None
19 24 | }
20    |
21
22 error: aborting due to previous error
23