It appears to be smart enough to only use one byte for A, but not smart enough to use one byte for B, even though there are only 8*8=64 possibilities. Is there any way to coax Rust to figure this out or do I have to manually implement a more compact layout?
#![allow(dead_code)]
enum A {
L,
UL,
U,
UR,
R,
DR,
D,
DL,
}
enum B {
C(A, A),
}
fn main() {
println!("{:?}", std::mem::size_of::<A>()); // prints 1
println!("{:?}", std::mem::size_of::<B>()); // prints 2
}