For what it’s worth, the original intent for
#[repr(C)] was to match the base type that a C compiler for the same target would use for a corresponding C
enum, assuming that explicitly ABI-breaking flags like
-fshort-enums are not used. (This actually predates
structs.) I spent some time going through ABI specs when I was writing the original discriminant size selection to try to ensure that would hold for the targets that were supported at the time, but it might not have been kept up-to-date.
As for the problem with impossible values: yes, that’s a problem. Maybe
#[repr(C)] was never the right way to handle this, but that’s a topic for another thread.
In any case, I agree that “C-like” is a bad way to describe this just because it’s opaque to people who don’t know C.