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
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.
The text was updated successfully, but these errors were encountered:
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 new
CStyleEnumDef
struct that I just added.The text was updated successfully, but these errors were encountered: