Closed
Description
#![allow(non_camel_case_types)]
mod m {
macro_rules! _foo {
($x:ident) => { type $x = u64; }
}
pub(crate) use _foo as foo;
}
m::foo!(foo);
use foo as bar;
fn f() -> bar { 0 }
fn b() -> foo { 0 }
fn main() {
let _a = f(); // _a : {unknown}
let _b = b(); // _b: u64
}
It is because use foo as bar
is resolved before expansion of m::foo!(foo)
, and we didn't rewrite the aliased PerNs
of bar
. Note that legacy macro invocation (i.e. unquatified identifier like foo!
) is not affected, because it is expanded before any item resolutions.
Metadata
Metadata
Assignees
Labels
No labels