We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我的rust版本是1.85.0-nightly
这是书中的写法:
macro_rules! foo { ( $( $outer:ident ( $( $inner:ident ),* ) ; )* ) => { println!("count(outer, 0): $outer repeats {} times", ${count(outer)}); println!("count(inner, 0): The $inner repetition repeats {} times in the outer repetition", ${count(inner, 0)}); println!("count(inner, 1): $inner repeats {} times in the inner repetitions", ${count(inner, 1)}); }; }
这种写法会导致错误
在我添加$后写法正确,可能是因为后面版本语法改了?
修改后的写法:
macro_rules! foo { ( $( $outer:ident ( $( $inner:ident ),* ) ; )* ) => { println!("count(outer, 0): $outer repeats {} times", ${count($outer)}); println!("count(inner, 0): The $inner repetition repeats {} times in the outer repetition", ${count($inner, 0)}); println!("count(inner, 1): $inner repeats {} times in the inner repetitions", ${count($inner, 1)}); }; }
The text was updated successfully, but these errors were encountered:
看了下ignore也有同样问题,需要加$。 再就是length(depth)变成了len(depth) 可能跟新版本变动有关
Sorry, something went wrong.
谢谢你发现的问题。
是的,这些最近变化了: rust-lang/rust#122808 。
我现在更新一下它们。
2508e7c
fix: metavariable 出现变更
d0065eb
close #13 ref: rust-lang/rust#122808 2508e7c
No branches or pull requests
我的rust版本是1.85.0-nightly
这是书中的写法:
这种写法会导致错误
在我添加$后写法正确,可能是因为后面版本语法改了?
修改后的写法:
The text was updated successfully, but these errors were encountered: