Skip to content

Expand #[cfg] and #[cfg_attr] left-to-right for consistency with other attributes #83331

Open
@Aaron1011

Description

@Aaron1011

Currently, cfg-stripping is performed before we invoke any proc-macro attributes. This means that #[my_attr] #[cfg(FALSE)] struct Foo {} does not invoke #[my_attr] at all, instead of invoking it with #[cfg(FALSE)] struct Foo {}

See https://github.com/rust-lang/rust/pull/82419/files/fc9d578bc5ada5162f49ed02a547cf87f2456a93#r580718089 for a more detailed example and discussion.

Metadata

Metadata

Assignees

Labels

A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-enhancementCategory: An issue proposing an enhancement or a PR with one.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions