From e98e19e49108b6e49e452c3bd22c1aeccd43e507 Mon Sep 17 00:00:00 2001 From: Zalathar Date: Fri, 2 Aug 2024 20:09:12 +1000 Subject: Replace an unnecessary slice pattern with `has_dot_dot: bool` --- compiler/rustc_pattern_analysis/src/rustc.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'compiler/rustc_pattern_analysis/src/rustc.rs') diff --git a/compiler/rustc_pattern_analysis/src/rustc.rs b/compiler/rustc_pattern_analysis/src/rustc.rs index 7fe2c14a745..f27c279912f 100644 --- a/compiler/rustc_pattern_analysis/src/rustc.rs +++ b/compiler/rustc_pattern_analysis/src/rustc.rs @@ -872,7 +872,7 @@ impl<'p, 'tcx: 'p> RustcPatCtxt<'p, 'tcx> { match slice.kind { SliceKind::FixedLen(_) => PatKind::Slice { prefix: subpatterns.collect(), - slice: None, + has_dot_dot: false, suffix: Box::new([]), }, SliceKind::VarLen(prefix, _) => { @@ -893,10 +893,9 @@ impl<'p, 'tcx: 'p> RustcPatCtxt<'p, 'tcx> { } } let suffix: Box<[_]> = subpatterns.collect(); - let wild = Pat { ty: pat.ty().inner(), kind: PatKind::Wild }; PatKind::Slice { prefix: prefix.into_boxed_slice(), - slice: Some(Box::new(wild)), + has_dot_dot: true, suffix, } } -- cgit 1.4.1-3-g733a5