@@ -21,7 +21,7 @@ use rustc_data_structures::fx::FxHashMap;
2121
2222use super :: {
2323 Immediate , Operand , MemPlace , MPlaceTy , Place , PlaceTy , ScalarMaybeUndef ,
24- Memory , Machine , PointerArithmetic , FnVal , StackPopInfo
24+ Memory , Machine , StackPopInfo
2525} ;
2626
2727pub struct InterpCx < ' mir , ' tcx , M : Machine < ' mir , ' tcx > > {
@@ -86,7 +86,7 @@ pub struct Frame<'mir, 'tcx, Tag=(), Extra=()> {
8686 /// The block that is currently executed (or will be executed after the above call stacks
8787 /// return).
8888 /// If this is `None`, we are unwinding and this function doesn't need any clean-up.
89- /// Just continue the same as with
89+ /// Just continue the same as with `Resume`.
9090 pub block : Option < mir:: BasicBlock > ,
9191
9292 /// The index of the currently evaluated statement.
@@ -563,7 +563,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
563563 /// `cleanup` block for the function, which is responsible for running
564564 /// `Drop` impls for any locals that have been initialized at this point.
565565 /// The cleanup block ends with a special `Resume` terminator, which will
566- /// cause us to continue unwinding where we left off .
566+ /// cause us to continue unwinding.
567567 pub ( super ) fn pop_stack_frame (
568568 & mut self ,
569569 unwinding : bool
@@ -830,25 +830,4 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
830830 trace ! ( "generate stacktrace: {:#?}, {:?}" , frames, explicit_span) ;
831831 frames
832832 }
833-
834- /// Resolve the function at the specified slot in the provided
835- /// vtable. An index of '0' corresponds to the first method
836- /// declared in the trait of the provided vtable
837- pub fn get_vtable_slot (
838- & self ,
839- vtable : Scalar < M :: PointerTag > ,
840- idx : usize
841- ) -> InterpResult < ' tcx , FnVal < ' tcx , M :: ExtraFnVal > > {
842- let ptr_size = self . pointer_size ( ) ;
843- // Skip over the 'drop_ptr', 'size', and 'align' fields
844- let vtable_slot = vtable. ptr_offset ( ptr_size * ( idx as u64 + 3 ) , self ) ?;
845- let vtable_slot = self . memory . check_ptr_access (
846- vtable_slot,
847- ptr_size,
848- self . tcx . data_layout . pointer_align . abi ,
849- ) ?. expect ( "cannot be a ZST" ) ;
850- let fn_ptr = self . memory . get ( vtable_slot. alloc_id ) ?
851- . read_ptr_sized ( self , vtable_slot) ?. not_undef ( ) ?;
852- Ok ( self . memory . get_fn ( fn_ptr) ?)
853- }
854833}
0 commit comments