Skip to content

Macro Guide: Invocation syntax section doesn't describe fragment specifier used in introductory example #19554

Description

@cdouglass

Section 2.0, describing invocation syntax, describes the fragment specifiers ident, expr, ty, pat, and block. It would be helpful if it mentioned path as well since that's used in the introductory example:

macro_rules! early_return(
    ($inp:expr $sp:path) => ( // invoke it like `(input_5 SpecialE)`
        match $inp {
            $sp(x) => { return x; }
            _ => {}
        }
    );
)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions