While digging through the parser to see if I could potentially implement this, I discovered that match
arm RHSs are already treated during parsing similarly to statements, meaning that this wouldn’t be a breaking change at all! (On reflection, I probably should have tried compiling my own example from above that was meant to demonstrate code that worked today. )
Edit: Welp, it actually totally is a breaking change, but a super(-duper) minor one. The only code that would be broken would be code like this:
match foo {
Foo => mac! { ... }(),
Bar => mac! { ... }[0],
Baz => mac! { ... } & 1,
Qux => mac! { ... } && some_predicate(),
}
I actually tried compiling this time, and it totally parses, but wouldn’t under this change. I would bet a large sum of play money that this would break literally no Rust code anywhere—in the Rust compiler itself, the sequence => <word>! {
only appears three times, none of which are terminated by }(...)
, }[...]
, } & ...
, or } && ...
.