@@ -634,22 +634,22 @@ pub enum PatKind<'tcx> {
634634 /// irrefutable when there is a slice pattern and both `prefix` and `suffix` are empty.
635635 /// e.g., `&[ref xs @ ..]`.
636636 Slice {
637- prefix : Vec < Box < Pat < ' tcx > > > ,
637+ prefix : Box < [ Box < Pat < ' tcx > > ] > ,
638638 slice : Option < Box < Pat < ' tcx > > > ,
639- suffix : Vec < Box < Pat < ' tcx > > > ,
639+ suffix : Box < [ Box < Pat < ' tcx > > ] > ,
640640 } ,
641641
642642 /// Fixed match against an array; irrefutable.
643643 Array {
644- prefix : Vec < Box < Pat < ' tcx > > > ,
644+ prefix : Box < [ Box < Pat < ' tcx > > ] > ,
645645 slice : Option < Box < Pat < ' tcx > > > ,
646- suffix : Vec < Box < Pat < ' tcx > > > ,
646+ suffix : Box < [ Box < Pat < ' tcx > > ] > ,
647647 } ,
648648
649649 /// An or-pattern, e.g. `p | q`.
650650 /// Invariant: `pats.len() >= 2`.
651651 Or {
652- pats : Vec < Box < Pat < ' tcx > > > ,
652+ pats : Box < [ Box < Pat < ' tcx > > ] > ,
653653 } ,
654654}
655655
@@ -775,7 +775,7 @@ impl<'tcx> fmt::Display for Pat<'tcx> {
775775 PatKind :: Slice { ref prefix, ref slice, ref suffix }
776776 | PatKind :: Array { ref prefix, ref slice, ref suffix } => {
777777 write ! ( f, "[" ) ?;
778- for p in prefix {
778+ for p in prefix. iter ( ) {
779779 write ! ( f, "{}{}" , start_or_comma( ) , p) ?;
780780 }
781781 if let Some ( ref slice) = * slice {
@@ -786,13 +786,13 @@ impl<'tcx> fmt::Display for Pat<'tcx> {
786786 }
787787 write ! ( f, ".." ) ?;
788788 }
789- for p in suffix {
789+ for p in suffix. iter ( ) {
790790 write ! ( f, "{}{}" , start_or_comma( ) , p) ?;
791791 }
792792 write ! ( f, "]" )
793793 }
794794 PatKind :: Or { ref pats } => {
795- for pat in pats {
795+ for pat in pats. iter ( ) {
796796 write ! ( f, "{}{}" , start_or_continue( " | " ) , pat) ?;
797797 }
798798 Ok ( ( ) )
@@ -809,8 +809,8 @@ mod size_asserts {
809809 static_assert_size ! ( Block , 56 ) ;
810810 static_assert_size ! ( Expr <' _>, 64 ) ;
811811 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 ) ;
814814 static_assert_size ! ( Stmt <' _>, 56 ) ;
815815 static_assert_size ! ( StmtKind <' _>, 48 ) ;
816816}
0 commit comments