mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
29 lines
619 B
Rust
29 lines
619 B
Rust
#![deny(meta_variable_misuse)]
|
|
|
|
macro_rules! foo {
|
|
() => {};
|
|
($( $i:ident = $($j:ident),+ );*) => { $( $i = $j; )* };
|
|
//~^ ERROR variable 'j' is still repeating
|
|
}
|
|
|
|
macro_rules! bar {
|
|
() => {};
|
|
(test) => {
|
|
macro_rules! nested {
|
|
() => {};
|
|
($( $i:ident = $($j:ident),+ );*) => { $( $i = $j; )* };
|
|
//~^ ERROR variable 'j' is still repeating
|
|
}
|
|
};
|
|
( $( $i:ident = $($j:ident),+ );* ) => {
|
|
$(macro_rules! $i {
|
|
() => { $j }; //~ ERROR variable 'j' is still repeating
|
|
})*
|
|
};
|
|
}
|
|
|
|
fn main() {
|
|
foo!();
|
|
bar!();
|
|
}
|