Skip to content

Commit aef7c67

Browse files
committed
Fix repetition operator mismatch in macro definitions
1 parent aadd84f commit aef7c67

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/lib.rs

+6-8
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,6 @@ macro_rules! quick_error {
465465
queue [ #[$qmeta:meta] $( $tail:tt )*]
466466
) => {
467467
quick_error!(SORT [$( $def )*]
468-
enum [$( $(#[$emeta])* => $eitem $(( $($etyp),* ))* )*
469-
$(#[$bmeta])* => $bitem: $bmode $(( $($btyp),* ))*]
470468
items [$($( #[$imeta:meta] )*
471469
=> $iitem: $imode [$( $ivar:$ityp ),*] {$( $ifuncs )*} )*
472470
$bitem: $bmode [$( $bvar:$btyp ),*] {} ]
@@ -483,7 +481,7 @@ macro_rules! quick_error {
483481
) => {
484482
quick_error!(SORT [$( $def )*]
485483
items [$( $(#[$imeta])* => $iitem: $imode [$( $ivar:$ityp ),*] {$( $ifuncs )*} )*]
486-
buf [$( #[$bmeta] )* => $bitem: TUPLE [$( $qvar:$qtyp ),*] ]
484+
buf [$( #[$bmeta] )* => $bitem: TUPLE [$( $qvar:$qtyp ),+] ]
487485
queue [$( $tail )*]
488486
);
489487
};
@@ -497,7 +495,7 @@ macro_rules! quick_error {
497495
) => {
498496
quick_error!(SORT [$( $def )*]
499497
items [$( $(#[$imeta])* => $iitem: $imode [$( $ivar:$ityp ),*] {$( $ifuncs )*} )*]
500-
buf [$( #[$bmeta] )* => $bitem: STRUCT [$( $qvar:$qtyp ),*] ]
498+
buf [$( #[$bmeta] )* => $bitem: STRUCT [$( $qvar:$qtyp ),+] ]
501499
queue [$( $tail )*]);
502500
};
503501
// Add struct enum-variant, with excess comma - e.g. { descr: &'static str, }
@@ -510,7 +508,7 @@ macro_rules! quick_error {
510508
) => {
511509
quick_error!(SORT [$( $def )*]
512510
items [$( $(#[$imeta])* => $iitem: $imode [$( $ivar:$ityp ),*] {$( $ifuncs )*} )*]
513-
buf [$( #[$bmeta] )* => $bitem: STRUCT [$( $qvar:$qtyp ),*] ]
511+
buf [$( #[$bmeta] )* => $bitem: STRUCT [$( $qvar:$qtyp ),+] ]
514512
queue [$( $tail )*]);
515513
};
516514
// Add braces and flush always on braces
@@ -572,7 +570,7 @@ macro_rules! quick_error {
572570
pub enum $name {
573571
$(
574572
$(#[$imeta])*
575-
$iitem $(($( $ttyp ),*))* $({$( $svar: $styp ),*})*,
573+
$iitem $(($( $ttyp ),+))* $({$( $svar: $styp ),*})*,
576574
)*
577575
}
578576
};
@@ -590,7 +588,7 @@ macro_rules! quick_error {
590588
enum $name {
591589
$(
592590
$(#[$imeta])*
593-
$iitem $(($( $ttyp ),*))* $({$( $svar: $styp ),*})*,
591+
$iitem $(($( $ttyp ),+))* $({$( $svar: $styp ),*})*,
594592
)*
595593
}
596594
};
@@ -616,7 +614,7 @@ macro_rules! quick_error {
616614
) => {
617615
quick_error!(ENUM_DEFINITION [ $($def)* ]
618616
body [$($( #[$imeta] )* => $iitem ($(($( $ttyp ),+))*) {$({$( $svar: $styp ),*})*} )*
619-
$( #[$qmeta] )* => $qitem (($( $qtyp ),*)) {} ]
617+
$( #[$qmeta] )* => $qitem (($( $qtyp ),+)) {} ]
620618
queue [ $($queue)* ]
621619
);
622620
};

0 commit comments

Comments
 (0)