@@ -204,8 +204,17 @@ LL | | None | Some(_) => {},
204
204
LL | | }
205
205
| |_____^ help: try: `if let Some(A | B) = &Some(A) { println!() }`
206
206
207
+ error: you seem to be trying to use `match` for an equality check. Consider using `if`
208
+ --> tests/ui/single_match.rs:365:5
209
+ |
210
+ LL | / match &s[0..3] {
211
+ LL | | b"foo" => println!(),
212
+ LL | | _ => {},
213
+ LL | | }
214
+ | |_____^ help: try: `if &s[0..3] == b"foo" { println!() }`
215
+
207
216
error: this pattern is irrefutable, `match` is useless
208
- --> tests/ui/single_match.rs:371 :5
217
+ --> tests/ui/single_match.rs:378 :5
209
218
|
210
219
LL | / match DATA {
211
220
LL | | DATA => println!(),
@@ -214,7 +223,7 @@ LL | | }
214
223
| |_____^ help: try: `println!();`
215
224
216
225
error: this pattern is irrefutable, `match` is useless
217
- --> tests/ui/single_match.rs:376 :5
226
+ --> tests/ui/single_match.rs:383 :5
218
227
|
219
228
LL | / match CONST_I32 {
220
229
LL | | CONST_I32 => println!(),
@@ -223,7 +232,7 @@ LL | | }
223
232
| |_____^ help: try: `println!();`
224
233
225
234
error: this pattern is irrefutable, `match` is useless
226
- --> tests/ui/single_match.rs:382 :5
235
+ --> tests/ui/single_match.rs:389 :5
227
236
|
228
237
LL | / match i {
229
238
LL | | i => {
@@ -243,7 +252,7 @@ LL + }
243
252
|
244
253
245
254
error: this pattern is irrefutable, `match` is useless
246
- --> tests/ui/single_match.rs:390 :5
255
+ --> tests/ui/single_match.rs:397 :5
247
256
|
248
257
LL | / match i {
249
258
LL | | i => {},
@@ -252,7 +261,7 @@ LL | | }
252
261
| |_____^ help: `match` expression can be removed
253
262
254
263
error: this pattern is irrefutable, `match` is useless
255
- --> tests/ui/single_match.rs:395 :5
264
+ --> tests/ui/single_match.rs:402 :5
256
265
|
257
266
LL | / match i {
258
267
LL | | i => (),
@@ -261,13 +270,13 @@ LL | | }
261
270
| |_____^ help: `match` expression can be removed
262
271
263
272
error: this pattern is irrefutable, `match` is useless
264
- --> tests/ui/single_match.rs:400 :5
273
+ --> tests/ui/single_match.rs:407 :5
265
274
|
266
275
LL | / match CONST_I32 {
267
276
LL | | CONST_I32 => println!(),
268
277
LL | | _ => {},
269
278
LL | | }
270
279
| |_____^ help: try: `println!();`
271
280
272
- error: aborting due to 25 previous errors
281
+ error: aborting due to 26 previous errors
273
282
0 commit comments