<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/tests/ui/pattern/range-pattern-meant-to-be-slice-rest-pattern.rs, branch 1.77.2</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.77.2</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.77.2'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2023-11-17T00:55:55+00:00</updated>
<entry>
<title>On resolve error of `[rest..]`, suggest `[rest @ ..]`</title>
<updated>2023-11-17T00:55:55+00:00</updated>
<author>
<name>Esteban Küber</name>
<email>esteban@kuber.com.ar</email>
</author>
<published>2023-11-17T00:55:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5c3e01a340699069e1e8d9303fff0563fdbd09e2'/>
<id>urn:sha1:5c3e01a340699069e1e8d9303fff0563fdbd09e2</id>
<content type='text'>
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
  --&gt; $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:3:13
   |
LL |         [1, rest..] =&gt; 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 @ ..] =&gt; println!("{rest:?}"),
   |                  +
```

Fix #88404.
</content>
</entry>
</feed>
