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

Panic when parsing struct a(fn(mut self,)); #1147

Closed
loiclec opened this issue Mar 16, 2022 · 0 comments · Fixed by #1148
Closed

Panic when parsing struct a(fn(mut self,)); #1147

loiclec opened this issue Mar 16, 2022 · 0 comments · Fixed by #1148

Comments

@loiclec
Copy link

loiclec commented Mar 16, 2022

Hello,

The following code crashes:

    let x = quote! {
        struct a(fn(mut self,));
    };
    let z: Result<syn::DeriveInput, _> = syn::parse2(x);

The panic message is:

thread 'fuzz::reproduce_failure_1' panicked at 'Punctuated::push_punct: cannot push punctuation if Punctuated is empty or already has trailing punctuation', /Users/loic/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.87/src/punctuated.rs:181:9

I am using syn version 1.0.87 with features "full" and "visit".

@loiclec loiclec changed the title Panic at Punctuated::push_punct when parsing struct a(fn(mut self,)); Panic when parsing struct a(fn(mut self,)); Mar 16, 2022
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 a pull request may close this issue.

1 participant