]> git.lizzy.rs Git - rust.git/blob - tests/ui/macros/macro-multiple-matcher-bindings.rs
Rollup merge of #106973 - oli-obk:tait_ice_closure_in_impl_header, r=lcnr
[rust.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() {}