Open
Description
In this program:
#![feature(decl_macro)]
mod foo1 {
pub macro foo() {}
}
mod foo2 {
pub macro bar() {
foo!();
}
}
mod foo3 {
fn bar() {
crate::foo2::bar!();
}
use crate::foo1::foo;
}
The compilation output is:
error: cannot find macro `foo` in this scope
--> src/lib.rs:9:9
|
9 | foo!();
| ^^^
...
16 | crate::foo2::bar!();
| -------------------- in this macro invocation
|
= note: consider importing this macro:
crate::foo3::foo
= note: this error originates in the macro `crate::foo2::bar` (in Nightly builds, run with -Z macro-backtrace for more info)
However the hint is wrong - crate::foo3::foo
is inaccessible to foo2
. The correct hint should be suggesting crate::foo1::foo
.