-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.
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
.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.