Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit b54f122

Browse files
committed
Merge tuple and struct pattern generation.
1 parent 10b3595 commit b54f122

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,7 @@ impl<'a, 'tcx> ConstToPat<'a, 'tcx> {
279279
subpatterns: field_pats(destructured.fields),
280280
}
281281
}
282-
ty::Adt(_, _) => {
283-
let destructured = tcx.destructure_const(param_env.and(cv));
284-
PatKind::Leaf { subpatterns: field_pats(destructured.fields) }
285-
}
286-
ty::Tuple(_) => {
282+
ty::Tuple(_) | ty::Adt(_, _) => {
287283
let destructured = tcx.destructure_const(param_env.and(cv));
288284
PatKind::Leaf { subpatterns: field_pats(destructured.fields) }
289285
}

0 commit comments

Comments
 (0)