Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Censor cfg_attr for attribute macros #19125

Merged
merged 1 commit into from
Feb 12, 2025

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