diff options
| author | Zalathar <Zalathar@users.noreply.github.com> | 2024-08-02 20:09:12 +1000 |
|---|---|---|
| committer | Zalathar <Zalathar@users.noreply.github.com> | 2024-08-07 20:52:46 +1000 |
| commit | e98e19e49108b6e49e452c3bd22c1aeccd43e507 (patch) | |
| tree | 8326d4c341fd0a72402ca6ba5cd0ffc54f4f1722 /compiler/rustc_pattern_analysis/src/rustc.rs | |
| parent | 4cd800503f0c0ba3c26f30c98aff755be6b9be43 (diff) | |
| download | rust-e98e19e49108b6e49e452c3bd22c1aeccd43e507.tar.gz rust-e98e19e49108b6e49e452c3bd22c1aeccd43e507.zip | |
Replace an unnecessary slice pattern with `has_dot_dot: bool`
Diffstat (limited to 'compiler/rustc_pattern_analysis/src/rustc.rs')
| -rw-r--r-- | compiler/rustc_pattern_analysis/src/rustc.rs | 5 |
1 files changed, 2 insertions, 3 deletions
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, } } |
