]> git.proxmox.com Git - rustc.git/blob - tests/ui/macros/macro-multiple-matcher-bindings.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / 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() {}