Closed
Description
I am writing some code that needs to be callable from C. To my understanding enums exposed to the c code should have the trait #[repr(C)], but this seems to cause an issue with the module:
#[repr(C)]
pub enum Okay {
a,
#[derive(TryFromPrimitive)]
#[repr(C)]
pub enum NotOkay {
a,
}
Produces the error:
error: repr(C) doesn't have a well defined size
--> src\lib.rs:124:8
|
124 | #[repr(C)]
| ^
Is there a workaround for this? I tried defining multiple types: #[repr(C,i32)] which appears to have been possible previously: rust-lang/rust#68585
Any help is much appreciated :)
Metadata
Metadata
Assignees
Labels
No labels