I created a minimal code to reproduce my trouble.
macro_rules! foo {
(i32) => {{ println!("foo!"); }};
($t:ty) => {{ println!("oh..."); }};
}
macro_rules! bar {
($t:ty) => {{ foo!($t); }}
}
fn main() {
foo!(i32);
bar!(i32);
}
This outputs:
foo!
oh...
But I don't know why bar!(i32)
doesn't show foo!
; Invocation of foo!
in bar!
doesn't match the i32
clause in foo!
. My environment is OS X 10.11 and rustc 1.13.0 nightly.
Does anyone know the reason and how I fix in order to show foo!
on bar!(i32)
?