2019-05-30 10:53:27 +00:00
|
|
|
#![deny(meta_variable_misuse)]
|
|
|
|
|
|
|
|
macro_rules! foo {
|
|
|
|
() => {};
|
|
|
|
($( $i:ident = $($j:ident),+ );*) => { $( $i = $j; )* };
|
2024-06-03 05:17:19 +00:00
|
|
|
//~^ ERROR variable `j` is still repeating
|
2019-05-30 10:53:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
macro_rules! bar {
|
|
|
|
() => {};
|
|
|
|
(test) => {
|
|
|
|
macro_rules! nested {
|
|
|
|
() => {};
|
|
|
|
($( $i:ident = $($j:ident),+ );*) => { $( $i = $j; )* };
|
2024-06-03 05:17:19 +00:00
|
|
|
//~^ ERROR variable `j` is still repeating
|
2019-05-30 10:53:27 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
( $( $i:ident = $($j:ident),+ );* ) => {
|
|
|
|
$(macro_rules! $i {
|
2024-06-03 05:17:19 +00:00
|
|
|
() => { $j }; //~ ERROR variable `j` is still repeating
|
2019-05-30 10:53:27 +00:00
|
|
|
})*
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
foo!();
|
|
|
|
bar!();
|
|
|
|
}
|