@@ -921,13 +921,12 @@ fn trans_args_under_call_abi<'blk, 'tcx>(
921
921
// Translate the `self` argument first.
922
922
if !ignore_self {
923
923
let arg_datum = unpack_datum ! ( bcx, expr:: trans( bcx, & * arg_exprs[ 0 ] ) ) ;
924
- llargs. push ( unpack_result ! ( bcx, {
925
- trans_arg_datum( bcx,
926
- args[ 0 ] ,
927
- arg_datum,
928
- arg_cleanup_scope,
929
- DontAutorefArg )
930
- } ) )
924
+ bcx = trans_arg_datum ( bcx,
925
+ args[ 0 ] ,
926
+ arg_datum,
927
+ arg_cleanup_scope,
928
+ DontAutorefArg ,
929
+ llargs) ;
931
930
}
932
931
933
932
// Now untuple the rest of the arguments.
@@ -945,21 +944,20 @@ fn trans_args_under_call_abi<'blk, 'tcx>(
945
944
tuple_expr. id) ) ;
946
945
let repr = adt:: represent_type ( bcx. ccx ( ) , tuple_type) ;
947
946
let repr_ptr = & * repr;
948
- llargs . extend ( field_types. iter ( ) . enumerate ( ) . map ( | ( i , field_type ) | {
947
+ for ( i , field_type ) in field_types. iter ( ) . enumerate ( ) {
949
948
let arg_datum = tuple_lvalue_datum. get_element (
950
949
bcx,
951
950
field_type,
952
951
|srcval| {
953
952
adt:: trans_field_ptr ( bcx, repr_ptr, srcval, 0 , i)
954
953
} ) . to_expr_datum ( ) ;
955
- unpack_result ! ( bcx, trans_arg_datum(
956
- bcx,
957
- field_type,
958
- arg_datum,
959
- arg_cleanup_scope,
960
- DontAutorefArg )
961
- )
962
- } ) ) ;
954
+ bcx = trans_arg_datum ( bcx,
955
+ field_type,
956
+ arg_datum,
957
+ arg_cleanup_scope,
958
+ DontAutorefArg ,
959
+ llargs) ;
960
+ }
963
961
}
964
962
_ => {
965
963
bcx. sess ( ) . span_bug ( tuple_expr. span ,
@@ -982,13 +980,12 @@ fn trans_overloaded_call_args<'blk, 'tcx>(
982
980
let arg_tys = ty:: erase_late_bound_regions ( bcx. tcx ( ) , & ty:: ty_fn_args ( fn_ty) ) ;
983
981
if !ignore_self {
984
982
let arg_datum = unpack_datum ! ( bcx, expr:: trans( bcx, arg_exprs[ 0 ] ) ) ;
985
- llargs. push ( unpack_result ! ( bcx, {
986
- trans_arg_datum( bcx,
987
- arg_tys[ 0 ] ,
988
- arg_datum,
989
- arg_cleanup_scope,
990
- DontAutorefArg )
991
- } ) )
983
+ bcx = trans_arg_datum ( bcx,
984
+ arg_tys[ 0 ] ,
985
+ arg_datum,
986
+ arg_cleanup_scope,
987
+ DontAutorefArg ,
988
+ llargs) ;
992
989
}
993
990
994
991
// Now untuple the rest of the arguments.
@@ -998,13 +995,12 @@ fn trans_overloaded_call_args<'blk, 'tcx>(
998
995
for ( i, & field_type) in field_types. iter ( ) . enumerate ( ) {
999
996
let arg_datum =
1000
997
unpack_datum ! ( bcx, expr:: trans( bcx, arg_exprs[ i + 1 ] ) ) ;
1001
- llargs. push ( unpack_result ! ( bcx, {
1002
- trans_arg_datum( bcx,
1003
- field_type,
1004
- arg_datum,
1005
- arg_cleanup_scope,
1006
- DontAutorefArg )
1007
- } ) )
998
+ bcx = trans_arg_datum ( bcx,
999
+ field_type,
1000
+ arg_datum,
1001
+ arg_cleanup_scope,
1002
+ DontAutorefArg ,
1003
+ llargs) ;
1008
1004
}
1009
1005
}
1010
1006
_ => {
@@ -1061,11 +1057,10 @@ pub fn trans_args<'a, 'blk, 'tcx>(cx: Block<'blk, 'tcx>,
1061
1057
} ;
1062
1058
1063
1059
let arg_datum = unpack_datum ! ( bcx, expr:: trans( bcx, & * * arg_expr) ) ;
1064
- llargs. push ( unpack_result ! ( bcx, {
1065
- trans_arg_datum( bcx, arg_ty, arg_datum,
1066
- arg_cleanup_scope,
1067
- DontAutorefArg )
1068
- } ) ) ;
1060
+ bcx = trans_arg_datum ( bcx, arg_ty, arg_datum,
1061
+ arg_cleanup_scope,
1062
+ DontAutorefArg ,
1063
+ llargs) ;
1069
1064
}
1070
1065
}
1071
1066
ArgOverloadedCall ( arg_exprs) => {
@@ -1079,19 +1074,17 @@ pub fn trans_args<'a, 'blk, 'tcx>(cx: Block<'blk, 'tcx>,
1079
1074
ArgOverloadedOp ( lhs, rhs, autoref) => {
1080
1075
assert ! ( !variadic) ;
1081
1076
1082
- llargs. push ( unpack_result ! ( bcx, {
1083
- trans_arg_datum( bcx, arg_tys[ 0 ] , lhs,
1084
- arg_cleanup_scope,
1085
- DontAutorefArg )
1086
- } ) ) ;
1077
+ bcx = trans_arg_datum ( bcx, arg_tys[ 0 ] , lhs,
1078
+ arg_cleanup_scope,
1079
+ DontAutorefArg ,
1080
+ llargs) ;
1087
1081
1088
1082
assert_eq ! ( arg_tys. len( ) , 1 + rhs. len( ) ) ;
1089
1083
for ( rhs, rhs_id) in rhs {
1090
- llargs. push ( unpack_result ! ( bcx, {
1091
- trans_arg_datum( bcx, arg_tys[ 1 ] , rhs,
1092
- arg_cleanup_scope,
1093
- if autoref { DoAutorefArg ( rhs_id) } else { DontAutorefArg } )
1094
- } ) ) ;
1084
+ bcx = trans_arg_datum ( bcx, arg_tys[ 1 ] , rhs,
1085
+ arg_cleanup_scope,
1086
+ if autoref { DoAutorefArg ( rhs_id) } else { DontAutorefArg } ,
1087
+ llargs) ;
1095
1088
}
1096
1089
}
1097
1090
ArgVals ( vs) => {
@@ -1112,8 +1105,9 @@ pub fn trans_arg_datum<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
1112
1105
formal_arg_ty : Ty < ' tcx > ,
1113
1106
arg_datum : Datum < ' tcx , Expr > ,
1114
1107
arg_cleanup_scope : cleanup:: ScopeId ,
1115
- autoref_arg : AutorefArg )
1116
- -> Result < ' blk , ' tcx > {
1108
+ autoref_arg : AutorefArg ,
1109
+ llargs : & mut Vec < ValueRef > )
1110
+ -> Block < ' blk , ' tcx > {
1117
1111
let _icx = push_ctxt ( "trans_arg_datum" ) ;
1118
1112
let mut bcx = bcx;
1119
1113
let ccx = bcx. ccx ( ) ;
@@ -1164,5 +1158,8 @@ pub fn trans_arg_datum<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
1164
1158
}
1165
1159
1166
1160
debug ! ( "--- trans_arg_datum passing {}" , bcx. val_to_string( val) ) ;
1167
- Result :: new ( bcx, val)
1161
+
1162
+ llargs. push ( val) ;
1163
+
1164
+ bcx
1168
1165
}
0 commit comments