Skip to content
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

Merged
merged 1 commit into from
Jan 3, 2020
Merged

Fix repetition operator mismatch in macro definitions #46

merged 1 commit into from
Jan 3, 2020

Conversation

ia0
Copy link
Contributor

@ia0 ia0 commented Jul 17, 2019

No description provided.

@@ -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),* ))*]
Copy link
Owner

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?

Copy link
Contributor Author

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.

Copy link
Owner

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?

Copy link
Contributor Author

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).

Copy link
Owner

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, thanks!

@tailhook tailhook merged commit e54a0ea into tailhook:master Jan 3, 2020
@ia0 ia0 deleted the rust_issues_61053 branch January 3, 2020 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants