@@ -39,7 +39,7 @@ impl<'mir, 'tcx> InterpCx<'mir, 'tcx, CompileTimeInterpreter<'mir, 'tcx>> {
3939 // &str
4040 assert ! ( args. len( ) == 1 ) ;
4141
42- let msg_place = self . deref_operand ( args[ 0 ] ) ?;
42+ let msg_place = self . deref_operand ( & args[ 0 ] ) ?;
4343 let msg = Symbol :: intern ( self . read_str ( msg_place) ?) ;
4444 let span = self . find_closest_untracked_caller_location ( ) ;
4545 let ( file, line, col) = self . location_triple_for_span ( span) ;
@@ -284,8 +284,8 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter<'mir,
284284 } ;
285285 match intrinsic_name {
286286 sym:: ptr_guaranteed_eq | sym:: ptr_guaranteed_ne => {
287- let a = ecx. read_immediate ( args[ 0 ] ) ?. to_scalar ( ) ?;
288- let b = ecx. read_immediate ( args[ 1 ] ) ?. to_scalar ( ) ?;
287+ let a = ecx. read_immediate ( & args[ 0 ] ) ?. to_scalar ( ) ?;
288+ let b = ecx. read_immediate ( & args[ 1 ] ) ?. to_scalar ( ) ?;
289289 let cmp = if intrinsic_name == sym:: ptr_guaranteed_eq {
290290 ecx. guaranteed_eq ( a, b)
291291 } else {
@@ -294,8 +294,8 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter<'mir,
294294 ecx. write_scalar ( Scalar :: from_bool ( cmp) , dest) ?;
295295 }
296296 sym:: const_allocate => {
297- let size = ecx. read_scalar ( args[ 0 ] ) ?. to_machine_usize ( ecx) ?;
298- let align = ecx. read_scalar ( args[ 1 ] ) ?. to_machine_usize ( ecx) ?;
297+ let size = ecx. read_scalar ( & args[ 0 ] ) ?. to_machine_usize ( ecx) ?;
298+ let align = ecx. read_scalar ( & args[ 1 ] ) ?. to_machine_usize ( ecx) ?;
299299
300300 let align = match Align :: from_bytes ( align) {
301301 Ok ( a) => a,
@@ -330,7 +330,7 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter<'mir,
330330 use rustc_middle:: mir:: AssertKind :: * ;
331331 // Convert `AssertKind<Operand>` to `AssertKind<Scalar>`.
332332 let eval_to_int =
333- |op| ecx. read_immediate ( ecx. eval_operand ( op, None ) ?) . map ( |x| x. to_const_int ( ) ) ;
333+ |op| ecx. read_immediate ( & ecx. eval_operand ( op, None ) ?) . map ( |x| x. to_const_int ( ) ) ;
334334 let err = match msg {
335335 BoundsCheck { ref len, ref index } => {
336336 let len = eval_to_int ( len) ?;
@@ -358,8 +358,8 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter<'mir,
358358 fn binary_ptr_op (
359359 _ecx : & InterpCx < ' mir , ' tcx , Self > ,
360360 _bin_op : mir:: BinOp ,
361- _left : ImmTy < ' tcx > ,
362- _right : ImmTy < ' tcx > ,
361+ _left : & ImmTy < ' tcx > ,
362+ _right : & ImmTy < ' tcx > ,
363363 ) -> InterpResult < ' tcx , ( Scalar , bool , Ty < ' tcx > ) > {
364364 Err ( ConstEvalErrKind :: NeedsRfc ( "pointer arithmetic or comparison" . to_string ( ) ) . into ( ) )
365365 }
0 commit comments