Support repr(C) for rustified enums
TODOs:
- [ ] check enum width as suggested by @emilio in this comment
- [ ] should there be a
--rustified-non-exhaustive-repr-c-enumflag? - [x] Update CHANGELOG.md
Closes #3263.
At the very least we should add a big warning on this option since it'd cause wrong struct layout.
I agree this would be good. However, it appears that LLVM does not expose the necessary APIs. Even if we exposed the necessary functionality, it would presumably only work for recent clang versions. Thoughts on how to proceed?
What do you think of extending our layout tests to test the layout of enums? I think at least that would signal that there's something wrong with the generated code if you misuse this option.
Other than that it looks good.
Our repr(C) layout is actually very likely to be incorrect for many enums and we are considering how to deprecate it because it is very hard to address this.