Right now, the TypeInfo doesn't accurately reflect the static type of C-style enums.
In Rust, (unlike C), enums can only accept a restricted subset of values.
For example, given the enum definition:
#[repr(u32)]
enum Test {
One = 1,
Two = 2,
Three = 4,
}
/*
* Rust: UNDEFINED BEHAVIOR
* C: This is fine
*/
std::mem::transmute::<u32, Test>(12)
Right now, Test::TYPE_INFO == u32::TYPE_INFO as if we were using the C representation. This is misleading,
and should be fixed to use the new CStyleEnumDef struct that I just added.
Right now, the
TypeInfo
doesn't accurately reflect the static type of C-style enums.In Rust, (unlike C), enums can only accept a restricted subset of values. For example, given the enum definition:
Right now,
Test::TYPE_INFO == u32::TYPE_INFO
as if we were using the C representation. This is misleading, and should be fixed to use the newCStyleEnumDef
struct that I just added.