Skip to content

Commit 49194eb

Browse files
committed
Split up a complex subpattern match in expr_into_pattern
1 parent 5742b9a commit 49194eb

File tree

1 file changed

+8
-12
lines changed
  • compiler/rustc_mir_build/src/builder/matches

1 file changed

+8
-12
lines changed

compiler/rustc_mir_build/src/builder/matches/mod.rs

+8-12
Original file line numberDiff line numberDiff line change
@@ -604,19 +604,15 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
604604
// Optimize the case of `let x: T = ...` to write directly
605605
// into `x` and then require that `T == typeof(x)`.
606606
PatKind::AscribeUserType {
607-
subpattern:
608-
box Pat {
609-
kind:
610-
PatKind::Binding {
611-
mode: BindingMode(ByRef::No, _),
612-
var,
613-
subpattern: None,
614-
..
615-
},
616-
..
617-
},
607+
ref subpattern,
618608
ascription: thir::Ascription { ref annotation, variance: _ },
619-
} => {
609+
} if let PatKind::Binding {
610+
mode: BindingMode(ByRef::No, _),
611+
var,
612+
subpattern: None,
613+
..
614+
} = subpattern.kind =>
615+
{
620616
let place = self.storage_live_binding(
621617
block,
622618
var,

0 commit comments

Comments
 (0)