Skip to content

Support parsing arms of cfg_select!{} #1977

@dgarrett

Description

@dgarrett

syn::Arm almost allows parsing the arms of cfg_select, except that it expects a Pat for each arm which doesn't allow for the cfg predicates that cfg_select expects.

Would you be open to supporting parsing these cfg_select arms? Either by modifying syn::Arm to encompass them, or through an additional type? I'd be glad to implement this, but I just wanted to check if you'd consider this in-scope for syn.

(Technically cfg_select does already parse, since it can be treated as a regular macro. But I need to parse into the arms as well for my use-case.)

cfg_select: https://doc.rust-lang.org/beta/std/macro.cfg_select.html

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