about summary refs log tree commit diff
path: root/tests/ui/pattern/range-pattern-meant-to-be-slice-rest-pattern.rs
AgeCommit message (Collapse)AuthorLines
2024-05-02Stabilize exclusive_rangeRoss Smyth-1/+0
2024-02-04Suggest `[tail @ ..]` on `[..tail]` and `[...tail]` where `tail` is unresolvedLeón Orell Valerian Liehr-1/+15
2023-11-17On resolve error of `[rest..]`, suggest `[rest @ ..]`Esteban Küber-0/+9
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.