]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/single_match.stderr
New upstream version 1.53.0+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / single_match.stderr
CommitLineData
f20569fa
XL
1error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
2 --> $DIR/single_match.rs:8:5
3 |
4LL | / match x {
5LL | | Some(y) => {
6LL | | println!("{:?}", y);
7LL | | },
8LL | | _ => (),
9LL | | };
10 | |_____^
11 |
12 = note: `-D clippy::single-match` implied by `-D warnings`
13help: try this
14 |
15LL | if let Some(y) = x {
16LL | println!("{:?}", y);
17LL | };
18 |
19
20error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
21 --> $DIR/single_match.rs:16:5
22 |
23LL | / match x {
24LL | | // Note the missing block braces.
25LL | | // We suggest `if let Some(y) = x { .. }` because the macro
26LL | | // is expanded before we can do anything.
27LL | | Some(y) => println!("{:?}", y),
28LL | | _ => (),
29LL | | }
30 | |_____^ help: try this: `if let Some(y) = x { println!("{:?}", y) }`
31
32error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
33 --> $DIR/single_match.rs:25:5
34 |
35LL | / match z {
36LL | | (2..=3, 7..=9) => dummy(),
37LL | | _ => {},
38LL | | };
39 | |_____^ help: try this: `if let (2..=3, 7..=9) = z { dummy() }`
40
41error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
42 --> $DIR/single_match.rs:54:5
43 |
44LL | / match x {
45LL | | Some(y) => dummy(),
46LL | | None => (),
47LL | | };
48 | |_____^ help: try this: `if let Some(y) = x { dummy() }`
49
50error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
51 --> $DIR/single_match.rs:59:5
52 |
53LL | / match y {
54LL | | Ok(y) => dummy(),
55LL | | Err(..) => (),
56LL | | };
57 | |_____^ help: try this: `if let Ok(y) = y { dummy() }`
58
59error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
60 --> $DIR/single_match.rs:66:5
61 |
62LL | / match c {
63LL | | Cow::Borrowed(..) => dummy(),
64LL | | Cow::Owned(..) => (),
65LL | | };
66 | |_____^ help: try this: `if let Cow::Borrowed(..) = c { dummy() }`
67
68error: you seem to be trying to use `match` for an equality check. Consider using `if`
69 --> $DIR/single_match.rs:87:5
70 |
71LL | / match x {
72LL | | "test" => println!(),
73LL | | _ => (),
74LL | | }
75 | |_____^ help: try this: `if x == "test" { println!() }`
76
77error: you seem to be trying to use `match` for an equality check. Consider using `if`
78 --> $DIR/single_match.rs:100:5
79 |
80LL | / match x {
81LL | | Foo::A => println!(),
82LL | | _ => (),
83LL | | }
84 | |_____^ help: try this: `if x == Foo::A { println!() }`
85
86error: you seem to be trying to use `match` for an equality check. Consider using `if`
87 --> $DIR/single_match.rs:106:5
88 |
89LL | / match x {
90LL | | FOO_C => println!(),
91LL | | _ => (),
92LL | | }
93 | |_____^ help: try this: `if x == FOO_C { println!() }`
94
95error: you seem to be trying to use `match` for an equality check. Consider using `if`
96 --> $DIR/single_match.rs:111:5
97 |
98LL | / match &&x {
99LL | | Foo::A => println!(),
100LL | | _ => (),
101LL | | }
102 | |_____^ help: try this: `if x == Foo::A { println!() }`
103
104error: you seem to be trying to use `match` for an equality check. Consider using `if`
105 --> $DIR/single_match.rs:117:5
106 |
107LL | / match &x {
108LL | | Foo::A => println!(),
109LL | | _ => (),
110LL | | }
111 | |_____^ help: try this: `if x == &Foo::A { println!() }`
112
113error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
114 --> $DIR/single_match.rs:134:5
115 |
116LL | / match x {
117LL | | Bar::A => println!(),
118LL | | _ => (),
119LL | | }
120 | |_____^ help: try this: `if let Bar::A = x { println!() }`
121
cdc7bbd5
XL
122error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
123 --> $DIR/single_match.rs:142:5
124 |
125LL | / match x {
126LL | | None => println!(),
127LL | | _ => (),
128LL | | };
129 | |_____^ help: try this: `if let None = x { println!() }`
130
131error: aborting due to 13 previous errors
f20569fa 132