@@ -22,7 +22,7 @@ use syntax::source_map::{Span, DUMMY_SP};
2222use crate :: interpret:: { self ,
2323 PlaceTy , MPlaceTy , MemPlace , OpTy , ImmTy , Immediate , Scalar , Pointer ,
2424 RawConst , ConstValue ,
25- EvalResult , EvalError , EvalErrorKind , GlobalId , EvalContext , StackPopCleanup ,
25+ EvalResult , EvalError , EvalErrorKind , GlobalId , InterpretCx , StackPopCleanup ,
2626 Allocation , AllocId , MemoryKind ,
2727 snapshot, RefTracking ,
2828} ;
@@ -34,7 +34,7 @@ const STEPS_UNTIL_DETECTOR_ENABLED: isize = 1_000_000;
3434/// Should be a power of two for performance reasons.
3535const DETECTOR_SNAPSHOT_PERIOD : isize = 256 ;
3636
37- /// The `EvalContext ` is only meant to be used to do field and index projections into constants for
37+ /// The `InterpretCx ` is only meant to be used to do field and index projections into constants for
3838/// `simd_shuffle` and const patterns in match arms.
3939///
4040/// The function containing the `match` that is currently being analyzed may have generic bounds
@@ -47,7 +47,7 @@ pub(crate) fn mk_eval_cx<'a, 'mir, 'tcx>(
4747 param_env : ty:: ParamEnv < ' tcx > ,
4848) -> CompileTimeEvalContext < ' a , ' mir , ' tcx > {
4949 debug ! ( "mk_eval_cx: {:?}" , param_env) ;
50- EvalContext :: new ( tcx. at ( span) , param_env, CompileTimeInterpreter :: new ( ) )
50+ InterpretCx :: new ( tcx. at ( span) , param_env, CompileTimeInterpreter :: new ( ) )
5151}
5252
5353pub ( crate ) fn eval_promoted < ' a , ' mir , ' tcx > (
@@ -116,7 +116,7 @@ fn eval_body_and_ecx<'a, 'mir, 'tcx>(
116116 // and try improving it down the road when more information is available
117117 let span = tcx. def_span ( cid. instance . def_id ( ) ) ;
118118 let span = mir. map ( |mir| mir. span ) . unwrap_or ( span) ;
119- let mut ecx = EvalContext :: new ( tcx. at ( span) , param_env, CompileTimeInterpreter :: new ( ) ) ;
119+ let mut ecx = InterpretCx :: new ( tcx. at ( span) , param_env, CompileTimeInterpreter :: new ( ) ) ;
120120 let r = eval_body_using_ecx ( & mut ecx, cid, mir, param_env) ;
121121 ( r, ecx)
122122}
@@ -292,7 +292,7 @@ impl<K: Hash + Eq, V> interpret::AllocMap<K, V> for FxHashMap<K, V> {
292292}
293293
294294type CompileTimeEvalContext < ' a , ' mir , ' tcx > =
295- EvalContext < ' a , ' mir , ' tcx , CompileTimeInterpreter < ' a , ' mir , ' tcx > > ;
295+ InterpretCx < ' a , ' mir , ' tcx , CompileTimeInterpreter < ' a , ' mir , ' tcx > > ;
296296
297297impl interpret:: MayLeak for ! {
298298 #[ inline( always) ]
@@ -317,12 +317,12 @@ impl<'a, 'mir, 'tcx> interpret::Machine<'a, 'mir, 'tcx>
317317 const STATIC_KIND : Option < !> = None ; // no copying of statics allowed
318318
319319 #[ inline( always) ]
320- fn enforce_validity ( _ecx : & EvalContext < ' a , ' mir , ' tcx , Self > ) -> bool {
320+ fn enforce_validity ( _ecx : & InterpretCx < ' a , ' mir , ' tcx , Self > ) -> bool {
321321 false // for now, we don't enforce validity
322322 }
323323
324324 fn find_fn (
325- ecx : & mut EvalContext < ' a , ' mir , ' tcx , Self > ,
325+ ecx : & mut InterpretCx < ' a , ' mir , ' tcx , Self > ,
326326 instance : ty:: Instance < ' tcx > ,
327327 args : & [ OpTy < ' tcx > ] ,
328328 dest : Option < PlaceTy < ' tcx > > ,
@@ -362,7 +362,7 @@ impl<'a, 'mir, 'tcx> interpret::Machine<'a, 'mir, 'tcx>
362362 }
363363
364364 fn call_intrinsic (
365- ecx : & mut EvalContext < ' a , ' mir , ' tcx , Self > ,
365+ ecx : & mut InterpretCx < ' a , ' mir , ' tcx , Self > ,
366366 instance : ty:: Instance < ' tcx > ,
367367 args : & [ OpTy < ' tcx > ] ,
368368 dest : PlaceTy < ' tcx > ,
@@ -378,7 +378,7 @@ impl<'a, 'mir, 'tcx> interpret::Machine<'a, 'mir, 'tcx>
378378 }
379379
380380 fn ptr_op (
381- _ecx : & EvalContext < ' a , ' mir , ' tcx , Self > ,
381+ _ecx : & InterpretCx < ' a , ' mir , ' tcx , Self > ,
382382 _bin_op : mir:: BinOp ,
383383 _left : ImmTy < ' tcx > ,
384384 _right : ImmTy < ' tcx > ,
@@ -406,15 +406,15 @@ impl<'a, 'mir, 'tcx> interpret::Machine<'a, 'mir, 'tcx>
406406 }
407407
408408 fn box_alloc (
409- _ecx : & mut EvalContext < ' a , ' mir , ' tcx , Self > ,
409+ _ecx : & mut InterpretCx < ' a , ' mir , ' tcx , Self > ,
410410 _dest : PlaceTy < ' tcx > ,
411411 ) -> EvalResult < ' tcx > {
412412 Err (
413413 ConstEvalError :: NeedsRfc ( "heap allocations via `box` keyword" . to_string ( ) ) . into ( ) ,
414414 )
415415 }
416416
417- fn before_terminator ( ecx : & mut EvalContext < ' a , ' mir , ' tcx , Self > ) -> EvalResult < ' tcx > {
417+ fn before_terminator ( ecx : & mut InterpretCx < ' a , ' mir , ' tcx , Self > ) -> EvalResult < ' tcx > {
418418 {
419419 let steps = & mut ecx. machine . steps_since_detector_enabled ;
420420
@@ -440,7 +440,7 @@ impl<'a, 'mir, 'tcx> interpret::Machine<'a, 'mir, 'tcx>
440440
441441 #[ inline( always) ]
442442 fn tag_new_allocation (
443- _ecx : & mut EvalContext < ' a , ' mir , ' tcx , Self > ,
443+ _ecx : & mut InterpretCx < ' a , ' mir , ' tcx , Self > ,
444444 ptr : Pointer ,
445445 _kind : MemoryKind < Self :: MemoryKinds > ,
446446 ) -> Pointer {
@@ -449,15 +449,15 @@ impl<'a, 'mir, 'tcx> interpret::Machine<'a, 'mir, 'tcx>
449449
450450 #[ inline( always) ]
451451 fn stack_push (
452- _ecx : & mut EvalContext < ' a , ' mir , ' tcx , Self > ,
452+ _ecx : & mut InterpretCx < ' a , ' mir , ' tcx , Self > ,
453453 ) -> EvalResult < ' tcx > {
454454 Ok ( ( ) )
455455 }
456456
457457 /// Called immediately before a stack frame gets popped.
458458 #[ inline( always) ]
459459 fn stack_pop (
460- _ecx : & mut EvalContext < ' a , ' mir , ' tcx , Self > ,
460+ _ecx : & mut InterpretCx < ' a , ' mir , ' tcx , Self > ,
461461 _extra : ( ) ,
462462 ) -> EvalResult < ' tcx > {
463463 Ok ( ( ) )
@@ -504,7 +504,7 @@ pub fn const_variant_index<'a, 'tcx>(
504504}
505505
506506pub fn error_to_const_error < ' a , ' mir , ' tcx > (
507- ecx : & EvalContext < ' a , ' mir , ' tcx , CompileTimeInterpreter < ' a , ' mir , ' tcx > > ,
507+ ecx : & InterpretCx < ' a , ' mir , ' tcx , CompileTimeInterpreter < ' a , ' mir , ' tcx > > ,
508508 mut error : EvalError < ' tcx >
509509) -> ConstEvalErr < ' tcx > {
510510 error. print_backtrace ( ) ;
0 commit comments