diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-11-17 08:10:27 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-17 08:10:27 +0100 |
| commit | 488c2aac2979a6c99b0c8bb21073b1b72d5ef2a3 (patch) | |
| tree | 10314da7faae3cd0dda9ce32555d3c5b51c36717 /compiler/rustc_pattern_analysis/src | |
| parent | c188486267c492c1e71d5db26c2fe42376654ed1 (diff) | |
| parent | 5c3e01a340699069e1e8d9303fff0563fdbd09e2 (diff) | |
| download | rust-488c2aac2979a6c99b0c8bb21073b1b72d5ef2a3.tar.gz rust-488c2aac2979a6c99b0c8bb21073b1b72d5ef2a3.zip | |
Rollup merge of #117998 - estebank:issue-88404, r=TaKO8Ki
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.
Diffstat (limited to 'compiler/rustc_pattern_analysis/src')
0 files changed, 0 insertions, 0 deletions
