]> git.lizzy.rs Git - rust.git/blob - tests/ui/single_match.stderr
Merge branch 'master' into rustfmt_tests
[rust.git] / tests / ui / single_match.stderr
1 error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
2   --> $DIR/single_match.rs:17:5
3    |
4 17 | /     match x {
5 18 | |         Some(y) => {
6 19 | |             println!("{:?}", y);
7 20 | |         },
8 21 | |         _ => (),
9 22 | |     };
10    | |_____^
11    |
12    = note: `-D clippy::single-match` implied by `-D warnings`
13 help: try this
14    |
15 17 |     if let Some(y) = x {
16 18 |     println!("{:?}", y);
17 19 | };
18    |
19
20 error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
21   --> $DIR/single_match.rs:25:5
22    |
23 25 | /     match x {
24 26 | |         // Note the missing block braces.
25 27 | |         // We suggest `if let Some(y) = x { .. }` because the macro
26 28 | |         // is expanded before we can do anything.
27 29 | |         Some(y) => println!("{:?}", y),
28 30 | |         _ => (),
29 31 | |     }
30    | |_____^ help: try this: `if let Some(y) = x { println!("{:?}", y) }`
31
32 error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
33   --> $DIR/single_match.rs:34:5
34    |
35 34 | /     match z {
36 35 | |         (2...3, 7...9) => dummy(),
37 36 | |         _ => {},
38 37 | |     };
39    | |_____^ help: try this: `if let (2...3, 7...9) = z { dummy() }`
40
41 error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
42   --> $DIR/single_match.rs:63:5
43    |
44 63 | /     match x {
45 64 | |         Some(y) => dummy(),
46 65 | |         None => (),
47 66 | |     };
48    | |_____^ help: try this: `if let Some(y) = x { dummy() }`
49
50 error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
51   --> $DIR/single_match.rs:68:5
52    |
53 68 | /     match y {
54 69 | |         Ok(y) => dummy(),
55 70 | |         Err(..) => (),
56 71 | |     };
57    | |_____^ help: try this: `if let Ok(y) = y { dummy() }`
58
59 error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
60   --> $DIR/single_match.rs:75:5
61    |
62 75 | /     match c {
63 76 | |         Cow::Borrowed(..) => dummy(),
64 77 | |         Cow::Owned(..) => (),
65 78 | |     };
66    | |_____^ help: try this: `if let Cow::Borrowed(..) = c { dummy() }`
67
68 error: aborting due to 6 previous errors
69