@@ -38,7 +38,7 @@ fn apply_arg_attrs_to_abi_param(mut param: AbiParam, arg_attrs: ArgAttributes) -
3838 param
3939}
4040
41- fn cast_target_to_abi_params ( cast : CastTarget ) -> SmallVec < [ AbiParam ; 2 ] > {
41+ fn cast_target_to_abi_params ( cast : & CastTarget ) -> SmallVec < [ AbiParam ; 2 ] > {
4242 let ( rest_count, rem_bytes) = if cast. rest . unit . size . bytes ( ) == 0 {
4343 ( 0 , 0 )
4444 } else {
@@ -100,7 +100,7 @@ impl<'tcx> ArgAbiExt<'tcx> for ArgAbi<'tcx, Ty<'tcx>> {
100100 }
101101 _ => unreachable ! ( "{:?}" , self . layout. abi) ,
102102 } ,
103- PassMode :: Cast ( cast) => cast_target_to_abi_params ( cast) ,
103+ PassMode :: Cast ( ref cast) => cast_target_to_abi_params ( cast) ,
104104 PassMode :: Indirect { attrs, extra_attrs : None , on_stack } => {
105105 if on_stack {
106106 // Abi requires aligning struct size to pointer size
@@ -145,7 +145,9 @@ impl<'tcx> ArgAbiExt<'tcx> for ArgAbi<'tcx, Ty<'tcx>> {
145145 }
146146 _ => unreachable ! ( "{:?}" , self . layout. abi) ,
147147 } ,
148- PassMode :: Cast ( cast) => ( None , cast_target_to_abi_params ( cast) . into_iter ( ) . collect ( ) ) ,
148+ PassMode :: Cast ( ref cast) => {
149+ ( None , cast_target_to_abi_params ( cast) . into_iter ( ) . collect ( ) )
150+ }
149151 PassMode :: Indirect { attrs : _, extra_attrs : None , on_stack } => {
150152 assert ! ( !on_stack) ;
151153 ( Some ( AbiParam :: special ( pointer_ty ( tcx) , ArgumentPurpose :: StructReturn ) ) , vec ! [ ] )
@@ -160,7 +162,7 @@ impl<'tcx> ArgAbiExt<'tcx> for ArgAbi<'tcx, Ty<'tcx>> {
160162pub ( super ) fn to_casted_value < ' tcx > (
161163 fx : & mut FunctionCx < ' _ , ' _ , ' tcx > ,
162164 arg : CValue < ' tcx > ,
163- cast : CastTarget ,
165+ cast : & CastTarget ,
164166) -> SmallVec < [ Value ; 2 ] > {
165167 let ( ptr, meta) = arg. force_stack ( fx) ;
166168 assert ! ( meta. is_none( ) ) ;
@@ -179,7 +181,7 @@ pub(super) fn from_casted_value<'tcx>(
179181 fx : & mut FunctionCx < ' _ , ' _ , ' tcx > ,
180182 block_params : & [ Value ] ,
181183 layout : TyAndLayout < ' tcx > ,
182- cast : CastTarget ,
184+ cast : & CastTarget ,
183185) -> CValue < ' tcx > {
184186 let abi_params = cast_target_to_abi_params ( cast) ;
185187 let abi_param_size: u32 = abi_params. iter ( ) . map ( |param| param. value_type . bytes ( ) ) . sum ( ) ;
@@ -224,7 +226,7 @@ pub(super) fn adjust_arg_for_abi<'tcx>(
224226 let ( a, b) = arg. load_scalar_pair ( fx) ;
225227 smallvec ! [ a, b]
226228 }
227- PassMode :: Cast ( cast) => to_casted_value ( fx, arg, cast) ,
229+ PassMode :: Cast ( ref cast) => to_casted_value ( fx, arg, cast) ,
228230 PassMode :: Indirect { .. } => {
229231 if is_owned {
230232 match arg. force_stack ( fx) {
@@ -268,7 +270,7 @@ pub(super) fn cvalue_for_param<'tcx>(
268270 local,
269271 local_field,
270272 & block_params,
271- arg_abi. mode ,
273+ & arg_abi. mode ,
272274 arg_abi. layout ,
273275 ) ;
274276
@@ -282,7 +284,9 @@ pub(super) fn cvalue_for_param<'tcx>(
282284 assert_eq ! ( block_params. len( ) , 2 , "{:?}" , block_params) ;
283285 Some ( CValue :: by_val_pair ( block_params[ 0 ] , block_params[ 1 ] , arg_abi. layout ) )
284286 }
285- PassMode :: Cast ( cast) => Some ( from_casted_value ( fx, & block_params, arg_abi. layout , cast) ) ,
287+ PassMode :: Cast ( ref cast) => {
288+ Some ( from_casted_value ( fx, & block_params, arg_abi. layout , cast) )
289+ }
286290 PassMode :: Indirect { attrs : _, extra_attrs : None , on_stack : _ } => {
287291 assert_eq ! ( block_params. len( ) , 1 , "{:?}" , block_params) ;
288292 Some ( CValue :: by_ref ( Pointer :: new ( block_params[ 0 ] ) , arg_abi. layout ) )
0 commit comments