4 ms·
The important change here appears to be that the internal representation of a vtable is now guaranteed to have its supertraits laid out in some predictable pref
by mmastrac 2y ago
The important change here appears to be that the internal representation of a vtable is now guaranteed to have its supertraits laid out in some predictable prefix form to its own methods.
EDIT: or if this is not possible, a pointer to the appropriate vtable is included. I assume this must be for diamond trait inheritance.
- kibwen 2y ago> the internal representation of a vtable is now guaranteed to have its supertraits laid out in some predictable prefix form to its own methods. Importantly, note that the specifics of the vtable layout are not guaranteed, only the general property that the layout must be amenable to supporting this.
- the_mitsuhiko 2y agoAnd for extra context the RFC lays out the current design and future options: https://github.com/rust-lang/rfcs/blob/master/text/3324-dyn-upcasting.md https://github.com/rust-lang/rfcs/blob/master/text/3324-dyn-...
- nialv7 2y agoIIRC vtable happens to already be laid out the required way (barring some corner cases maybe, correct me if I am wrong), this RFC just made that official. And for diamond patterns vtable entries are duplicated.