This code prints out 3. Which is reasonable. Here is the part I am confused on: why is the repr(u8) not throwing an error if L2 has size 3 bytes instead of 1 byte ?
#[repr(u*)] and #[repr(i*)] on enums with field variants are equivalent to making the enum #[repr(C)], where the fieldless enum used as discriminant of the generated union is marked #[repr(u*)] or #[repr(i*)]. You'll still get an error if you define too many variants.
This is correct for #[repr(C,i*)] enums, but #[repr(i*)] enums are a union of #[repr(C)] (discriminant, payload) structures instead. What this means in practice is that #[repr(i*)] enums can be more tightly packed at the expense of having the payload location dependent on the variant: