Skip to content

Conversation

@ChayimFriedman2
Copy link
Contributor

This is not documented (and I discovered that from experimenting and looking at the compiler's source code), but cfg_attrs on the same level as the attribute macro should be processed before it is expanded. cfg_attrs below should not (and this is contrary to what happens with derive macros, where both should be processed).

Fixes #19121.

This is not documented (and I discovered that from experimenting and looking at the compiler's source code), but cfg_attrs *on the same level* as the attribute macro should be processed before it is expanded. cfg_attrs *below* should not (and this is contrary to what happens with derive macros, where both should be processed).
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 9, 2025
@Veykril Veykril added this pull request to the merge queue Feb 12, 2025
Merged via the queue into rust-lang:master with commit b636cf9 Feb 12, 2025
9 checks passed
@ChayimFriedman2 ChayimFriedman2 deleted the cfg-attr-fast branch February 12, 2025 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

macro-error: the self argument is only allowed for functions in impl blocks.

3 participants