Skip to content

Clarify macro_export path-based scope example comments - #2367

Open
SatvikMishra08 wants to merge 1 commit into
rust-lang:masterfrom
SatvikMishra08:fix/1789-macro-path-comment
Open

SatvikMishra08 wants to merge 1 commit into
rust-lang:masterfrom
SatvikMishra08:fix/1789-macro-path-comment

Conversation

@SatvikMishra08

@SatvikMishra08 SatvikMishra08 commented Sep 27, 2026 •

Copy link
Copy Markdown

Summary

Verified against the language (rustc): both self::m!() and bare m!() at the crate root are intentional once #[macro_export] places m in the crate root. Nested self::m!() / bare m!() fail; crate::m!() works.

This updates the example comments to say crate root (matching the surrounding prose and @ehuss’s note on #1789) and to state that the unqualified call is also expected — rather than deleting a correct line.

Test plan

  • Confirmed both invocations compile at crate root; bare/self:: fail inside a nested module without a path to the crate root
  • Diff is comments-only in the macro_export example

Fixes #1789

Both `self::m!()` and bare `m!()` at the crate root are intentional:
`#[macro_export]` places the macro in the crate root. Clarify that in
the example comments (crate root, not "current module") so the
unqualified call is not mistaken for a typo.

Fixes rust-lang#1789
@rustbot rustbot added the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Sep 27, 2026

This branch has not been deployed

No deployments
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.

Typo? 3.1. Macros By Example / Path-Based Scope: m!(); // OK: Path-based lookup

2 participants