Open
Description
Consider this:
#[repr(C)]
enum Bar {
A = 0x1_FFFF_FFFF,
}
Assume that the targets native enum size is 4 bytes. Obviously 0x1_FFFF_FFFF
will overflow. This is accepted by the compiler, without warning. Instead it will silently use a larger underlying type.
I think this should be a future incompatibility warning with an eye to making it a hard error in a future edition. Being explicit with, say, repr(u64)
is better than doing so silently (especially with it being incompatible with MSVC). However, any warning would be good if others disagree.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Rejected/Not lang