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 meta variable misuse #998

Merged
merged 1 commit into from
Jul 28, 2019
Merged

Fix meta variable misuse #998

merged 1 commit into from
Jul 28, 2019

Conversation

ia0
Copy link
Contributor

@ia0 ia0 commented Jul 17, 2019

Rust issue: rust-lang/rust#61053
Rust PR: rust-lang/rust#62008

Reproduce by compiling with a stage2 (or stage1) compiler at the PR given above (set the meta_variable_misuse lint to deny if it's not). The output would look like (only first errors are kept):

error: unknown macro variable `submac2`
   --> src/combinator/macros.rs:660:41
    |
660 |     $crate::combinator::verify($f, |&o| $submac2!(o, $($args)*))($i)
    |                                         ^^^^^^^^
    |
    = note: #[deny(meta_variable_misuse)] on by default

error: meta-variable repeats with different Kleene operator
   --> src/branch/mod.rs:215:75
    |
199 |   ($it:tt, $self:expr, $input:ident, $res:expr, $all_done:expr, $head:ident $($id:ident)+) => ({
    |                                                                                         - expected repetition
...
215 |     succ!($it, permutation_trait_inner!($self, $input, $res, $all_done, $($id)*));
    |                                                                           ^^^ - conflicting repetition

error: unknown macro variable `args`
   --> src/sequence/macros.rs:471:43
    |
471 |   (( $(args:tt)* )) => ( compile_error!($($args)*) );
    |                                           ^^^^^

error: meta-variable repeats with different Kleene operator
   --> src/whitespace.rs:147:67
    |
144 |   ($i:expr, $separator:path, $submac1:ident!( $($args1:tt)* ), $($rest:tt)+) => ({
    |                                                                           - expected repetition
...
147 |     match tuple_sep!($i, $separator, (), $submac1!($($args1)*), $($rest)*) {
    |                                                                   ^^^^^ - conflicting repetition

@Geal
Copy link
Collaborator

Geal commented Jul 28, 2019

wow that PR will really make things easier :)

@ia0 ia0 deleted the rust_issues_61053 branch July 28, 2019 11:53
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