@@ -196,27 +196,11 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
196196 self . write_immediate ( * val, & dest) ?;
197197 }
198198
199- Aggregate ( ref kind, ref operands) => {
200- // active_field_index is for union initialization.
201- let ( dest, active_field_index) = match * * kind {
202- mir:: AggregateKind :: Adt ( adt_did, variant_index, _, _, active_field_index) => {
203- self . write_discriminant ( variant_index, & dest) ?;
204- if self . tcx . adt_def ( adt_did) . is_enum ( ) {
205- assert ! ( active_field_index. is_none( ) ) ;
206- ( self . place_downcast ( & dest, variant_index) ?, None )
207- } else {
208- if active_field_index. is_some ( ) {
209- assert_eq ! ( operands. len( ) , 1 ) ;
210- }
211- ( dest, active_field_index)
212- }
213- }
214- _ => ( dest, None ) ,
215- } ;
199+ Aggregate ( box ref kind, ref operands) => {
200+ assert ! ( matches!( kind, mir:: AggregateKind :: Array ( ..) ) ) ;
216201
217- for ( i , operand) in operands. iter ( ) . enumerate ( ) {
202+ for ( field_index , operand) in operands. iter ( ) . enumerate ( ) {
218203 let op = self . eval_operand ( operand, None ) ?;
219- let field_index = active_field_index. unwrap_or ( i) ;
220204 let field_dest = self . place_field ( & dest, field_index) ?;
221205 self . copy_op ( & op, & field_dest) ?;
222206 }
0 commit comments