]> git.lizzy.rs Git - rust.git/blob - src/test/ui/macros/macro-multiple-matcher-bindings.rs
Add 'compiler/rustc_codegen_gcc/' from commit 'afae271d5d3719eeb92c18bc004bb6d1965a5f3f'
[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() {}