@@ -22,7 +22,7 @@ use syntax::source_map::{Span, DUMMY_SP};
22
22
use crate :: interpret:: { self ,
23
23
PlaceTy , MPlaceTy , OpTy , ImmTy , Immediate , Scalar ,
24
24
RawConst , ConstValue ,
25
- InterpResult , InterpErrorInfo , InterpError , GlobalId , InterpretCx , StackPopCleanup ,
25
+ InterpResult , InterpErrorInfo , InterpError , GlobalId , InterpCx , StackPopCleanup ,
26
26
Allocation , AllocId , MemoryKind , Memory ,
27
27
snapshot, RefTracking , intern_const_alloc_recursive,
28
28
} ;
@@ -34,7 +34,7 @@ const STEPS_UNTIL_DETECTOR_ENABLED: isize = 1_000_000;
34
34
/// Should be a power of two for performance reasons.
35
35
const DETECTOR_SNAPSHOT_PERIOD : isize = 256 ;
36
36
37
- /// The `InterpretCx ` is only meant to be used to do field and index projections into constants for
37
+ /// The `InterpCx ` is only meant to be used to do field and index projections into constants for
38
38
/// `simd_shuffle` and const patterns in match arms.
39
39
///
40
40
/// The function containing the `match` that is currently being analyzed may have generic bounds
@@ -47,7 +47,7 @@ pub(crate) fn mk_eval_cx<'mir, 'tcx>(
47
47
param_env : ty:: ParamEnv < ' tcx > ,
48
48
) -> CompileTimeEvalContext < ' mir , ' tcx > {
49
49
debug ! ( "mk_eval_cx: {:?}" , param_env) ;
50
- InterpretCx :: new ( tcx. at ( span) , param_env, CompileTimeInterpreter :: new ( ) )
50
+ InterpCx :: new ( tcx. at ( span) , param_env, CompileTimeInterpreter :: new ( ) )
51
51
}
52
52
53
53
pub ( crate ) fn eval_promoted < ' mir , ' tcx > (
@@ -303,7 +303,7 @@ impl<K: Hash + Eq, V> interpret::AllocMap<K, V> for FxHashMap<K, V> {
303
303
}
304
304
305
305
crate type CompileTimeEvalContext < ' mir , ' tcx > =
306
- InterpretCx < ' mir , ' tcx , CompileTimeInterpreter < ' mir , ' tcx > > ;
306
+ InterpCx < ' mir , ' tcx , CompileTimeInterpreter < ' mir , ' tcx > > ;
307
307
308
308
impl interpret:: MayLeak for ! {
309
309
#[ inline( always) ]
@@ -326,12 +326,12 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter<'mir,
326
326
const STATIC_KIND : Option < !> = None ; // no copying of statics allowed
327
327
328
328
#[ inline( always) ]
329
- fn enforce_validity ( _ecx : & InterpretCx < ' mir , ' tcx , Self > ) -> bool {
329
+ fn enforce_validity ( _ecx : & InterpCx < ' mir , ' tcx , Self > ) -> bool {
330
330
false // for now, we don't enforce validity
331
331
}
332
332
333
333
fn find_fn (
334
- ecx : & mut InterpretCx < ' mir , ' tcx , Self > ,
334
+ ecx : & mut InterpCx < ' mir , ' tcx , Self > ,
335
335
instance : ty:: Instance < ' tcx > ,
336
336
args : & [ OpTy < ' tcx > ] ,
337
337
dest : Option < PlaceTy < ' tcx > > ,
@@ -371,7 +371,7 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter<'mir,
371
371
}
372
372
373
373
fn call_intrinsic (
374
- ecx : & mut InterpretCx < ' mir , ' tcx , Self > ,
374
+ ecx : & mut InterpCx < ' mir , ' tcx , Self > ,
375
375
instance : ty:: Instance < ' tcx > ,
376
376
args : & [ OpTy < ' tcx > ] ,
377
377
dest : PlaceTy < ' tcx > ,
@@ -387,7 +387,7 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter<'mir,
387
387
}
388
388
389
389
fn ptr_op (
390
- _ecx : & InterpretCx < ' mir , ' tcx , Self > ,
390
+ _ecx : & InterpCx < ' mir , ' tcx , Self > ,
391
391
_bin_op : mir:: BinOp ,
392
392
_left : ImmTy < ' tcx > ,
393
393
_right : ImmTy < ' tcx > ,
@@ -424,15 +424,15 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter<'mir,
424
424
}
425
425
426
426
fn box_alloc (
427
- _ecx : & mut InterpretCx < ' mir , ' tcx , Self > ,
427
+ _ecx : & mut InterpCx < ' mir , ' tcx , Self > ,
428
428
_dest : PlaceTy < ' tcx > ,
429
429
) -> InterpResult < ' tcx > {
430
430
Err (
431
431
ConstEvalError :: NeedsRfc ( "heap allocations via `box` keyword" . to_string ( ) ) . into ( ) ,
432
432
)
433
433
}
434
434
435
- fn before_terminator ( ecx : & mut InterpretCx < ' mir , ' tcx , Self > ) -> InterpResult < ' tcx > {
435
+ fn before_terminator ( ecx : & mut InterpCx < ' mir , ' tcx , Self > ) -> InterpResult < ' tcx > {
436
436
{
437
437
let steps = & mut ecx. machine . steps_since_detector_enabled ;
438
438
@@ -457,13 +457,13 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter<'mir,
457
457
}
458
458
459
459
#[ inline( always) ]
460
- fn stack_push ( _ecx : & mut InterpretCx < ' mir , ' tcx , Self > ) -> InterpResult < ' tcx > {
460
+ fn stack_push ( _ecx : & mut InterpCx < ' mir , ' tcx , Self > ) -> InterpResult < ' tcx > {
461
461
Ok ( ( ) )
462
462
}
463
463
464
464
/// Called immediately before a stack frame gets popped.
465
465
#[ inline( always) ]
466
- fn stack_pop ( _ecx : & mut InterpretCx < ' mir , ' tcx , Self > , _extra : ( ) ) -> InterpResult < ' tcx > {
466
+ fn stack_pop ( _ecx : & mut InterpCx < ' mir , ' tcx , Self > , _extra : ( ) ) -> InterpResult < ' tcx > {
467
467
Ok ( ( ) )
468
468
}
469
469
}
@@ -508,7 +508,7 @@ pub fn const_variant_index<'tcx>(
508
508
}
509
509
510
510
pub fn error_to_const_error < ' mir , ' tcx > (
511
- ecx : & InterpretCx < ' mir , ' tcx , CompileTimeInterpreter < ' mir , ' tcx > > ,
511
+ ecx : & InterpCx < ' mir , ' tcx , CompileTimeInterpreter < ' mir , ' tcx > > ,
512
512
mut error : InterpErrorInfo < ' tcx > ,
513
513
) -> ConstEvalErr < ' tcx > {
514
514
error. print_backtrace ( ) ;
@@ -632,7 +632,7 @@ pub fn const_eval_raw_provider<'tcx>(
632
632
}
633
633
634
634
let span = tcx. def_span ( cid. instance . def_id ( ) ) ;
635
- let mut ecx = InterpretCx :: new ( tcx. at ( span) , key. param_env , CompileTimeInterpreter :: new ( ) ) ;
635
+ let mut ecx = InterpCx :: new ( tcx. at ( span) , key. param_env , CompileTimeInterpreter :: new ( ) ) ;
636
636
637
637
let res = ecx. load_mir ( cid. instance . def ) ;
638
638
res. map ( |body| {
0 commit comments