Skip to content

Section on proc macros is out of date #856

Closed
@camelid

Description

@camelid

The section on function-like procedural macros says (emphasis mine):

Function-like procedural macros may expand to a type or any number of items, including macro_rules definitions. They may be invoked in a type expression, item position (except as a statement), including items in extern blocks, inherent and trait implementations, and trait definitions. They cannot be used in a statement, expression, or pattern.

However, as of Rust 1.45, function-like procedural macros can be used in statement, expression, and pattern positions. (It was introduced in rust-lang/rust#68717.)

Cc https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/docs.3A.20proc.20macro.20in.20expression

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions