Skip to content

Add a rule for attribute macro outline modules - #2310

Merged
traviscross merged 1 commit into
rust-lang:masterfrom
ehuss:attr-macro-mod
Jul 28, 2026
Merged

Add a rule for attribute macro outline modules#2310
traviscross merged 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
@traviscross

Copy link
Copy Markdown
Contributor

Makes sense to me. Thanks @ehuss.

@traviscross
traviscross added this pull request to the merge queue Jul 28, 2026
Merged via the queue into rust-lang:master with commit bec6b5e Jul 28, 2026
6 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants