Open Rua opened 3 months ago
The compiler doesn't guarantee that None
has a tag value of 0 when it has a separately stored tag.
In practice, in current rust, i believe this is what would occur, but it would only be by coincidence, not a stability promise.
Currently,
Option<NonZeroI32>
implementsZeroable
, butOption<i32>
does not. Would it be sound to implementZeroableInOption
for allZeroable
types? Since zero maps toNone
in a regular option, this would always produce a valid value wouldn't it?