-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
subenum permits adding derives that aren't permissible on the parent, but it appears there's no way to exclude derives that aren't applicable to the child.
In particular, I want to be able to have an enum with a num_enum "catchall" enabling FromPrimitive, but a sub-enum that only contains unit variants:
#[repr(u32)]
#[subenum(OnlyUnit(derive(TryFromPrimitive)))]
#[derive(FromPrimitive)]
enum Foo {
Bar = 1,
Baz = 2,
#[num_enum(catch_all)]
Unknown(u32),
}
That is, I want OnlyUnit to contain Bar and Baz but not Unknown, making it non-exhaustive, which prevents deriving num_enum::FromPrimitive.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels