@@ -573,13 +573,13 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
573573 ) -> InterpResult < ' tcx , OpTy < ' tcx , M :: PointerTag > > {
574574 match val {
575575 mir:: ConstantKind :: Ty ( ct) => self . const_to_op ( ct, layout) ,
576- mir:: ConstantKind :: Val ( val, ty) => self . const_val_to_op ( * val, ty, layout) ,
576+ mir:: ConstantKind :: Val ( val, ty) => self . const_val_to_op ( val, ty, layout) ,
577577 }
578578 }
579579
580580 crate fn const_val_to_op (
581581 & self ,
582- val_val : ConstValue < ' tcx > ,
582+ val_val : & ConstValue < ' tcx > ,
583583 ty : Ty < ' tcx > ,
584584 layout : Option < TyAndLayout < ' tcx > > ,
585585 ) -> InterpResult < ' tcx , OpTy < ' tcx , M :: PointerTag > > {
@@ -596,20 +596,20 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
596596 let id = self . tcx . create_memory_alloc ( alloc) ;
597597 // We rely on mutability being set correctly in that allocation to prevent writes
598598 // where none should happen.
599- let ptr = self . global_base_pointer ( Pointer :: new ( id, offset) ) ?;
599+ let ptr = self . global_base_pointer ( Pointer :: new ( id, * offset) ) ?;
600600 Operand :: Indirect ( MemPlace :: from_ptr ( ptr. into ( ) , layout. align . abi ) )
601601 }
602- ConstValue :: Scalar ( x) => Operand :: Immediate ( tag_scalar ( x) ?. into ( ) ) ,
602+ ConstValue :: Scalar ( x) => Operand :: Immediate ( tag_scalar ( * x) ?. into ( ) ) ,
603603 ConstValue :: Slice { data, start, end } => {
604604 // We rely on mutability being set correctly in `data` to prevent writes
605605 // where none should happen.
606606 let ptr = Pointer :: new (
607607 self . tcx . create_memory_alloc ( data) ,
608- Size :: from_bytes ( start) , // offset: `start`
608+ Size :: from_bytes ( * start) , // offset: `start`
609609 ) ;
610610 Operand :: Immediate ( Immediate :: new_slice (
611611 Scalar :: from_pointer ( self . global_base_pointer ( ptr) ?, & * self . tcx ) ,
612- u64:: try_from ( end. checked_sub ( start) . unwrap ( ) ) . unwrap ( ) , // len: `end - start`
612+ u64:: try_from ( end. checked_sub ( * start) . unwrap ( ) ) . unwrap ( ) , // len: `end - start`
613613 self ,
614614 ) )
615615 }
0 commit comments