-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix repetition operator mismatch in macro definitions #46
Conversation
@@ -465,8 +465,6 @@ macro_rules! quick_error { | |||
queue [ #[$qmeta:meta] $( $tail:tt )*] | |||
) => { | |||
quick_error!(SORT [$( $def )*] | |||
enum [$( $(#[$emeta])* => $eitem $(( $($etyp),* ))* )* | |||
$(#[$bmeta])* => $bitem: $bmode $(( $($btyp),* ))*] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand this deletion. Is this just the unused code that sneaked into the codebase?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not familiar with the code, but this rule is very broken. Here is a similar fix: https://github.com/rust-lang-nursery/error-chain/pull/269/files#r305615630. Ideally, someone who understands the code should review this. I'm also fine just reverting the pull request if it can't be reviewed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aha, this is left from @colin-kiegel's simplification commit: 94f0680
The code that matches that rule is:
pub enum Test {
#[cfg(feature = "foo")]
Variant1
#[cfg(feature = "foo")]
Variant2
}
Will try to fix it soon.
How did you find these issues?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice find!
I've found those issues with a crater run when adding the meta_variable_misuse
lint. You can try it with #![deny(meta_variable_misuse)]
(or warn
instead of deny
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Thanks! I'm going to merge it as is and tackle the bug afterwards.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanks!
No description provided.