External Publication
Visit Post

For structs that have fields that have only one possible representation, enums should use that field as the discriminant

Rust Internals [Unofficial] June 7, 2026
Source

Actually, now I see your case is even simpler: you don't have padding bytes, you want to use extra bits and not bytes. This is impossible for a similar reasoning, though: some code may take &mut FooDiscriminant and write to it, or read from it and expect it to be one of the variants.

Discussion in the ATmosphere

Loading comments...