]>
git.proxmox.com Git - rustc.git/blob - src/test/compile-fail/issue-5067.rs
1 // Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 #![allow(unused_macros)]
15 //~^ ERROR repetition matches empty token tree
17 //~^ ERROR repetition matches empty token tree
19 ( $
(),* ) => {}
; // PASS
20 ( $
(),+ ) => {}
; // PASS
23 //~^ ERROR repetition matches empty token tree
25 //~^ ERROR repetition matches empty token tree
27 ( [$
(),*] ) => {}
; // PASS
28 ( [$
(),+] ) => {}
; // PASS
30 ( $
($
()* $
(),* $
(a
)* $
(a
),* )* ) => {}
;
31 //~^ ERROR repetition matches empty token tree
32 ( $
($
()* $
(),* $
(a
)* $
(a
),* )+ ) => {}
;
33 //~^ ERROR repetition matches empty token tree
35 ( $
(a $
(),* $
(a
)* $
(a
),* )* ) => {}
; // PASS
36 ( $
($
(a
)+ $
(),* $
(a
)* $
(a
),* )+ ) => {}
; // PASS
39 //~^ ERROR repetition matches empty token tree
41 //~^ ERROR repetition matches empty token tree
45 // --- Original Issue --- //
47 macro_rules
! make_vec
{
48 (a $e1
:expr $
($
(, a $e2
:expr
)*)*) => ([$e1 $
($
(, $e2
)*)*]);
49 //~^ ERROR repetition matches empty token tree
53 let _
= make_vec
![a
1, a
2, a
3];
57 // --- Minified Issue --- //
61 //~^ ERROR repetition matches empty token tree