Skip to content

Tracking issue for macro attributes in #[derive] output #81119

@petrochenkov

Description

@petrochenkov

This is a tracking issue for macro attributes that can observe output of the #[derive] attribute.
This includes macro attributes on the same item as #[derive] but below it, and macro attributes on nested nodes of the item with #[derive].

#[derive] fully configures its input, eagerly evaluating cfgs everywhere in its target, for example on fields.
Attributes expanded after the #[derive] will see the item in this fully configured form, but we don't want expose it to them on stable channel for now.

Example:

#[derive(Trait)]
#[my_attr] // Gated
struct S1 {
    field: [u8; 10],
}

#[derive(Trait)]
struct S2 {
    field: [u8; #[my_attr] 10], // Gated
}

The feature name is macro_attributes_in_derive_output.
The feature gate was introduced in #79078.

Metadata

Metadata

Assignees

Labels

A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions