Closed
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).