-
Notifications
You must be signed in to change notification settings - Fork 180
Closed
Description
I generate code that sometimes results in empty enums. I still would like to be able to derive EnumDiscriminants. The problem is that this generated function cannot be compiled:
impl<'_enum> ::core::convert::From<&'_enum UIPassiveValue> for UIPassive {
#[inline]
fn from(val: &'_enum UIPassiveValue) -> UIPassive {
match val {}
}
}
I don't really know what the most consistent behaviour would be.
I made a draft in this commit
efd6ff7
to make generate the following code:
impl<'_enum> ::core::convert::From<&'_enum UIPassiveValue> for UIPassive {
#[inline]
fn from(val: &'_enum UIPassiveValue) -> UIPassive {
match val { _ => todo!(),}
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels