Open
Description
I tried this code:
mod a {
pub fn f() {
hello!("from a::f");
}
}
macro_rules! hello {
($x:expr) => {
println!("Hello {}!", $x);
}
}
fn main() {
a::f();
hello!("from main");
}
I expected to see this happen:
"You have a use of an undefined macro. I found a macro definition with the same name later in the module hierarchy. I suggest you move the macro definition so that it appears before the mod a
in the module hierarchy, like so: ..."
Instead, this happened:
error: cannot find macro `hello` in this scope
--> src/main.rs:3:9
|
3 | hello!("from a::f");
| ^^^^^
|
= help: have you added the `#[macro_use]` on the module/import?
error: aborting due to previous error
(where the help here does not actually address the problem.)
Version info
Nightly channel
Build using the Nightly version: 1.50.0-nightly
(2020-11-23 d9a105f)
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: Name/path resolution done by `rustc_resolve` specificallyCategory: An issue proposing an enhancement or a PR with one.Relevant to the compiler team, which will review and decide on the PR/issue.