pub fn vtable_prefix_traits<'tcx>(
tcx: TyCtxt<'tcx>,
key: TraitRef<'tcx>,
) -> Vec<ExistentialTraitRef<'tcx>>Expand description
Returns the traits that are prefixes of this vtable, such that upcasting to these traits reuses the vtable pointer unchanged.
For a trait Foo: A + B, the methods for A are stored as a prefix to the vtable for Foo.
If B has no methods, it is also part of this prefix (although it takes up no space).
This function returns the full set of these traits (A might have its own supertrait, etc.). The input trait is the last element of the output vector.