@@ -39,7 +39,7 @@ impl<'mir, 'tcx> InterpCx<'mir, 'tcx, CompileTimeInterpreter<'mir, 'tcx>> {
39
39
// &str
40
40
assert ! ( args. len( ) == 1 ) ;
41
41
42
- let msg_place = self . deref_operand ( args[ 0 ] ) ?;
42
+ let msg_place = self . deref_operand ( & args[ 0 ] ) ?;
43
43
let msg = Symbol :: intern ( self . read_str ( msg_place) ?) ;
44
44
let span = self . find_closest_untracked_caller_location ( ) ;
45
45
let ( file, line, col) = self . location_triple_for_span ( span) ;
@@ -284,8 +284,8 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter<'mir,
284
284
} ;
285
285
match intrinsic_name {
286
286
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 ( ) ?;
289
289
let cmp = if intrinsic_name == sym:: ptr_guaranteed_eq {
290
290
ecx. guaranteed_eq ( a, b)
291
291
} else {
@@ -294,8 +294,8 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter<'mir,
294
294
ecx. write_scalar ( Scalar :: from_bool ( cmp) , dest) ?;
295
295
}
296
296
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) ?;
299
299
300
300
let align = match Align :: from_bytes ( align) {
301
301
Ok ( a) => a,
@@ -330,7 +330,7 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter<'mir,
330
330
use rustc_middle:: mir:: AssertKind :: * ;
331
331
// Convert `AssertKind<Operand>` to `AssertKind<Scalar>`.
332
332
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 ( ) ) ;
334
334
let err = match msg {
335
335
BoundsCheck { ref len, ref index } => {
336
336
let len = eval_to_int ( len) ?;
@@ -358,8 +358,8 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter<'mir,
358
358
fn binary_ptr_op (
359
359
_ecx : & InterpCx < ' mir , ' tcx , Self > ,
360
360
_bin_op : mir:: BinOp ,
361
- _left : ImmTy < ' tcx > ,
362
- _right : ImmTy < ' tcx > ,
361
+ _left : & ImmTy < ' tcx > ,
362
+ _right : & ImmTy < ' tcx > ,
363
363
) -> InterpResult < ' tcx , ( Scalar , bool , Ty < ' tcx > ) > {
364
364
Err ( ConstEvalErrKind :: NeedsRfc ( "pointer arithmetic or comparison" . to_string ( ) ) . into ( ) )
365
365
}
0 commit comments