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

Infinite loop with syn::parse_str::<syn::Expr>("q^0:"); #978

Closed
catenacyber opened this issue Mar 24, 2021 · 1 comment · Fixed by #1002
Closed

Infinite loop with syn::parse_str::<syn::Expr>("q^0:"); #978

catenacyber opened this issue Mar 24, 2021 · 1 comment · Fixed by #1002

Comments

@catenacyber
Copy link

You can reproduce this bug with default features by calling
syn::parse_str::<syn::Expr>("q^0:");

This bug does not happen with feature full as this case seems handled here https://github.com/dtolnay/syn/blob/master/src/expr.rs#L1355

A fix could be to remove the check for input.peek(Token![as]) at https://github.com/dtolnay/syn/blob/master/src/expr.rs#L1402
(but I am not sure if it breaks other things)

@dtolnay
Copy link
Owner

dtolnay commented Mar 29, 2021

Thanks! I published a fix in 1.0.66.

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.

2 participants