Skip to content

vagueness about "add additional attributes" in macro.proc.derive.attributes #1760

Open
@workingjubilee

Description

@workingjubilee

Derive macros can add additional attributes into the scope of the item they are on. Said attributes are called derive macro helper attributes. These attributes are inert, and their only purpose is to be fed into the derive macro that defined them. That said, they can be seen by all macros.

When it says a derive macro can "add additional attributes into the scope", it does not make it very clear that it allows these helper attributes to be used in the scope. Instead, the way it is worded suggests the derive macro can mutate its input TokenStream, which as far as I am aware is not the case. I believe derive macros are "pure"... with respect to their TokenStream, anyway.

...also "add additional" anything seems slightly repetitive, but that's relatively minor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-proc-macroArea: proc-macrosLanguage CleanupImprovements to existing language which is correct but not clear, or missing examples, or the like.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions