about summary refs log tree commit diff
path: root/compiler/rustc_pattern_analysis/src/lib.rs
diff options
context:
space:
mode:
authorZalathar <Zalathar@users.noreply.github.com>2024-08-02 20:55:53 +1000
committerZalathar <Zalathar@users.noreply.github.com>2024-08-07 21:44:52 +1000
commita245bfa61792cfa4c9cf29adae7dbe1b833f705c (patch)
tree5eb8de228c5f89373c118c05aebf77dbb4ef95a7 /compiler/rustc_pattern_analysis/src/lib.rs
parentc764bea0c3d8ca9b9fc40b032376d5a1ea1e9096 (diff)
downloadrust-a245bfa61792cfa4c9cf29adae7dbe1b833f705c.tar.gz
rust-a245bfa61792cfa4c9cf29adae7dbe1b833f705c.zip
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.
Diffstat (limited to 'compiler/rustc_pattern_analysis/src/lib.rs')
-rw-r--r--compiler/rustc_pattern_analysis/src/lib.rs1
1 files changed, 1 insertions, 0 deletions
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;