@@ -5,7 +5,7 @@ use rustc::mir::interpret::{
5
5
} ;
6
6
use rustc:: ty:: Const ;
7
7
use rustc_mir:: interpret:: {
8
- InterpretCx , ImmTy , Machine , Memory , MemoryKind , OpTy , PlaceTy ,
8
+ InterpCx , ImmTy , Machine , Memory , MemoryKind , OpTy , PlaceTy ,
9
9
StackPopCleanup ,
10
10
} ;
11
11
@@ -141,10 +141,11 @@ fn trans_const_place<'a, 'tcx: 'a>(
141
141
) -> CPlace < ' tcx > {
142
142
// Adapted from https://github.com/rust-lang/rust/pull/53671/files#diff-e0b58bb6712edaa8595ad7237542c958L551
143
143
let result = || -> InterpResult < ' tcx , & ' tcx Allocation > {
144
- let mut ecx = InterpretCx :: new (
144
+ let mut ecx = InterpCx :: new (
145
145
fx. tcx . at ( DUMMY_SP ) ,
146
146
ty:: ParamEnv :: reveal_all ( ) ,
147
147
TransPlaceInterpreter ,
148
+ ( ) ,
148
149
) ;
149
150
ecx. push_stack_frame (
150
151
fx. instance ,
@@ -242,7 +243,7 @@ fn define_all_allocs(
242
243
module : & mut Module < impl Backend > ,
243
244
cx : & mut ConstantCx ,
244
245
) {
245
- let memory = Memory :: < TransPlaceInterpreter > :: new ( tcx. at ( DUMMY_SP ) ) ;
246
+ let memory = Memory :: < TransPlaceInterpreter > :: new ( tcx. at ( DUMMY_SP ) , ( ) ) ;
246
247
247
248
while let Some ( todo_item) = pop_set ( & mut cx. todo ) {
248
249
let ( data_id, alloc) = match todo_item {
@@ -338,23 +339,25 @@ struct TransPlaceInterpreter;
338
339
339
340
impl < ' mir , ' tcx > Machine < ' mir , ' tcx > for TransPlaceInterpreter {
340
341
type MemoryKinds = !;
342
+ type ExtraFnVal = !;
341
343
type PointerTag = ( ) ;
342
344
type AllocExtra = ( ) ;
343
345
type MemoryExtra = ( ) ;
344
346
type FrameExtra = ( ) ;
345
347
type MemoryMap = FxHashMap < AllocId , ( MemoryKind < !> , Allocation < ( ) > ) > ;
348
+
346
349
const STATIC_KIND : Option < !> = None ;
347
350
348
- fn enforce_validity ( _: & InterpretCx < ' mir , ' tcx , Self > ) -> bool {
351
+ fn enforce_validity ( _: & InterpCx < ' mir , ' tcx , Self > ) -> bool {
349
352
false
350
353
}
351
354
352
- fn before_terminator ( _: & mut InterpretCx < ' mir , ' tcx , Self > ) -> InterpResult < ' tcx > {
355
+ fn before_terminator ( _: & mut InterpCx < ' mir , ' tcx , Self > ) -> InterpResult < ' tcx > {
353
356
panic ! ( ) ;
354
357
}
355
358
356
359
fn find_fn (
357
- _: & mut InterpretCx < ' mir , ' tcx , Self > ,
360
+ _: & mut InterpCx < ' mir , ' tcx , Self > ,
358
361
_: Instance < ' tcx > ,
359
362
_: & [ OpTy < ' tcx > ] ,
360
363
_: Option < PlaceTy < ' tcx > > ,
@@ -364,7 +367,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for TransPlaceInterpreter {
364
367
}
365
368
366
369
fn call_intrinsic (
367
- _: & mut InterpretCx < ' mir , ' tcx , Self > ,
370
+ _: & mut InterpCx < ' mir , ' tcx , Self > ,
368
371
_: Instance < ' tcx > ,
369
372
_: & [ OpTy < ' tcx > ] ,
370
373
_: PlaceTy < ' tcx > ,
@@ -373,43 +376,53 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for TransPlaceInterpreter {
373
376
}
374
377
375
378
fn find_foreign_static (
379
+ _: TyCtxt < ' tcx > ,
376
380
_: DefId ,
377
- _: :: rustc:: ty:: query:: TyCtxtAt < ' tcx > ,
378
381
) -> InterpResult < ' tcx , Cow < ' tcx , Allocation > > {
379
382
panic ! ( ) ;
380
383
}
381
384
382
385
fn ptr_op (
383
- _: & InterpretCx < ' mir , ' tcx , Self > ,
386
+ _: & InterpCx < ' mir , ' tcx , Self > ,
384
387
_: mir:: BinOp ,
385
388
_: ImmTy < ' tcx > ,
386
389
_: ImmTy < ' tcx > ,
387
390
) -> InterpResult < ' tcx , ( Scalar , bool ) > {
388
391
panic ! ( ) ;
389
392
}
390
393
391
- fn box_alloc ( _: & mut InterpretCx < ' mir , ' tcx , Self > , _: PlaceTy < ' tcx > ) -> InterpResult < ' tcx > {
394
+ fn box_alloc ( _: & mut InterpCx < ' mir , ' tcx , Self > , _: PlaceTy < ' tcx > ) -> InterpResult < ' tcx > {
392
395
panic ! ( ) ;
393
396
}
394
397
395
398
fn tag_allocation < ' b > (
399
+ _: & ( ) ,
396
400
_: AllocId ,
397
401
alloc : Cow < ' b , Allocation > ,
398
402
_: Option < MemoryKind < !> > ,
399
- _: & Memory < ' mir , ' tcx , Self > ,
400
403
) -> ( Cow < ' b , Allocation < ( ) , ( ) > > , ( ) ) {
401
404
( alloc, ( ) )
402
405
}
403
406
404
- fn tag_static_base_pointer ( _: AllocId , _: & Memory < ' mir , ' tcx , Self > ) -> Self :: PointerTag {
407
+ fn tag_static_base_pointer ( _: & ( ) , _: AllocId ) -> Self :: PointerTag {
405
408
( )
406
409
}
407
410
408
- fn stack_push ( _: & mut InterpretCx < ' mir , ' tcx , Self > ) -> InterpResult < ' tcx > {
411
+ fn call_extra_fn (
412
+ _: & mut InterpCx < ' mir , ' tcx , Self > ,
413
+ _: !,
414
+ _: & [ OpTy < ' tcx , ( ) > ] ,
415
+ _: Option < PlaceTy < ' tcx , ( ) > > ,
416
+ _: Option < BasicBlock > ,
417
+ ) -> InterpResult < ' tcx > {
418
+ unreachable ! ( ) ;
419
+ }
420
+
421
+ fn stack_push ( _: & mut InterpCx < ' mir , ' tcx , Self > ) -> InterpResult < ' tcx > {
409
422
Ok ( ( ) )
410
423
}
411
424
412
- fn stack_pop ( _: & mut InterpretCx < ' mir , ' tcx , Self > , _: ( ) ) -> InterpResult < ' tcx > {
425
+ fn stack_pop ( _: & mut InterpCx < ' mir , ' tcx , Self > , _: ( ) ) -> InterpResult < ' tcx > {
413
426
Ok ( ( ) )
414
427
}
415
428
}
0 commit comments