@@ -634,22 +634,22 @@ pub enum PatKind<'tcx> {
634
634
/// irrefutable when there is a slice pattern and both `prefix` and `suffix` are empty.
635
635
/// e.g., `&[ref xs @ ..]`.
636
636
Slice {
637
- prefix : Vec < Box < Pat < ' tcx > > > ,
637
+ prefix : Box < [ Box < Pat < ' tcx > > ] > ,
638
638
slice : Option < Box < Pat < ' tcx > > > ,
639
- suffix : Vec < Box < Pat < ' tcx > > > ,
639
+ suffix : Box < [ Box < Pat < ' tcx > > ] > ,
640
640
} ,
641
641
642
642
/// Fixed match against an array; irrefutable.
643
643
Array {
644
- prefix : Vec < Box < Pat < ' tcx > > > ,
644
+ prefix : Box < [ Box < Pat < ' tcx > > ] > ,
645
645
slice : Option < Box < Pat < ' tcx > > > ,
646
- suffix : Vec < Box < Pat < ' tcx > > > ,
646
+ suffix : Box < [ Box < Pat < ' tcx > > ] > ,
647
647
} ,
648
648
649
649
/// An or-pattern, e.g. `p | q`.
650
650
/// Invariant: `pats.len() >= 2`.
651
651
Or {
652
- pats : Vec < Box < Pat < ' tcx > > > ,
652
+ pats : Box < [ Box < Pat < ' tcx > > ] > ,
653
653
} ,
654
654
}
655
655
@@ -775,7 +775,7 @@ impl<'tcx> fmt::Display for Pat<'tcx> {
775
775
PatKind :: Slice { ref prefix, ref slice, ref suffix }
776
776
| PatKind :: Array { ref prefix, ref slice, ref suffix } => {
777
777
write ! ( f, "[" ) ?;
778
- for p in prefix {
778
+ for p in prefix. iter ( ) {
779
779
write ! ( f, "{}{}" , start_or_comma( ) , p) ?;
780
780
}
781
781
if let Some ( ref slice) = * slice {
@@ -786,13 +786,13 @@ impl<'tcx> fmt::Display for Pat<'tcx> {
786
786
}
787
787
write ! ( f, ".." ) ?;
788
788
}
789
- for p in suffix {
789
+ for p in suffix. iter ( ) {
790
790
write ! ( f, "{}{}" , start_or_comma( ) , p) ?;
791
791
}
792
792
write ! ( f, "]" )
793
793
}
794
794
PatKind :: Or { ref pats } => {
795
- for pat in pats {
795
+ for pat in pats. iter ( ) {
796
796
write ! ( f, "{}{}" , start_or_continue( " | " ) , pat) ?;
797
797
}
798
798
Ok ( ( ) )
@@ -809,8 +809,8 @@ mod size_asserts {
809
809
static_assert_size ! ( Block , 56 ) ;
810
810
static_assert_size ! ( Expr <' _>, 64 ) ;
811
811
static_assert_size ! ( ExprKind <' _>, 40 ) ;
812
- static_assert_size ! ( Pat <' _>, 80 ) ;
813
- static_assert_size ! ( PatKind <' _>, 64 ) ;
812
+ static_assert_size ! ( Pat <' _>, 72 ) ;
813
+ static_assert_size ! ( PatKind <' _>, 56 ) ;
814
814
static_assert_size ! ( Stmt <' _>, 56 ) ;
815
815
static_assert_size ! ( StmtKind <' _>, 48 ) ;
816
816
}
0 commit comments