-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyC-bugCategory: This is a bug.Category: This is a bug.S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueStatus: A Minimal Complete and Verifiable Example has been found for this issueregression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Milestone
Description
Code
I tried this code:
mod module {
#![doc = foo!()]
macro_rules! foo {() => (
""
)}
}
I expected to see this happen:
✅
Instead, this happened:
error: cannot find macro `foo` in this scope
--> src/lib.rs:2:14
|
2 | #![doc = foo!()]
| ^^^ consider moving the definition of `foo` before this call
|
note: a macro with the same name exists, but it appears later at here
--> src/lib.rs:4:18
|
4 | macro_rules! foo {
| ^^^
Remark
Note that this problem still does not occur at the top-most level.
That is, removing mod module {
above makes it work:
#![doc = foo!()]
macro_rules! foo {() => (
""
)}
Version it worked on
It most recently worked on: +nightly-2024-04-27
Version with regression
rustc --version --verbose
:
+nightly-2024-04-28
@rustbot modify labels: +regression-from-stable-to-nightly -regression-untriaged
Metadata
Metadata
Assignees
Labels
A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyC-bugCategory: This is a bug.Category: This is a bug.S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueStatus: A Minimal Complete and Verifiable Example has been found for this issueregression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.