dtolnay / syn

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

Parenthesize closures and jumps which are not rightmost subexpressions #1694

Closed dtolnay closed 1 month ago

dtolnay commented 1 month ago

Previously, in $a + 1 where $a is something like 1 + || 1 or 1 + return 1 or 1 + break 1 or 1 + ..=1, the middle expression was not being adequately parenthesized to preserve its precedence relative to the trailing + 1.