]> git.lizzy.rs Git - rust.git/blob - src/test/ui/macros/macro-multiple-matcher-bindings.rs
Sync rust-lang/portable-simd@03f6fbb21e6050da2a05b3ce8f480c020b384916
[rust.git] / src / test / ui / macros / macro-multiple-matcher-bindings.rs
1 // Test that duplicate matcher binding names are caught at declaration time, rather than at macro
2 // invocation time.
3
4 #![allow(unused_macros)]
5
6 macro_rules! foo1 {
7     ($a:ident, $a:ident) => {}; //~ERROR duplicate matcher binding
8     ($a:ident, $a:path) => {};  //~ERROR duplicate matcher binding
9 }
10
11 macro_rules! foo2 {
12     ($a:ident) => {}; // OK
13     ($a:path) => {};  // OK
14 }
15
16 macro_rules! foo3 {
17     ($a:ident, $($a:ident),*) => {}; //~ERROR duplicate matcher binding
18     ($($a:ident)+ # $($($a:path),+);*) => {}; //~ERROR duplicate matcher binding
19 }
20
21 fn main() {}