Field-dependent trait bounds, or "are auto traits the right model?"

Looks like I hadn't fully considered generic structs when making that note. I'm not 100% convinced just by your concrete example here (but perhaps it's possible to come up with a better one), because that kind of change can be problematic already: The list of directly contained types (without indirection) of a struct is observable in a way that makes adding a field like that technically a breaking change anyways:


struct Recursive(Option<HaplessStruct<Recursive>>);

which will be broken by the library change resulting in

error[E0072]: recursive type `Recursive` has infinite size

on the 1.2.4 version.

To add to the list: the Sized trait is similar to Copy in that the set of Sized types is a subset of the set of types whose fields are all Sized.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.