Implement RFC 2707 + Parser recovery for range patterns
Implement https://github.com/rust-lang/rfcs/pull/2707.
- Add a new basic syntactic pattern form `ast::PatKind::Rest` (parsed as `..` or `DOTDOT`) and simplify `ast::PatKind::{Slice, Tuple, TupleStruct}` as a result.
- Lower `ast::PatKind::Rest` in combination with the aforementioned `PatKind` variants as well as `PatKind::Ident`. The HIR remains unchanged for now (may be advisable to make slight adjustments later).
- Refactor `parser.rs` wrt. parsing sequences and lists of things in the process.
- Add parser recovery for range patterns of form `X..`, `X..=`, `X...`, `..Y`, `..=Y`, and `...Y`.
This should make it easy to actually support these patterns semantically later if we so desire.
cc https://github.com/rust-lang/rust/issues/62254
r? @petrochenkov
Rollup of 8 pull requests
Successful merges:
- #61207 (Allow lifetime elision in `Pin<&(mut) Self>`)
- #62074 (squash of all commits for nth_back on ChunksMut)
- #62771 (Break dependencies between `syntax_ext` and other crates)
- #62883 (Refactoring use common code between option, result and accum)
- #62949 (Re-enable assertions in PPC dist builder)
- #62996 (tidy: Add a check for inline unit tests)
- #63038 (Make more informative error on outer attribute after inner)
- #63050 (ci: download awscli from our mirror)
Failed merges:
r? @ghost
ci: download awscli from our mirror
This fixes multiple network issues we had when downloading awscli from PyPI on Azure Pipelines by vendoring awscli itself and its dependencies in our S3 bucket. Instructions on how to update the cache are present at the top of `src/ci/install-awscli.sh`.
r? @alexcrichton or @Mark-Simulacrum
fixes#62967
tidy: Add a check for inline unit tests
As described in https://github.com/rust-lang/rust/issues/61097.
There's a large whitelist right now, because in many crates the tests are not outlined yet.
~This PR only outlines tests in one crate (`rustc_lexer`) as an example.~
r? @Mark-Simulacrum
Refactoring use common code between option, result and accum
`Option` and `Result` have almost exactly the same code that in `accum.rs` that implement `Sum` and `Product`. This PR just move some code to use the same code for all of them. I believe is better to not implement this `Iterator` feature twice.
I'm not very familiar with pub visibility hope I didn't make then public. However, maybe these adapters could be useful and we could think to make then pub.
#59605#11084
r? @pnkfelix