Merge tuple and struct pattern generation.

This commit is contained in:
Oliver Scherer 2020-04-03 15:22:37 +02:00
parent 10b3595ba6
commit b54f122a1c

View File

@ -279,11 +279,7 @@ impl<'a, 'tcx> ConstToPat<'a, 'tcx> {
subpatterns: field_pats(destructured.fields),
}
}
ty::Adt(_, _) => {
let destructured = tcx.destructure_const(param_env.and(cv));
PatKind::Leaf { subpatterns: field_pats(destructured.fields) }
}
ty::Tuple(_) => {
ty::Tuple(_) | ty::Adt(_, _) => {
let destructured = tcx.destructure_const(param_env.and(cv));
PatKind::Leaf { subpatterns: field_pats(destructured.fields) }
}