@@ -592,9 +592,12 @@ impl<'a, 'tcx> MirContext<'a, 'tcx> {
592
592
593
593
self . trans_argument ( & bcx, op, & mut llargs, & fn_ty. args [ i] ) ;
594
594
}
595
- if let Some ( tup) = untuple {
596
- self . trans_arguments_untupled ( & bcx, tup, & mut llargs,
597
- & fn_ty. args [ first_args. len ( ) ..] )
595
+ if let Some ( tuple) = untuple {
596
+ let tuple = self . trans_operand ( & bcx, tuple) ;
597
+ for ( i, arg) in fn_ty. args [ first_args. len ( ) ..] . iter ( ) . enumerate ( ) {
598
+ let op = tuple. extract_field ( & bcx, i) ;
599
+ self . trans_argument ( & bcx, op, & mut llargs, arg) ;
600
+ }
598
601
}
599
602
600
603
let fn_ptr = match ( llfn, instance) {
@@ -692,29 +695,6 @@ impl<'a, 'tcx> MirContext<'a, 'tcx> {
692
695
llargs. push ( llval) ;
693
696
}
694
697
695
- fn trans_arguments_untupled ( & mut self ,
696
- bcx : & Builder < ' a , ' tcx > ,
697
- operand : & mir:: Operand < ' tcx > ,
698
- llargs : & mut Vec < ValueRef > ,
699
- args : & [ ArgType < ' tcx > ] ) {
700
- let tuple = self . trans_operand ( bcx, operand) ;
701
-
702
- // Handle both by-ref and immediate tuples.
703
- if let Ref ( llval, align) = tuple. val {
704
- let tuple_ptr = PlaceRef :: new_sized ( llval, tuple. layout , align) ;
705
- for i in 0 ..tuple. layout . fields . count ( ) {
706
- let field_ptr = tuple_ptr. project_field ( bcx, i) ;
707
- self . trans_argument ( bcx, field_ptr. load ( bcx) , llargs, & args[ i] ) ;
708
- }
709
- } else {
710
- // If the tuple is immediate, the elements are as well.
711
- for i in 0 ..tuple. layout . fields . count ( ) {
712
- let op = tuple. extract_field ( bcx, i) ;
713
- self . trans_argument ( bcx, op, llargs, & args[ i] ) ;
714
- }
715
- }
716
- }
717
-
718
698
fn get_personality_slot ( & mut self , bcx : & Builder < ' a , ' tcx > ) -> PlaceRef < ' tcx > {
719
699
let ccx = bcx. ccx ;
720
700
if let Some ( slot) = self . personality_slot {
0 commit comments