External Publication
Visit Post

Q: Why do match expression need parenthesis for ops to the right but not left?

Rust Internals [Unofficial] April 2, 2026
Source

For block-tailed-expressions like match, when they appear in a position that a statement is valid, they are always treated as a statement. This ensures that the parse does not rely on types in the program, which is a very desirable property to keep syntax not interleaved with complicated and turing-complete type resolution.

Discussion in the ATmosphere

Loading comments...