strum icon indicating copy to clipboard operation
strum copied to clipboard

Cannot use full-qualified path to trait inside `#[strum_discriminants(derive())]`

Open thomaseizinger opened this issue 6 years ago • 0 comments

When trying to use full-qualified paths for the custom derive, none of the attributes are applied.

For example:

#[allow(dead_code)]
#[derive(Debug, Eq, PartialEq, strum_macros::EnumDiscriminants)]
#[strum_discriminants(name(SplitAttributesBoo), derive(strum_macros::Display))]
#[strum_discriminants(derive(strum_macros::EnumIter))]
enum SplitAttributes {
    Variant0(bool),
    Variant1(i32),
}

I digged a bit into the code and it actually looks like syn doesn't report the full path in that case. I googled around a bit and found a similar problem here: https://github.com/rust-lang/rust/issues/55168

But not sure how relevant that actually is. I created a PR that reproduces the issue here: #54.

thomaseizinger avatar May 23 '19 04:05 thomaseizinger