Simplify hoisting of array/slice patterns

We can replace some tricky iterator-mutation code with a much simpler version
that uses `while let` to shrink a slice.

We also check whether a subpattern would be a wildcard _before_ hoisting it,
which will be very useful when trying to get rid of `print::PatKind` later.
This commit is contained in:
Zalathar 2024-08-02 20:55:53 +10:00
parent c764bea0c3
commit a245bfa617
2 changed files with 44 additions and 30 deletions

View file

@ -5,6 +5,7 @@
// tidy-alphabetical-start
#![allow(rustc::diagnostic_outside_of_impl)]
#![allow(rustc::untranslatable_diagnostic)]
#![cfg_attr(feature = "rustc", feature(let_chains))]
// tidy-alphabetical-end
pub mod constructor;