Merge tuple and struct pattern generation.
This commit is contained in:
parent
10b3595ba6
commit
b54f122a1c
@ -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) }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user