Skip to content

Add a rule for attribute macro outline modules#2310

Open
ehuss wants to merge 1 commit into
rust-lang:masterfrom
ehuss:attr-macro-mod
Open

Add a rule for attribute macro outline modules#2310
ehuss wants to merge 1 commit into
rust-lang:masterfrom
ehuss:attr-macro-mod

Conversation

@ehuss

@ehuss ehuss commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

rust-lang/rust#157857 stabilized the ability to use #[my macro] mod foo;. The reference never specified that this was not allowed, so it doesn't absolutely need to be changed for this. However, since this was something that the lang team considered deeply enough on its own, it seems worthy to be explicit about this behavior.

This is an alternative to #2284. Since we already have a rule that specifies where the attributes are allowed, this follows more closely to that to specify the behavior when applied to one of these module items.

rust-lang/rust#157857 stabilized the ability to
use `#[my macro] mod foo;`. The reference never specified that this was
not allowed, so it doesn't absolutely need to be changed for this.
However, since this was something that the lang team considered deeply
enough on its own, it seems worthy to be explicit about this behavior.
@rustbot rustbot added the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: The marked PR is awaiting review from a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants