minirust
minirust copied to clipboard
Initial ideas for Trait Objects and VTables
This PR contains some of the provisional changes and open questions for Trait Objects and VTables.
This is the first move towards the extension goals of my project.
I think it makes sense to do trait objects before moving to unsized structs, since they are only complicated for trait object tails and therefore any work ignoring them will be in vain.
Separately, a refactor of SizeStrategy
to SizeAndAlignStrategy
will needed. Further though is needed, but I agree that separate Align and Size strategies do not work for unsized structs with trait object tails, as the size requires knowing the align. Therefore again, to avoid unnecessary work, this refactor will already target this usecase.
This PR isn't really intended to be merged, but to give a nice playground to discuss this idea in future meetings.