We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
ExprTuple adds a comma to a 1-tuple.PatTuple should also do this to avoid being the same as a PatParen.
ExprTuple
PatTuple
PatParen
The last assert in this test should contain a comma:
#[test] fn test_one_tuple() { let expr_path = ExprPath { attrs: Vec::new(), qself: None, path: Path { leading_colon: None, segments: [PathSegment { ident: Ident::new("a", Span::call_site()), arguments: PathArguments::None, }].into_iter().collect(), }, }; let mut expr = ExprTuple { attrs: Vec::new(), paren_token: token::Paren::default(), elems: Punctuated::new(), }; expr.elems.push(Expr::Path(expr_path.clone())); assert_eq!(expr.to_token_stream().to_string(), "(a ,)"); let mut pat = PatTuple { attrs: Vec::new(), paren_token: token::Paren::default(), elems: Punctuated::new(), }; pat.elems.push(Pat::Path(expr_path)); assert_eq!(pat.to_token_stream().to_string(), "(a)"); }
The text was updated successfully, but these errors were encountered:
Good catch! I have published a fix in syn 2.0.43.
Sorry, something went wrong.
Update to version of syn with fix for PatTuple
syn
c6e516b
dtolnay/syn#1553
Successfully merging a pull request may close this issue.
ExprTuple
adds a comma to a 1-tuple.PatTuple
should also do this to avoid being the same as aPatParen
.The last assert in this test should contain a comma:
The text was updated successfully, but these errors were encountered: