Given this code:
trait Base {
fn a(&self);
fn b(&self);
fn c(&self);
fn d(&self);
}
trait Derived : Base {
fn e(&sel
As of Jun 2017, the status of this "sub-trait coercion" (or "super-trait coercion") is as follows:
coerce_inner(
T
) =U
whereT
is a sub-trait ofU
;
There is also a duplicate issue #5665. Comments there explain what prevent this from being implemented.
+-----+-------------------------------+ | 0- 7|pointer to "drop glue" function| +-----+-------------------------------+ | 8-15|size of the data | +-----+-------------------------------+ |16-23|alignment of the data | +-----+-------------------------------+ |24- |methods of Self and supertraits| +-----+-------------------------------+It doesn't contain a vtable for a super-trait as a subsequence. We have at least to have some tweaks with vtables.
There @typelist says they prepared a draft RFC which looks well-organized, but they look like disappeared after that (Nov 2016).