rust/tests/ui/match
Esteban Küber 5c3e01a340 On resolve error of `[rest..]`, suggest `[rest @ ..]`
When writing a pattern to collect multiple entries of a slice in a
single binding, it is easy to misremember or typo the appropriate syntax
to do so, instead writing the experimental `X..` pattern syntax. When we
encounter a resolve error because `X` isn't available, we suggest
`X @ ..` as an alternative.

```
error[E0425]: cannot find value `rest` in this scope
  --> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:3:13
   |
LL |         [1, rest..] => println!("{rest:?}"),
   |             ^^^^ not found in this scope
   |
help: if you meant to collect the rest of the slice in `rest`, use the at operator
   |
LL |         [1, rest @ ..] => println!("{rest:?}"),
   |                  +
```

Fix #88404.
2023-11-17 00:55:55 +00:00
..
auxiliary Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const_non_normal_zst_ref_pattern.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr-match-panic-fn.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr-match-panic.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_before_ident_pat.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_before_ident_pat.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
guards-parenthesized-and.rs Remove wrong assertion. 2023-04-30 14:08:26 +00:00
guards.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-5530.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-11319.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-11319.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-11940.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-12552.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-12552.stderr Modify primary span label for E0308 2023-01-30 20:12:19 +00:00
issue-18060.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-26251.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-26996.rs Add some reasons why tests are ignored. 2023-04-15 16:11:42 -07:00
issue-27021.rs Add some reasons why tests are ignored. 2023-04-15 16:11:42 -07:00
issue-33498.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-41255.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-41255.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-42679.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-46920-byte-array-patterns.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-56685.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-56685.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-70972-dyn-trait.rs Only rewrite valtree-constants to patterns and keep other constants opaque 2023-05-31 14:02:57 +00:00
issue-70972-dyn-trait.stderr Only rewrite valtree-constants to patterns and keep other constants opaque 2023-05-31 14:02:57 +00:00
issue-72680.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-72896-non-partial-eq-const.rs work towards rejecting consts in patterns that do not implement PartialEq 2023-09-24 16:36:26 +02:00
issue-72896-non-partial-eq-const.stderr rename lint; add tracking issue 2023-09-25 19:05:10 +02:00
issue-74050-end-span.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-74050-end-span.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
issue-82392.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-82392.stdout Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-82866.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-82866.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-84434.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-91058.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-91058.stderr Modify primary span label for E0308 2023-01-30 20:12:19 +00:00
issue-92100.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-92100.stderr On resolve error of `[rest..]`, suggest `[rest @ ..]` 2023-11-17 00:55:55 +00:00
issue-112438.rs add test 2023-06-15 06:50:56 -04:00
issue-113012.rs remove FIXME and add test 2023-06-28 07:59:36 -04:00
issue-114691.rs Add test for #114691 2023-08-15 11:33:45 +02:00
issue-115681.rs Update to LLVM 17.0.0 2023-09-19 11:14:35 +02:00
match-arm-resolving-to-never.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-arm-resolving-to-never.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-bot-panic.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-disc-bot.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-fn-call.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-fn-call.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-ill-type2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-ill-type2.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-incompat-type-semi.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-incompat-type-semi.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-join.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-join.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-no-arms-unreachable-after.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-no-arms-unreachable-after.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-on-negative-integer-ranges.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-pattern-field-mismatch-2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-pattern-field-mismatch-2.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-pattern-field-mismatch.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-pattern-field-mismatch.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-range-fail-2.rs Perform match checking on THIR. 2023-04-03 15:59:21 +00:00
match-range-fail-2.stderr Fix range overflow checking 2023-10-11 04:55:55 +02:00
match-range-fail.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-range-fail.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-ref-mut-invariance.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-ref-mut-invariance.stderr diagnostics: update test cases to refer to assoc fn with `self` as method 2023-02-22 08:40:47 -07:00
match-ref-mut-let-invariance.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-ref-mut-let-invariance.stderr diagnostics: update test cases to refer to assoc fn with `self` as method 2023-02-22 08:40:47 -07:00
match-ref-mut-stability.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-struct.rs Modify primary span label for E0308 2023-01-30 20:12:19 +00:00
match-struct.stderr Modify primary span label for E0308 2023-01-30 20:12:19 +00:00
match-tag-nullary.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-tag-nullary.stderr Modify primary span label for E0308 2023-01-30 20:12:19 +00:00
match-tag-unary.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-tag-unary.stderr Modify primary span label for E0308 2023-01-30 20:12:19 +00:00
match-type-err-first-arm.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-type-err-first-arm.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-unresolved-one-arm.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-unresolved-one-arm.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-vec-mismatch-2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-vec-mismatch-2.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match-wildcards.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match_non_exhaustive.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
match_non_exhaustive.stderr Tweak spans for "adt defined here" note 2023-11-03 18:26:16 +01:00
non-first-arm-doesnt-match-expected-return-type.rs Point at return type when it influences non-first `match` arm 2023-08-14 21:43:56 +00:00
non-first-arm-doesnt-match-expected-return-type.stderr Point at return type when it influences non-first `match` arm 2023-08-14 21:43:56 +00:00
pattern-deref-miscompile.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
single-line.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
single-line.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
validate-range-endpoints.rs Fix range overflow checking 2023-10-11 04:55:55 +02:00
validate-range-endpoints.stderr Fix range overflow checking 2023-10-11 04:55:55 +02:00