@@ -573,13 +573,13 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
573
573
) -> InterpResult < ' tcx , OpTy < ' tcx , M :: PointerTag > > {
574
574
match val {
575
575
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) ,
577
577
}
578
578
}
579
579
580
580
crate fn const_val_to_op (
581
581
& self ,
582
- val_val : ConstValue < ' tcx > ,
582
+ val_val : & ConstValue < ' tcx > ,
583
583
ty : Ty < ' tcx > ,
584
584
layout : Option < TyAndLayout < ' tcx > > ,
585
585
) -> InterpResult < ' tcx , OpTy < ' tcx , M :: PointerTag > > {
@@ -596,20 +596,20 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
596
596
let id = self . tcx . create_memory_alloc ( alloc) ;
597
597
// We rely on mutability being set correctly in that allocation to prevent writes
598
598
// 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) ) ?;
600
600
Operand :: Indirect ( MemPlace :: from_ptr ( ptr. into ( ) , layout. align . abi ) )
601
601
}
602
- ConstValue :: Scalar ( x) => Operand :: Immediate ( tag_scalar ( x) ?. into ( ) ) ,
602
+ ConstValue :: Scalar ( x) => Operand :: Immediate ( tag_scalar ( * x) ?. into ( ) ) ,
603
603
ConstValue :: Slice { data, start, end } => {
604
604
// We rely on mutability being set correctly in `data` to prevent writes
605
605
// where none should happen.
606
606
let ptr = Pointer :: new (
607
607
self . tcx . create_memory_alloc ( data) ,
608
- Size :: from_bytes ( start) , // offset: `start`
608
+ Size :: from_bytes ( * start) , // offset: `start`
609
609
) ;
610
610
Operand :: Immediate ( Immediate :: new_slice (
611
611
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`
613
613
self ,
614
614
) )
615
615
}
0 commit comments