@@ -231,7 +231,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
231231 }
232232
233233 /// Project to the given *named* field (which must be a struct or union type).
234- fn project_field_named < P : Projectable < ' mir , ' tcx , Provenance > > (
234+ fn project_field_named < P : Projectable < ' tcx , Provenance > > (
235235 & self ,
236236 base : & P ,
237237 name : & str ,
@@ -252,13 +252,13 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
252252 fn write_int (
253253 & mut self ,
254254 i : impl Into < i128 > ,
255- dest : & PlaceTy < ' tcx , Provenance > ,
255+ dest : & impl Writeable < ' tcx , Provenance > ,
256256 ) -> InterpResult < ' tcx > {
257- assert ! ( dest. layout. abi. is_scalar( ) , "write_int on non-scalar type {}" , dest. layout. ty) ;
258- let val = if dest. layout . abi . is_signed ( ) {
259- Scalar :: from_int ( i, dest. layout . size )
257+ assert ! ( dest. layout( ) . abi. is_scalar( ) , "write_int on non-scalar type {}" , dest. layout( ) . ty) ;
258+ let val = if dest. layout ( ) . abi . is_signed ( ) {
259+ Scalar :: from_int ( i, dest. layout ( ) . size )
260260 } else {
261- Scalar :: from_uint ( u64:: try_from ( i. into ( ) ) . unwrap ( ) , dest. layout . size )
261+ Scalar :: from_uint ( u64:: try_from ( i. into ( ) ) . unwrap ( ) , dest. layout ( ) . size )
262262 } ;
263263 self . eval_context_mut ( ) . write_scalar ( val, dest)
264264 }
@@ -267,12 +267,12 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
267267 fn write_int_fields (
268268 & mut self ,
269269 values : & [ i128 ] ,
270- dest : & MPlaceTy < ' tcx , Provenance > ,
270+ dest : & impl Writeable < ' tcx , Provenance > ,
271271 ) -> InterpResult < ' tcx > {
272272 let this = self . eval_context_mut ( ) ;
273273 for ( idx, & val) in values. iter ( ) . enumerate ( ) {
274274 let field = this. project_field ( dest, idx) ?;
275- this. write_int ( val, & field. into ( ) ) ?;
275+ this. write_int ( val, & field) ?;
276276 }
277277 Ok ( ( ) )
278278 }
@@ -281,18 +281,18 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
281281 fn write_int_fields_named (
282282 & mut self ,
283283 values : & [ ( & str , i128 ) ] ,
284- dest : & MPlaceTy < ' tcx , Provenance > ,
284+ dest : & impl Writeable < ' tcx , Provenance > ,
285285 ) -> InterpResult < ' tcx > {
286286 let this = self . eval_context_mut ( ) ;
287287 for & ( name, val) in values. iter ( ) {
288288 let field = this. project_field_named ( dest, name) ?;
289- this. write_int ( val, & field. into ( ) ) ?;
289+ this. write_int ( val, & field) ?;
290290 }
291291 Ok ( ( ) )
292292 }
293293
294294 /// Write a 0 of the appropriate size to `dest`.
295- fn write_null ( & mut self , dest : & PlaceTy < ' tcx , Provenance > ) -> InterpResult < ' tcx > {
295+ fn write_null ( & mut self , dest : & impl Writeable < ' tcx , Provenance > ) -> InterpResult < ' tcx > {
296296 self . write_int ( 0 , dest)
297297 }
298298
@@ -606,7 +606,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
606606 // Allocate new place, set initial value to 0.
607607 let errno_layout = this. machine . layouts . u32 ;
608608 let errno_place = this. allocate ( errno_layout, MiriMemoryKind :: Machine . into ( ) ) ?;
609- this. write_scalar ( Scalar :: from_u32 ( 0 ) , & errno_place. into ( ) ) ?;
609+ this. write_scalar ( Scalar :: from_u32 ( 0 ) , & errno_place) ?;
610610 this. active_thread_mut ( ) . last_error = Some ( errno_place) ;
611611 Ok ( errno_place)
612612 }
@@ -616,7 +616,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
616616 fn set_last_error ( & mut self , scalar : Scalar < Provenance > ) -> InterpResult < ' tcx > {
617617 let this = self . eval_context_mut ( ) ;
618618 let errno_place = this. last_error_place ( ) ?;
619- this. write_scalar ( scalar, & errno_place. into ( ) )
619+ this. write_scalar ( scalar, & errno_place)
620620 }
621621
622622 /// Gets the last error variable.
@@ -785,7 +785,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
785785 ) -> InterpResult < ' tcx , ( ) > {
786786 let this = self . eval_context_mut ( ) ;
787787 let value_place = this. deref_operand_and_offset ( op, offset, base_layout, value_layout) ?;
788- this. write_scalar ( value, & value_place. into ( ) )
788+ this. write_scalar ( value, & value_place)
789789 }
790790
791791 /// Parse a `timespec` struct and return it as a `std::time::Duration`. It returns `None`
0 commit comments