Lymia / enumset

A library for compact bit sets containing enums.
Apache License 2.0
91 stars 35 forks source link

EnumSetType derive on newtype? #7

Closed eikesr closed 5 years ago

eikesr commented 5 years ago

I expected this to work. Am I doing something wrong?

#[derive(EnumSetType)]                                              
pub struct MyAwesomeEnum(foo::my_enum);      
Lymia commented 5 years ago

Unfortunately, since custom derives work on the syntax level, there'd be no way to make this work, unless EnumSetType is already derived on foo::my_enum (in which case, why not use it directly?). #[derive(EnumSetType)] needs to read the actual definition of the enum to properly implement the trait.