Open
Description
I tried this code:
#[repr(u8)]
enum Foo {
A = 0,
}
#[repr(u8)]
enum Bar {
A = 1,
}
enum Choice {
F(Foo),
B(Bar),
}
fn main() {
dbg!(core::mem::size_of::<Choice>());
}
I expected to see this happen: Choice
has size 1
Instead, this happened: Choice
has size 2
Meta
Rust version; 1.74.1
@rustbot label A-layout T-compiler