mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
29 lines
614 B
Rust
29 lines
614 B
Rust
#![deny(meta_variable_misuse)]
|
|
|
|
macro_rules! foo {
|
|
() => {};
|
|
($( $i:ident = $($j:ident),+ );*) => { $( $( $i = $k; )+ )* };
|
|
//~^ ERROR unknown macro variable
|
|
}
|
|
|
|
macro_rules! bar {
|
|
() => {};
|
|
(test) => {
|
|
macro_rules! nested {
|
|
() => {};
|
|
($( $i:ident = $($j:ident),+ );*) => { $( $( $i = $k; )+ )* };
|
|
//~^ ERROR unknown macro variable
|
|
}
|
|
};
|
|
( $( $i:ident = $($j:ident),+ );* ) => {
|
|
$(macro_rules! $i {
|
|
() => { $( $i = $k)+ }; //~ ERROR unknown macro variable
|
|
})*
|
|
};
|
|
}
|
|
|
|
fn main() {
|
|
foo!();
|
|
bar!();
|
|
}
|