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