2019-01-15 16:55:23 -06:00
|
|
|
// Test that duplicate matcher binding names are caught at declaration time, rather than at macro
|
|
|
|
// invocation time.
|
|
|
|
|
2019-01-17 21:19:56 -06:00
|
|
|
#![allow(unused_macros)]
|
|
|
|
|
2019-01-15 16:55:23 -06:00
|
|
|
macro_rules! foo1 {
|
2019-03-28 12:36:13 -05:00
|
|
|
($a:ident, $a:ident) => {}; //~ERROR duplicate matcher binding
|
|
|
|
($a:ident, $a:path) => {}; //~ERROR duplicate matcher binding
|
2019-01-15 16:55:23 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
macro_rules! foo2 {
|
|
|
|
($a:ident) => {}; // OK
|
|
|
|
($a:path) => {}; // OK
|
|
|
|
}
|
|
|
|
|
|
|
|
macro_rules! foo3 {
|
2019-03-28 12:36:13 -05:00
|
|
|
($a:ident, $($a:ident),*) => {}; //~ERROR duplicate matcher binding
|
|
|
|
($($a:ident)+ # $($($a:path),+);*) => {}; //~ERROR duplicate matcher binding
|
2019-01-15 16:55:23 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|