Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Univariant enums cannot have repr set #10292
In writing bindings for C libraries which feature enums in their API, single-variant enums can and do occur. However, binding these by generating a matching Rust enum with only one variant is not currently possible, as rustc gives
Currently this can be worked-around by adding a dummy variant as shown, but that shouldn't be necessary as it requires handling in consumer code, e.g. matches.
CC @jld who added the very very useful ability to use