Commit 01740ac
committed
Initial implementation of enum discrimnant sizing.
Allows an enum with a discriminant to use any of the primitive integer
types to store it. By default the smallest usable type is chosen, but
this can be overridden with an attribute: `#[repr(int)]` etc., or
`#[repr(C)]` to match the target's C ABI for the equivalent C enum.
This commit breaks a few things, due to transmutes that now no longer
match in size, or u8 enums being passed to C that expects int, or
reflection; later commits on this branch fix them.1 parent f1124a2 commit 01740ac
File tree
5 files changed
+252
-77
lines changed- src
- librustc/middle/trans
- test/run-pass
5 files changed
+252
-77
lines changed
0 commit comments