Skip to content

Emit error when attempting to both forward and parse an attribute path #336

@TedDriggs

Description

@TedDriggs

Parsing and forwarding an attribute are mutually exclusive behaviors in darling-generated impls. Declaring the same attribute for both will always result in the attribute only being parsed.

Given the following code:

#[derive(FromDeriveInput)]
#[darling(attributes(example), forward_attrs(example, cfg))]
pub struct Receiver {
    attrs: Vec<syn::Attribute>
}

The placement of example in forward_attrs is erroneous. It would be useful if darling generated a compile-time error to flag the mistake.

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