Skip to content
This repository has been archived by the owner on Aug 16, 2021. It is now read-only.

Commit

Permalink
Merge pull request #269 from ia0/rust_issues_61053
Browse files Browse the repository at this point in the history
Fix meta variable misuse
  • Loading branch information
KodrAus authored Jul 30, 2019
2 parents 7e16fd2 + f942424 commit 3714653
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/impl_error_chain_kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ macro_rules! impl_error_chain_kind {
queue [ #[$qmeta:meta] $( $tail:tt )*]
) => {
impl_error_chain_kind!(SORT [$( $def )*]
enum [$( $(#[$emeta])* => $eitem $(( $($etyp),* ))* )*
$(#[$bmeta])* => $bitem: $bmode $(( $($btyp),* ))*]
enum [$(#[$bmeta])* => $bitem: $bmode $(( $($btyp),* ))*]
items [$($( #[$imeta:meta] )*
=> $iitem: $imode [$( $ivar:$ityp ),*] {$( $ifuncs )*} )*
$bitem: $bmode [$( $bvar:$btyp ),*] {} ]
Expand All @@ -103,7 +102,7 @@ macro_rules! impl_error_chain_kind {
) => {
impl_error_chain_kind!(SORT [$( $def )*]
items [$( $(#[$imeta])* => $iitem: $imode [$( $ivar:$ityp ),*] {$( $ifuncs )*} )*]
buf [$( #[$bmeta] )* => $bitem: TUPLE [$( $qvar:$qtyp ),*] ]
buf [$( #[$bmeta] )* => $bitem: TUPLE [$( $qvar:$qtyp ),+] ]
queue [$( $tail )*]
);
};
Expand All @@ -117,7 +116,7 @@ macro_rules! impl_error_chain_kind {
) => {
impl_error_chain_kind!(SORT [$( $def )*]
items [$( $(#[$imeta])* => $iitem: $imode [$( $ivar:$ityp ),*] {$( $ifuncs )*} )*]
buf [$( #[$bmeta] )* => $bitem: STRUCT [$( $qvar:$qtyp ),*] ]
buf [$( #[$bmeta] )* => $bitem: STRUCT [$( $qvar:$qtyp ),+] ]
queue [$( $tail )*]);
};
// Add struct enum-variant, with excess comma - e.g. { descr: &'static str, }
Expand All @@ -130,7 +129,7 @@ macro_rules! impl_error_chain_kind {
) => {
impl_error_chain_kind!(SORT [$( $def )*]
items [$( $(#[$imeta])* => $iitem: $imode [$( $ivar:$ityp ),*] {$( $ifuncs )*} )*]
buf [$( #[$bmeta] )* => $bitem: STRUCT [$( $qvar:$qtyp ),*] ]
buf [$( #[$bmeta] )* => $bitem: STRUCT [$( $qvar:$qtyp ),+] ]
queue [$( $tail )*]);
};
// Add braces and flush always on braces
Expand Down Expand Up @@ -188,7 +187,7 @@ macro_rules! impl_error_chain_kind {
pub enum $name {
$(
$(#[$imeta])*
$iitem $(($( $ttyp ),*))* $({$( $svar: $styp ),*})*,
$iitem $(($( $ttyp ),+))* $({$( $svar: $styp ),*})*,
)*

#[doc(hidden)]
Expand Down Expand Up @@ -217,7 +216,7 @@ macro_rules! impl_error_chain_kind {
) => {
impl_error_chain_kind!(ENUM_DEFINITION [ $($def)* ]
body [$($( #[$imeta] )* => $iitem ($(($( $ttyp ),+))*) {$({$( $svar: $styp ),*})*} )*
$( #[$qmeta] )* => $qitem (($( $qtyp ),*)) {} ]
$( #[$qmeta] )* => $qitem (($( $qtyp ),+)) {} ]
queue [ $($queue)* ]
);
};
Expand Down

0 comments on commit 3714653

Please sign in to comment.