Why casting *mut T to *mut dyn Trait requires T: Sized?

If T is not Sized, then *mut T is a fat pointer (e.g. *mut [u8]) so there is no place to put a second metadata chunk.

Shout-out to Working with Self in dyn-compatible trait objects - #3 by kpreid!

4 Likes