A proposal to replace Rust's `?Sized` notation with a hierarchy of three traits: `Sized` (statically known size), `DynSized` (runtime-computable size), and `Unsized` (size never knowable). The motivation is unblocking extern types, which require a third category beyond today's sized/unsized split. The post explains why `?Sized` doesn't scale to multiple levels of the same dimension, discusses how the new traits would be used in practice (e.g., `size_of_val` would use `DynSized`, most current `?Sized` uses would become `Unsized`), explores an extension where supertrait bounds can disable the implicit `Sized` default, and considers alternatives including different names and dropping the implicit bound altogether.

11m read timeFrom smallcultfollowing.com
Post cover image
Table of contents
TL;DR: write T: Unsized in place of T: ?Sized (and sometimes T: DynSized )Why do we have a default T: Sized bound in the first place?So why the ?Sized notation?But ? doesn’t scale well to “differences in degree”And ? looks “more magical” than it needs toHow would we use these new traits?Option: Defaults could also be disabled by supertraits?AlternativesConclusion