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)
I tried this code:
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 ain the module hierarchy, like so: ..."Instead, this happened:
(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)