-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Closed
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)T-langRelevant to the language teamRelevant to the language team
Description
Hiya, is there an intentional guarantee that procedural macro attributes are executed outward-in per item? To illustrate (repo):
// attr_* appends a new field to the struct
#[attr_0(u8)]
#[attr_1(u16)]
#[attr_2(u32)]
struct Hello;
#[attr_2(u32)]
#[attr_1(u16)]
#[attr_0(u8)]
struct Hello2;
generates:
struct Hello(u8, u16, u32);
struct Hello2(u32, u16, u8);
That's the behaviour, but I'd like to confirm if I can rely on it (and if it should be documented).
#56058 may be related, but I haven't checked the details whether the "each invocation" is per procedural macro (and potentially losing the order guarantee).
Metadata
Metadata
Assignees
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)T-langRelevant to the language teamRelevant to the language team