Closed
Description
This code compiles without error or relevant warning:
#[repr(C)]
enum Foo { A { x: i32 }, B(i32), C }
#[repr(i32)]
enum Bar { Bar(i32), Baz(u32) }
But obviously the representation of the enum is still going to be undefined, and not integral or C-compatible (trivially checked by mem::size_of
in this case).
There should be an error (probably infeasible) or at least a lint that is on by default.
@Aatch says there is already an issue about this, but I can't find it, so feel free to close as a duplicate if you can find it :)
cc @niconii