os-rust/compiler/rustc_resolve/src
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
..
diagnostics Implement the unused_macro_rules lint 2022-05-05 19:13:00 +02:00
late On resolve error of [rest..], suggest [rest @ ..] 2023-11-17 00:55:55 +00:00
build_reduced_graph.rs s/Generator/Coroutine/ 2023-10-20 21:10:38 +00:00
check_unused.rs Rollup merge of #116905 - Fenex:refactor/compiler/resolve, r=petrochenkov 2023-10-26 17:45:43 +02:00
def_collector.rs Add gen blocks to ast and do some broken ast lowering 2023-10-27 13:05:48 +00:00
diagnostics.rs rustc: minor changes suggested by clippy perf lints. 2023-11-08 08:57:57 +11:00
effective_visibilities.rs Format all the let chains in compiler 2023-10-13 08:59:36 +00:00
errors.rs Rollup merge of #115744 - fmease:fix-e0401, r=compiler-errors 2023-09-11 17:03:32 +02:00
ident.rs Rename RibKind::ClosureOrAsync to reflect how it is actually used 2023-10-27 13:05:49 +00:00
imports.rs Format all the let chains in compiler 2023-10-13 08:59:36 +00:00
late.rs On resolve error of [rest..], suggest [rest @ ..] 2023-11-17 00:55:55 +00:00
lib.rs Bump cfg(bootstrap)s 2023-11-15 19:41:28 -05:00
macros.rs Format all the let chains in compiler 2023-10-13 08:59:36 +00:00
rustdoc.rs Format all the let chains in compiler 2023-10-13 08:59:36 +00:00