]> git.lizzy.rs Git - rust.git/blob - tests/ui/single_match.stderr
Merge pull request #2984 from flip1995/single_char_pattern
[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:9:5
3    |
4 9  | /     match x {
5 10 | |         Some(y) => { println!("{:?}", y); }
6 11 | |         _ => ()
7 12 | |     };
8    | |_____^ help: try this: `if let Some(y) = x { println!("{:?}", y); }`
9    |
10    = note: `-D 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:15:5
14    |
15 15 | /     match z {
16 16 | |         (2...3, 7...9) => dummy(),
17 17 | |         _ => {}
18 18 | |     };
19    | |_____^ help: try this: `if let (2...3, 7...9) = z { dummy() }`
20
21 error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
22   --> $DIR/single_match.rs:41:5
23    |
24 41 | /     match x {
25 42 | |         Some(y) => dummy(),
26 43 | |         None => ()
27 44 | |     };
28    | |_____^ help: try this: `if let Some(y) = x { dummy() }`
29
30 error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
31   --> $DIR/single_match.rs:46:5
32    |
33 46 | /     match y {
34 47 | |         Ok(y) => dummy(),
35 48 | |         Err(..) => ()
36 49 | |     };
37    | |_____^ help: try this: `if let Ok(y) = y { dummy() }`
38
39 error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
40   --> $DIR/single_match.rs:53:5
41    |
42 53 | /     match c {
43 54 | |         Cow::Borrowed(..) => dummy(),
44 55 | |         Cow::Owned(..) => (),
45 56 | |     };
46    | |_____^ help: try this: `if let Cow::Borrowed(..) = c { dummy() }`
47
48 error: aborting due to 5 previous errors
49