Skip to content

Deriving EnumTryAs on an enum with field attributes produces unparsable tokens #399

@phsym

Description

@phsym

Deriving EnumTryAs on an enum with field attributes like

#[derive(EnumTryAs)]
enum Foo {
    Unnamed(#[allow(deprecated)] SomeType),
}

fails with the following errors :

error: proc-macro derive produced unparsable tokens
 --> strum_tests/tests/enum_try_as.rs:5:10
  |
5 | #[derive(EnumTryAs)]
  |          ^^^^^^^^^
error: expected type, found `#`
 --> strum_tests/tests/enum_try_as.rs:7:12
  |
7 |     Unamed(#[allow(deprecated)] SomeType),
  |            ^ expected type

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions