{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreichcanygwergja5cvac3wm5jyahwrbm3z5gwsc4nylzlp7ugrjsgu",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mnqiitju3yi2"
},
"path": "/t/for-structs-that-have-fields-that-have-only-one-possible-representation-enums-should-use-that-field-as-the-discriminant/24382#post_3",
"publishedAt": "2026-06-07T23:34:02.000Z",
"site": "https://internals.rust-lang.org",
"textContent": "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.",
"title": "For structs that have fields that have only one possible representation, enums should use that field as the discriminant"
}