Skip to content

tests/ui/macros: add annotations for reference rules#153482

Open
DanielEScherzer wants to merge 1 commit intorust-lang:mainfrom
DanielEScherzer:test-references-macros
Open

tests/ui/macros: add annotations for reference rules#153482
DanielEScherzer wants to merge 1 commit intorust-lang:mainfrom
DanielEScherzer:test-references-macros

Conversation

@DanielEScherzer
Copy link
Copy Markdown
Contributor

r? ehuss
@rustbot label +A-docs

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools labels Mar 6, 2026
}}
m1!();

foo!(); //~ ERROR `foo` is ambiguous
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

macro_rules! m1 { () => {
macro_rules! foo { () => {} }

#[macro_use] //~ ERROR `macro_two` is already in scope
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filed rust-lang/reference#2207, as I couldn't find a rule for this specifically.

@@ -1,3 +1,4 @@
//@ reference: attributes.derive.behavior
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this test is more closely showing that macro_rules macros are in a different namespace than attributes or derive macros. There is names.namespaces.sub-namespaces.intro which describes the distinction between attribute macros and fn-like macros.

There isn't such a clear-cut description for derive macros, and I'm wondering if the sub-namespace section needs some clarification to include that.

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Mar 25, 2026

☔ The latest upstream changes (presumably #154384) made this pull request unmergeable. Please resolve the merge conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants