@@ -256,6 +256,7 @@ impl<'a, 'tcx, M: Machine<'tcx>> EvalContext<'a, 'tcx, M> {
256
256
self . dump_local ( ret) ;
257
257
Ok ( ( ) )
258
258
}
259
+ // FIXME: figure out why we can't just go through the shim
259
260
ty:: InstanceDef :: ClosureOnceShim { .. } => {
260
261
let mut args = Vec :: new ( ) ;
261
262
for arg in arg_operands {
@@ -297,6 +298,9 @@ impl<'a, 'tcx, M: Machine<'tcx>> EvalContext<'a, 'tcx, M> {
297
298
}
298
299
Ok ( ( ) )
299
300
}
301
+ ty:: InstanceDef :: FnPtrShim ( ..) |
302
+ ty:: InstanceDef :: DropGlue ( ..) |
303
+ ty:: InstanceDef :: CloneShim ( ..) |
300
304
ty:: InstanceDef :: Item ( _) => {
301
305
let mut args = Vec :: new ( ) ;
302
306
for arg in arg_operands {
@@ -394,47 +398,7 @@ impl<'a, 'tcx, M: Machine<'tcx>> EvalContext<'a, 'tcx, M> {
394
398
}
395
399
Ok ( ( ) )
396
400
}
397
- ty:: InstanceDef :: DropGlue ( ..) => {
398
- assert_eq ! ( arg_operands. len( ) , 1 ) ;
399
- assert_eq ! ( sig. abi, Abi :: Rust ) ;
400
- let val = self . eval_operand ( & arg_operands[ 0 ] ) ?;
401
- let ty = self . operand_ty ( & arg_operands[ 0 ] ) ;
402
- let ( _, target) = destination. expect ( "diverging drop glue" ) ;
403
- self . goto_block ( target) ;
404
- // FIXME: deduplicate these matches
405
- let pointee_type = match ty. sty {
406
- ty:: TyRawPtr ( ref tam) |
407
- ty:: TyRef ( _, ref tam) => tam. ty ,
408
- ty:: TyAdt ( def, _) if def. is_box ( ) => ty. boxed_ty ( ) ,
409
- _ => bug ! ( "can only deref pointer types" ) ,
410
- } ;
411
- self . drop ( val, instance, pointee_type, span)
412
- }
413
- ty:: InstanceDef :: FnPtrShim ( ..) => {
414
- trace ! ( "ABI: {}" , sig. abi) ;
415
- let mut args = Vec :: new ( ) ;
416
- for arg in arg_operands {
417
- let arg_val = self . eval_operand ( arg) ?;
418
- let arg_ty = self . operand_ty ( arg) ;
419
- args. push ( ( arg_val, arg_ty) ) ;
420
- }
421
- if M :: eval_fn_call ( self , instance, destination, arg_operands, span, sig) ? {
422
- return Ok ( ( ) ) ;
423
- }
424
- let arg_locals = self . frame ( ) . mir . args_iter ( ) ;
425
- match sig. abi {
426
- Abi :: Rust => {
427
- args. remove ( 0 ) ;
428
- }
429
- Abi :: RustCall => { }
430
- _ => unimplemented ! ( ) ,
431
- } ;
432
- for ( arg_local, ( arg_val, arg_ty) ) in arg_locals. zip ( args) {
433
- let dest = self . eval_lvalue ( & mir:: Lvalue :: Local ( arg_local) ) ?;
434
- self . write_value ( arg_val, dest, arg_ty) ?;
435
- }
436
- Ok ( ( ) )
437
- }
401
+ // cannot use the shim here, because that will only result in infinite recursion
438
402
ty:: InstanceDef :: Virtual ( _, idx) => {
439
403
let ptr_size = self . memory . pointer_size ( ) ;
440
404
let ( _, vtable) = self . eval_operand ( & arg_operands[ 0 ] ) ?. into_ptr_vtable_pair (
0 commit comments