You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.T-langRelevant to the language team, which will review and decide on the PR/issue.
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
The text was updated successfully, but these errors were encountered:
Okay, so #[repr] on an enum controls the size of the discriminant, not the whole enum. At least #[repr(C)] should warn IMO because #[repr(C)] means "give this thing a defined layout", but that doesn't happen in this case.
Mark-Simulacrum
added
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
labels
Jun 23, 2017
fmease
added
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
and removed
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
labels
Dec 21, 2024
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.T-langRelevant to the language team, which will review and decide on the PR/issue.
This code compiles without error or relevant warning:
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
The text was updated successfully, but these errors were encountered: