3 ms·
Reposting: https://cheats.rs/#memory-layout https://cheats.rs/#memory-layout > Does the value take up the same width regardless of state? Yes. As the other co
by goku12 3y ago
Reposting: https://cheats.rs/#memory-layout https://cheats.rs/#memory-layout
> Does the value take up the same width regardless of state?
Yes. As the other commenter mentioned, it's the size of the largest variant (same as a union in C) + a tag (almost the same as an enum in C). In some rare cases, the compiler even manages to optimize out the tag.