From a245bfa61792cfa4c9cf29adae7dbe1b833f705c Mon Sep 17 00:00:00 2001 From: Zalathar Date: Fri, 2 Aug 2024 20:55:53 +1000 Subject: 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. --- compiler/rustc_pattern_analysis/src/lib.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'compiler/rustc_pattern_analysis/src/lib.rs') diff --git a/compiler/rustc_pattern_analysis/src/lib.rs b/compiler/rustc_pattern_analysis/src/lib.rs index a5c0b13c90b..4c8c865e721 100644 --- a/compiler/rustc_pattern_analysis/src/lib.rs +++ b/compiler/rustc_pattern_analysis/src/lib.rs @@ -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; -- cgit 1.4.1-3-g733a5