mem-markers icon indicating copy to clipboard operation
mem-markers copied to clipboard

Should deriving `InvariantFree` require that a structs fields are the same pub level as the struct?

Open rylev opened this issue 4 years ago • 1 comments

Since InvariantFree types are meant to represent types without invariants, it should reason that all the fields of the type should be accessible. Should we require that a structs fields are the same visibility level as the struct itself?

rylev avatar May 25 '20 14:05 rylev

No, it should be fine for the fields to be more private than the struct. There doesn't seem to be any reason to make this restriction.

RustyYato avatar May 25 '20 19:05 RustyYato