-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Closed
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.T-langRelevant to the language teamRelevant to the language team
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
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.T-langRelevant to the language teamRelevant to the language team