dtolnay / syn

Parser for Rust source code
Apache License 2.0
2.78k stars 306 forks source link

Parenthesize leading Expr::Let in statement #1700

Closed dtolnay closed 1 month ago

dtolnay commented 1 month ago

Printing Expr::Let at the start of a statement would cause it to be interpreted as Stmt::Local. This PR causes parentheses to be inserted in that scenario to preserve the Expr::Let.