struct A {
x: i64,
}
macro_rules! foo {
($T:ty) => {
fn test() -> $T {
$T { x: 3 }
}
}
}
foo!(A);
error: expected expression, found `A`
8 | $T { x: 3 }
我知道我可以使用 ident
,但是我不明白为什么不能使用$T {}
。