1
1
error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
2
- --> tests/ui/single_match.rs:17 :5
2
+ --> tests/ui/single_match.rs:15 :5
3
3
|
4
4
LL | / match x {
5
5
LL | | Some(y) => {
@@ -19,7 +19,7 @@ LL ~ };
19
19
|
20
20
21
21
error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
22
- --> tests/ui/single_match.rs:25 :5
22
+ --> tests/ui/single_match.rs:23 :5
23
23
|
24
24
LL | / match x {
25
25
LL | | // Note the missing block braces.
@@ -31,7 +31,7 @@ LL | | }
31
31
| |_____^ help: try: `if let Some(y) = x { println!("{:?}", y) }`
32
32
33
33
error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
34
- --> tests/ui/single_match.rs:34 :5
34
+ --> tests/ui/single_match.rs:32 :5
35
35
|
36
36
LL | / match z {
37
37
LL | | (2..=3, 7..=9) => dummy(),
@@ -40,7 +40,7 @@ LL | | };
40
40
| |_____^ help: try: `if let (2..=3, 7..=9) = z { dummy() }`
41
41
42
42
error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
43
- --> tests/ui/single_match.rs:63 :5
43
+ --> tests/ui/single_match.rs:61 :5
44
44
|
45
45
LL | / match x {
46
46
LL | | Some(y) => dummy(),
@@ -49,7 +49,7 @@ LL | | };
49
49
| |_____^ help: try: `if let Some(y) = x { dummy() }`
50
50
51
51
error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
52
- --> tests/ui/single_match.rs:68 :5
52
+ --> tests/ui/single_match.rs:66 :5
53
53
|
54
54
LL | / match y {
55
55
LL | | Ok(y) => dummy(),
@@ -58,7 +58,7 @@ LL | | };
58
58
| |_____^ help: try: `if let Ok(y) = y { dummy() }`
59
59
60
60
error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
61
- --> tests/ui/single_match.rs:75 :5
61
+ --> tests/ui/single_match.rs:73 :5
62
62
|
63
63
LL | / match c {
64
64
LL | | Cow::Borrowed(..) => dummy(),
@@ -67,7 +67,7 @@ LL | | };
67
67
| |_____^ help: try: `if let Cow::Borrowed(..) = c { dummy() }`
68
68
69
69
error: you seem to be trying to use `match` for an equality check. Consider using `if`
70
- --> tests/ui/single_match.rs:96 :5
70
+ --> tests/ui/single_match.rs:94 :5
71
71
|
72
72
LL | / match x {
73
73
LL | | "test" => println!(),
@@ -76,7 +76,7 @@ LL | | }
76
76
| |_____^ help: try: `if x == "test" { println!() }`
77
77
78
78
error: you seem to be trying to use `match` for an equality check. Consider using `if`
79
- --> tests/ui/single_match.rs:109 :5
79
+ --> tests/ui/single_match.rs:107 :5
80
80
|
81
81
LL | / match x {
82
82
LL | | Foo::A => println!(),
@@ -85,7 +85,7 @@ LL | | }
85
85
| |_____^ help: try: `if x == Foo::A { println!() }`
86
86
87
87
error: you seem to be trying to use `match` for an equality check. Consider using `if`
88
- --> tests/ui/single_match.rs:115 :5
88
+ --> tests/ui/single_match.rs:113 :5
89
89
|
90
90
LL | / match x {
91
91
LL | | FOO_C => println!(),
@@ -94,7 +94,7 @@ LL | | }
94
94
| |_____^ help: try: `if x == FOO_C { println!() }`
95
95
96
96
error: you seem to be trying to use `match` for an equality check. Consider using `if`
97
- --> tests/ui/single_match.rs:120 :5
97
+ --> tests/ui/single_match.rs:118 :5
98
98
|
99
99
LL | / match &&x {
100
100
LL | | Foo::A => println!(),
@@ -103,7 +103,7 @@ LL | | }
103
103
| |_____^ help: try: `if x == Foo::A { println!() }`
104
104
105
105
error: you seem to be trying to use `match` for an equality check. Consider using `if`
106
- --> tests/ui/single_match.rs:126 :5
106
+ --> tests/ui/single_match.rs:124 :5
107
107
|
108
108
LL | / match &x {
109
109
LL | | Foo::A => println!(),
@@ -112,7 +112,7 @@ LL | | }
112
112
| |_____^ help: try: `if x == &Foo::A { println!() }`
113
113
114
114
error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
115
- --> tests/ui/single_match.rs:143 :5
115
+ --> tests/ui/single_match.rs:141 :5
116
116
|
117
117
LL | / match x {
118
118
LL | | Bar::A => println!(),
@@ -121,7 +121,7 @@ LL | | }
121
121
| |_____^ help: try: `if let Bar::A = x { println!() }`
122
122
123
123
error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
124
- --> tests/ui/single_match.rs:151 :5
124
+ --> tests/ui/single_match.rs:149 :5
125
125
|
126
126
LL | / match x {
127
127
LL | | None => println!(),
@@ -130,7 +130,7 @@ LL | | };
130
130
| |_____^ help: try: `if let None = x { println!() }`
131
131
132
132
error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
133
- --> tests/ui/single_match.rs:173 :5
133
+ --> tests/ui/single_match.rs:171 :5
134
134
|
135
135
LL | / match x {
136
136
LL | | (Some(_), _) => {},
@@ -139,7 +139,7 @@ LL | | }
139
139
| |_____^ help: try: `if let (Some(_), _) = x {}`
140
140
141
141
error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
142
- --> tests/ui/single_match.rs:179 :5
142
+ --> tests/ui/single_match.rs:177 :5
143
143
|
144
144
LL | / match x {
145
145
LL | | (Some(E::V), _) => todo!(),
@@ -148,7 +148,7 @@ LL | | }
148
148
| |_____^ help: try: `if let (Some(E::V), _) = x { todo!() }`
149
149
150
150
error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
151
- --> tests/ui/single_match.rs:185 :5
151
+ --> tests/ui/single_match.rs:183 :5
152
152
|
153
153
LL | / match (Some(42), Some(E::V), Some(42)) {
154
154
LL | | (.., Some(E::V), _) => {},
@@ -157,7 +157,7 @@ LL | | }
157
157
| |_____^ help: try: `if let (.., Some(E::V), _) = (Some(42), Some(E::V), Some(42)) {}`
158
158
159
159
error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
160
- --> tests/ui/single_match.rs:257 :5
160
+ --> tests/ui/single_match.rs:255 :5
161
161
|
162
162
LL | / match bar {
163
163
LL | | Some(v) => unsafe {
@@ -177,7 +177,7 @@ LL + } }
177
177
|
178
178
179
179
error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
180
- --> tests/ui/single_match.rs:265 :5
180
+ --> tests/ui/single_match.rs:263 :5
181
181
|
182
182
LL | / match bar {
183
183
LL | | #[rustfmt::skip]
0 commit comments