Function rustc_trans::trans::meth::get_vtableExperimental [-]  [+] [src]

pub fn get_vtable<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, box_ty: Ty<'tcx>, trait_ref: Rc<TraitRef<'tcx>>) -> ValueRef

Creates a returns a dynamic vtable for the given type and vtable origin. This is used only for objects.

The trait_ref encodes the erased self type. Hence if we are making an object Foo<Trait> from a value of type Foo<T>, then trait_ref would map T:Trait, but box_ty would be Foo<T>. This box_ty is primarily used to encode the destructor. This will hopefully change now that DST is underway.