Closed
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