@@ -133,8 +133,90 @@ error: expected one of `:`, `;`, `=`, `@`, or `|`, found `.`
133
133
LL | { let x.-0; }
134
134
| ^ expected one of `:`, `;`, `=`, `@`, or `|`
135
135
136
+ error: expected one of `:`, `;`, `=`, `@`, or `|`, found `.`
137
+ --> $DIR/recover-pat-exprs.rs:16:12
138
+ |
139
+ LL | { let x.0u32; }
140
+ | ^ expected one of `:`, `;`, `=`, `@`, or `|`
141
+
142
+ error: expected one of `:`, `;`, `=`, `@`, or `|`, found `.`
143
+ --> $DIR/recover-pat-exprs.rs:17:12
144
+ |
145
+ LL | { let x.0.0_f64; }
146
+ | ^ expected one of `:`, `;`, `=`, `@`, or `|`
147
+
148
+ error: expected a pattern, found an expression
149
+ --> $DIR/recover-pat-exprs.rs:23:9
150
+ |
151
+ LL | x[0] => (),
152
+ | ^^^^ arbitrary expressions are not allowed in patterns
153
+ |
154
+ help: check the value in an arm guard
155
+ |
156
+ LL | val if val == x[0] => (),
157
+ | ~~~ ++++++++++++++
158
+ help: extract the expression into a `const` and refer to it
159
+ |
160
+ LL + const VAL: _ = x[0];
161
+ LL ~ match 0 {
162
+ LL ~ VAL => (),
163
+ |
164
+ help: wrap the expression in a inline const (requires `#![feature(inline_const_pat)]`)
165
+ |
166
+ LL | const { x[0] } => (),
167
+ | +++++++ +
168
+
136
169
error: expected a pattern, found an expression
137
- --> $DIR/recover-pat-exprs.rs:20:9
170
+ --> $DIR/recover-pat-exprs.rs:24:9
171
+ |
172
+ LL | x[..] => (),
173
+ | ^^^^^ arbitrary expressions are not allowed in patterns
174
+ |
175
+ help: check the value in an arm guard
176
+ |
177
+ LL | val if val == x[..] => (),
178
+ | ~~~ +++++++++++++++
179
+ help: extract the expression into a `const` and refer to it
180
+ |
181
+ LL + const VAL: _ = x[..];
182
+ LL ~ match 0 {
183
+ LL | x[0] => (),
184
+ LL ~ VAL => (),
185
+ |
186
+ help: wrap the expression in a inline const (requires `#![feature(inline_const_pat)]`)
187
+ |
188
+ LL | const { x[..] } => (),
189
+ | +++++++ +
190
+
191
+ error: expected one of `:`, `;`, `=`, `@`, or `|`, found `[`
192
+ --> $DIR/recover-pat-exprs.rs:27:12
193
+ |
194
+ LL | { let x[0, 1, 2]; }
195
+ | ^ expected one of `:`, `;`, `=`, `@`, or `|`
196
+
197
+ error: expected one of `:`, `;`, `=`, `@`, or `|`, found `[`
198
+ --> $DIR/recover-pat-exprs.rs:28:12
199
+ |
200
+ LL | { let x[0; 20]; }
201
+ | ^ expected one of `:`, `;`, `=`, `@`, or `|`
202
+
203
+ error: expected one of `:`, `;`, `=`, `@`, or `|`, found `[`
204
+ --> $DIR/recover-pat-exprs.rs:29:12
205
+ |
206
+ LL | { let x[]; }
207
+ | ^ expected one of `:`, `;`, `=`, `@`, or `|`
208
+
209
+ error: expected one of `)`, `,`, `@`, or `|`, found `[`
210
+ --> $DIR/recover-pat-exprs.rs:30:13
211
+ |
212
+ LL | { let (x[]); }
213
+ | ^
214
+ | |
215
+ | expected one of `)`, `,`, `@`, or `|`
216
+ | help: missing `,`
217
+
218
+ error: expected a pattern, found an expression
219
+ --> $DIR/recover-pat-exprs.rs:37:9
138
220
|
139
221
LL | x.f() => (),
140
222
| ^^^^^ arbitrary expressions are not allowed in patterns
@@ -155,7 +237,7 @@ LL | const { x.f() } => (),
155
237
| +++++++ +
156
238
157
239
error: expected a pattern, found an expression
158
- --> $DIR/recover-pat-exprs.rs:21 :9
240
+ --> $DIR/recover-pat-exprs.rs:38 :9
159
241
|
160
242
LL | x._f() => (),
161
243
| ^^^^^^ arbitrary expressions are not allowed in patterns
@@ -177,7 +259,7 @@ LL | const { x._f() } => (),
177
259
| +++++++ +
178
260
179
261
error: expected a pattern, found an expression
180
- --> $DIR/recover-pat-exprs.rs:22 :9
262
+ --> $DIR/recover-pat-exprs.rs:39 :9
181
263
|
182
264
LL | x? => (),
183
265
| ^^ arbitrary expressions are not allowed in patterns
@@ -200,7 +282,7 @@ LL | const { x? } => (),
200
282
| +++++++ +
201
283
202
284
error: expected a pattern, found an expression
203
- --> $DIR/recover-pat-exprs.rs:23 :9
285
+ --> $DIR/recover-pat-exprs.rs:40 :9
204
286
|
205
287
LL | ().f() => (),
206
288
| ^^^^^^ arbitrary expressions are not allowed in patterns
@@ -224,7 +306,7 @@ LL | const { ().f() } => (),
224
306
| +++++++ +
225
307
226
308
error: expected a pattern, found an expression
227
- --> $DIR/recover-pat-exprs.rs:24 :9
309
+ --> $DIR/recover-pat-exprs.rs:41 :9
228
310
|
229
311
LL | (0, x)?.f() => (),
230
312
| ^^^^^^^^^^^ arbitrary expressions are not allowed in patterns
@@ -248,7 +330,7 @@ LL | const { (0, x)?.f() } => (),
248
330
| +++++++ +
249
331
250
332
error: expected a pattern, found an expression
251
- --> $DIR/recover-pat-exprs.rs:25 :9
333
+ --> $DIR/recover-pat-exprs.rs:42 :9
252
334
|
253
335
LL | x.f().g() => (),
254
336
| ^^^^^^^^^ arbitrary expressions are not allowed in patterns
@@ -272,7 +354,7 @@ LL | const { x.f().g() } => (),
272
354
| +++++++ +
273
355
274
356
error: expected a pattern, found an expression
275
- --> $DIR/recover-pat-exprs.rs:26 :9
357
+ --> $DIR/recover-pat-exprs.rs:43 :9
276
358
|
277
359
LL | 0.f()?.g()?? => (),
278
360
| ^^^^^^^^^^^^ arbitrary expressions are not allowed in patterns
@@ -296,7 +378,7 @@ LL | const { 0.f()?.g()?? } => (),
296
378
| +++++++ +
297
379
298
380
error: expected a pattern, found an expression
299
- --> $DIR/recover-pat-exprs.rs:33 :9
381
+ --> $DIR/recover-pat-exprs.rs:50 :9
300
382
|
301
383
LL | x as usize => (),
302
384
| ^^^^^^^^^^ arbitrary expressions are not allowed in patterns
@@ -317,7 +399,7 @@ LL | const { x as usize } => (),
317
399
| +++++++ +
318
400
319
401
error: expected a pattern, found an expression
320
- --> $DIR/recover-pat-exprs.rs:34 :9
402
+ --> $DIR/recover-pat-exprs.rs:51 :9
321
403
|
322
404
LL | 0 as usize => (),
323
405
| ^^^^^^^^^^ arbitrary expressions are not allowed in patterns
@@ -339,7 +421,7 @@ LL | const { 0 as usize } => (),
339
421
| +++++++ +
340
422
341
423
error: expected a pattern, found an expression
342
- --> $DIR/recover-pat-exprs.rs:35 :9
424
+ --> $DIR/recover-pat-exprs.rs:52 :9
343
425
|
344
426
LL | x.f().0.4 as f32 => (),
345
427
| ^^^^^^^^^^^^^^^^ arbitrary expressions are not allowed in patterns
@@ -362,7 +444,7 @@ LL | const { x.f().0.4 as f32 } => (),
362
444
| +++++++ +
363
445
364
446
error: expected a pattern, found an expression
365
- --> $DIR/recover-pat-exprs.rs:42 :9
447
+ --> $DIR/recover-pat-exprs.rs:59 :9
366
448
|
367
449
LL | 1 + 1 => (),
368
450
| ^^^^^ arbitrary expressions are not allowed in patterns
@@ -383,7 +465,7 @@ LL | const { 1 + 1 } => (),
383
465
| +++++++ +
384
466
385
467
error: expected a pattern, found an expression
386
- --> $DIR/recover-pat-exprs.rs:43 :9
468
+ --> $DIR/recover-pat-exprs.rs:60 :9
387
469
|
388
470
LL | (1 + 2) * 3 => (),
389
471
| ^^^^^^^^^^^ arbitrary expressions are not allowed in patterns
@@ -405,7 +487,7 @@ LL | const { (1 + 2) * 3 } => (),
405
487
| +++++++ +
406
488
407
489
error: left-hand side of `@` must be a binding
408
- --> $DIR/recover-pat-exprs.rs:56 :9
490
+ --> $DIR/recover-pat-exprs.rs:73 :9
409
491
|
410
492
LL | x.sqrt() @ .. => (),
411
493
| --------^^^--
@@ -416,13 +498,13 @@ LL | x.sqrt() @ .. => (),
416
498
= note: bindings are `x`, `mut x`, `ref x`, and `ref mut x`
417
499
418
500
error: expected one of `)`, `,`, or `|`, found `+`
419
- --> $DIR/recover-pat-exprs.rs:70 :12
501
+ --> $DIR/recover-pat-exprs.rs:87 :12
420
502
|
421
503
LL | (_ + 1) => (),
422
504
| ^ expected one of `)`, `,`, or `|`
423
505
424
506
error: expected a pattern, found an expression
425
- --> $DIR/recover-pat-exprs.rs:54 :9
507
+ --> $DIR/recover-pat-exprs.rs:71 :9
426
508
|
427
509
LL | u8::MAX.abs() => (),
428
510
| ^^^^^^^^^^^^^ arbitrary expressions are not allowed in patterns
@@ -443,7 +525,7 @@ LL | const { u8::MAX.abs() } => (),
443
525
| +++++++ +
444
526
445
527
error: expected a pattern, found an expression
446
- --> $DIR/recover-pat-exprs.rs:59 :17
528
+ --> $DIR/recover-pat-exprs.rs:76 :17
447
529
|
448
530
LL | z @ w @ v.u() => (),
449
531
| ^^^^^ arbitrary expressions are not allowed in patterns
@@ -467,7 +549,7 @@ LL | z @ w @ const { v.u() } => (),
467
549
| +++++++ +
468
550
469
551
error: expected a pattern, found an expression
470
- --> $DIR/recover-pat-exprs.rs:61 :9
552
+ --> $DIR/recover-pat-exprs.rs:78 :9
471
553
|
472
554
LL | y.ilog(3) => (),
473
555
| ^^^^^^^^^ arbitrary expressions are not allowed in patterns
@@ -491,7 +573,7 @@ LL | const { y.ilog(3) } => (),
491
573
| +++++++ +
492
574
493
575
error: expected a pattern, found an expression
494
- --> $DIR/recover-pat-exprs.rs:63 :9
576
+ --> $DIR/recover-pat-exprs.rs:80 :9
495
577
|
496
578
LL | n + 1 => (),
497
579
| ^^^^^ arbitrary expressions are not allowed in patterns
@@ -515,7 +597,7 @@ LL | const { n + 1 } => (),
515
597
| +++++++ +
516
598
517
599
error: expected a pattern, found an expression
518
- --> $DIR/recover-pat-exprs.rs:65 :10
600
+ --> $DIR/recover-pat-exprs.rs:82 :10
519
601
|
520
602
LL | ("".f() + 14 * 8) => (),
521
603
| ^^^^^^^^^^^^^^^ arbitrary expressions are not allowed in patterns
@@ -539,7 +621,7 @@ LL | (const { "".f() + 14 * 8 }) => (),
539
621
| +++++++ +
540
622
541
623
error: expected a pattern, found an expression
542
- --> $DIR/recover-pat-exprs.rs:68 :9
624
+ --> $DIR/recover-pat-exprs.rs:85 :9
543
625
|
544
626
LL | f?() => (),
545
627
| ^^^^ arbitrary expressions are not allowed in patterns
@@ -563,7 +645,7 @@ LL | const { f?() } => (),
563
645
| +++++++ +
564
646
565
647
error: expected a pattern, found an expression
566
- --> $DIR/recover-pat-exprs.rs:74 :9
648
+ --> $DIR/recover-pat-exprs.rs:91 :9
567
649
|
568
650
LL | let 1 + 1 = 2;
569
651
| ^^^^^ arbitrary expressions are not allowed in patterns
@@ -575,7 +657,7 @@ LL + 1 + 1 = 2;
575
657
|
576
658
577
659
error: expected one of `)`, `,`, `@`, or `|`, found `*`
578
- --> $DIR/recover-pat-exprs.rs:77 :28
660
+ --> $DIR/recover-pat-exprs.rs:94 :28
579
661
|
580
662
LL | let b = matches!(x, (x * x | x.f()) | x[0]);
581
663
| ^ expected one of `)`, `,`, `@`, or `|`
@@ -584,16 +666,16 @@ LL | let b = matches!(x, (x * x | x.f()) | x[0]);
584
666
= note: while parsing argument for this `pat` macro fragment
585
667
586
668
error: expected a pattern, found an expression
587
- --> $DIR/recover-pat-exprs.rs:48 :5
669
+ --> $DIR/recover-pat-exprs.rs:65 :5
588
670
|
589
671
LL | 1 + 2 * PI.cos() => 2,
590
672
| ^^^^^^^^^^^^^^^^ arbitrary expressions are not allowed in patterns
591
673
592
674
error: expected a pattern, found an expression
593
- --> $DIR/recover-pat-exprs.rs:56 :9
675
+ --> $DIR/recover-pat-exprs.rs:73 :9
594
676
|
595
677
LL | x.sqrt() @ .. => (),
596
678
| ^^^^^^^^ arbitrary expressions are not allowed in patterns
597
679
598
- error: aborting due to 32 previous errors
680
+ error: aborting due to 40 previous errors
599
681
0 commit comments