Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
thomaseizinger opened this issue May 23, 2019 · 0 comments

Comments

@thomaseizinger
Copy link

thomaseizinger commented May 23, 2019

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: rust-lang/rust#55168

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants