@@ -67,8 +67,8 @@ pub fn create_ecx<'a, 'mir: 'a, 'tcx: 'mir>(
67
67
tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
68
68
main_id : DefId ,
69
69
config : MiriConfig ,
70
- ) -> EvalResult < ' tcx , EvalContext < ' a , ' mir , ' tcx , Evaluator < ' tcx > > > {
71
- let mut ecx = EvalContext :: new (
70
+ ) -> EvalResult < ' tcx , InterpretCx < ' a , ' mir , ' tcx , Evaluator < ' tcx > > > {
71
+ let mut ecx = InterpretCx :: new (
72
72
tcx. at ( syntax:: source_map:: DUMMY_SP ) ,
73
73
ty:: ParamEnv :: reveal_all ( ) ,
74
74
Evaluator :: new ( config. validate ) ,
@@ -345,7 +345,7 @@ impl<'tcx> Evaluator<'tcx> {
345
345
346
346
// FIXME: rustc issue <https://github.com/rust-lang/rust/issues/47131>.
347
347
#[ allow( dead_code) ]
348
- type MiriEvalContext < ' a , ' mir , ' tcx > = EvalContext < ' a , ' mir , ' tcx , Evaluator < ' tcx > > ;
348
+ type MiriEvalContext < ' a , ' mir , ' tcx > = InterpretCx < ' a , ' mir , ' tcx , Evaluator < ' tcx > > ;
349
349
350
350
// A little trait that's useful to be inherited by extension traits.
351
351
pub trait MiriEvalContextExt < ' a , ' mir , ' tcx > {
@@ -376,14 +376,14 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for Evaluator<'tcx> {
376
376
const STATIC_KIND : Option < MiriMemoryKind > = Some ( MiriMemoryKind :: MutStatic ) ;
377
377
378
378
#[ inline( always) ]
379
- fn enforce_validity ( ecx : & EvalContext < ' a , ' mir , ' tcx , Self > ) -> bool {
379
+ fn enforce_validity ( ecx : & InterpretCx < ' a , ' mir , ' tcx , Self > ) -> bool {
380
380
ecx. machine . validate
381
381
}
382
382
383
383
/// Returns `Ok()` when the function was handled; fail otherwise.
384
384
#[ inline( always) ]
385
385
fn find_fn (
386
- ecx : & mut EvalContext < ' a , ' mir , ' tcx , Self > ,
386
+ ecx : & mut InterpretCx < ' a , ' mir , ' tcx , Self > ,
387
387
instance : ty:: Instance < ' tcx > ,
388
388
args : & [ OpTy < ' tcx , Borrow > ] ,
389
389
dest : Option < PlaceTy < ' tcx , Borrow > > ,
@@ -394,7 +394,7 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for Evaluator<'tcx> {
394
394
395
395
#[ inline( always) ]
396
396
fn call_intrinsic (
397
- ecx : & mut rustc_mir:: interpret:: EvalContext < ' a , ' mir , ' tcx , Self > ,
397
+ ecx : & mut rustc_mir:: interpret:: InterpretCx < ' a , ' mir , ' tcx , Self > ,
398
398
instance : ty:: Instance < ' tcx > ,
399
399
args : & [ OpTy < ' tcx , Borrow > ] ,
400
400
dest : PlaceTy < ' tcx , Borrow > ,
@@ -404,7 +404,7 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for Evaluator<'tcx> {
404
404
405
405
#[ inline( always) ]
406
406
fn ptr_op (
407
- ecx : & rustc_mir:: interpret:: EvalContext < ' a , ' mir , ' tcx , Self > ,
407
+ ecx : & rustc_mir:: interpret:: InterpretCx < ' a , ' mir , ' tcx , Self > ,
408
408
bin_op : mir:: BinOp ,
409
409
left : ImmTy < ' tcx , Borrow > ,
410
410
right : ImmTy < ' tcx , Borrow > ,
@@ -413,7 +413,7 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for Evaluator<'tcx> {
413
413
}
414
414
415
415
fn box_alloc (
416
- ecx : & mut EvalContext < ' a , ' mir , ' tcx , Self > ,
416
+ ecx : & mut InterpretCx < ' a , ' mir , ' tcx , Self > ,
417
417
dest : PlaceTy < ' tcx , Borrow > ,
418
418
) -> EvalResult < ' tcx > {
419
419
trace ! ( "box_alloc for {:?}" , dest. layout. ty) ;
@@ -481,7 +481,7 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for Evaluator<'tcx> {
481
481
}
482
482
483
483
#[ inline( always) ]
484
- fn before_terminator ( _ecx : & mut EvalContext < ' a , ' mir , ' tcx , Self > ) -> EvalResult < ' tcx >
484
+ fn before_terminator ( _ecx : & mut InterpretCx < ' a , ' mir , ' tcx , Self > ) -> EvalResult < ' tcx >
485
485
{
486
486
// We are not interested in detecting loops.
487
487
Ok ( ( ) )
@@ -511,7 +511,7 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for Evaluator<'tcx> {
511
511
}
512
512
513
513
fn tag_dereference (
514
- ecx : & EvalContext < ' a , ' mir , ' tcx , Self > ,
514
+ ecx : & InterpretCx < ' a , ' mir , ' tcx , Self > ,
515
515
place : MPlaceTy < ' tcx , Borrow > ,
516
516
mutability : Option < hir:: Mutability > ,
517
517
) -> EvalResult < ' tcx , Scalar < Borrow > > {
@@ -532,7 +532,7 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for Evaluator<'tcx> {
532
532
533
533
#[ inline( always) ]
534
534
fn tag_new_allocation (
535
- ecx : & mut EvalContext < ' a , ' mir , ' tcx , Self > ,
535
+ ecx : & mut InterpretCx < ' a , ' mir , ' tcx , Self > ,
536
536
ptr : Pointer ,
537
537
kind : MemoryKind < Self :: MemoryKinds > ,
538
538
) -> Pointer < Borrow > {
@@ -547,7 +547,7 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for Evaluator<'tcx> {
547
547
548
548
#[ inline( always) ]
549
549
fn retag (
550
- ecx : & mut EvalContext < ' a , ' mir , ' tcx , Self > ,
550
+ ecx : & mut InterpretCx < ' a , ' mir , ' tcx , Self > ,
551
551
kind : mir:: RetagKind ,
552
552
place : PlaceTy < ' tcx , Borrow > ,
553
553
) -> EvalResult < ' tcx > {
@@ -565,14 +565,14 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for Evaluator<'tcx> {
565
565
566
566
#[ inline( always) ]
567
567
fn stack_push (
568
- ecx : & mut EvalContext < ' a , ' mir , ' tcx , Self > ,
568
+ ecx : & mut InterpretCx < ' a , ' mir , ' tcx , Self > ,
569
569
) -> EvalResult < ' tcx , stacked_borrows:: CallId > {
570
570
Ok ( ecx. memory ( ) . extra . borrow_mut ( ) . new_call ( ) )
571
571
}
572
572
573
573
#[ inline( always) ]
574
574
fn stack_pop (
575
- ecx : & mut EvalContext < ' a , ' mir , ' tcx , Self > ,
575
+ ecx : & mut InterpretCx < ' a , ' mir , ' tcx , Self > ,
576
576
extra : stacked_borrows:: CallId ,
577
577
) -> EvalResult < ' tcx > {
578
578
Ok ( ecx. memory ( ) . extra . borrow_mut ( ) . end_call ( extra) )
0 commit comments