Fix meta variable misuse#269
Fix meta variable misuse#269KodrAus merged 1 commit intorust-lang-deprecated:masterfrom ia0:rust_issues_61053
Conversation
|
Hi @ia0, are you able to give a quick summary of what this PR is all about and whether it's likely to break anything? |
|
Hi @KodrAus, |
| queue [ #[$qmeta:meta] $( $tail:tt )*] | ||
| ) => { | ||
| impl_error_chain_kind!(SORT [$( $def )*] | ||
| enum [$( $(#[$emeta])* => $eitem $(( $($etyp),* ))* )* |
There was a problem hiding this comment.
error: unknown macro variable `emeta`
--> src/impl_error_chain_kind.rs:88:26
|
88 | enum [$( $(#[$emeta])* => $eitem $(( $($etyp),* ))* )*
| ^^^^^^
error: unknown macro variable `eitem`
--> src/impl_error_chain_kind.rs:88:39
|
88 | enum [$( $(#[$emeta])* => $eitem $(( $($etyp),* ))* )*
| ^^^^^^
error: unknown macro variable `etyp`
--> src/impl_error_chain_kind.rs:88:52
|
88 | enum [$( $(#[$emeta])* => $eitem $(( $($etyp),* ))* )*
| ^^^^^
Someone familiar with the code should be able to decide how to fix this error:
- Either remove the whole rule because it is never reached (most probable actually).
- Or adapt the right-hand side of the rule such that it does not reference unbound meta-variables (that's what I tried to do).
- Or adapt the left-hand side of the rule such that it binds
$emeta,$eitem, and$etyp.
| ) => { | ||
| impl_error_chain_kind!(SORT [$( $def )*] | ||
| items [$( $(#[$imeta])* => $iitem: $imode [$( $ivar:$ityp ),*] {$( $ifuncs )*} )*] | ||
| buf [$( #[$bmeta] )* => $bitem: TUPLE [$( $qvar:$qtyp ),*] ] |
There was a problem hiding this comment.
All following errors are similar to this one, so I'm just providing the output for this error.
error: meta-variable repeats with different Kleene operator
--> src/impl_error_chain_kind.rs:106:55
|
102 | queue [($( $qvar:ident: $qtyp:ty ),+) $( $tail:tt )*]
| - expected repetition
...
106 | buf [$( #[$bmeta] )* => $bitem: TUPLE [$( $qvar:$qtyp ),*] ]
| ^^^^^ - conflicting repetition
KodrAus
left a comment
There was a problem hiding this comment.
Thanks for the explanation @ia0!
Ok, this looks good to me. While I'm not deeply familiar with these macros I know we've got a pretty reasonable test suite here so will trust it to have caught any regressions that might've come about.
No description provided.