要复制的最小代码:
macro_rules! test {
($name:ident: $count:expr) => {
macro_rules! $name {
($($v:expr),*) => {}
}
}
}
test!(yo: 123);
错误:
error: attempted to repeat an expression containing no syntax variables matched as repeating at this depth
--> src/lib.rs:4:15
|
4 | ($($v:expr),*) => {}
| ^^^^^^^^^
删除$count:expr
或将$count:expr
更改为类似$count:block
的其他类型,都会忽略该错误,但我确实需要将其设为expr
。错误是什么意思?