diff options
author | Philip Herron <philip.herron@embecosm.com> | 2022-04-21 12:13:33 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2022-04-21 12:13:33 +0100 |
commit | fe10ca37aba8f3cb9bfaa9dd01bdb1329317cf21 (patch) | |
tree | c4d4611d59da5be0c9476f2d1a62eaeef666b402 /gcc/rust/backend/rust-compile-base.h | |
parent | c18257c7265470a071f7ed9fe29899ece839fcf4 (diff) | |
download | gcc-fe10ca37aba8f3cb9bfaa9dd01bdb1329317cf21.zip gcc-fe10ca37aba8f3cb9bfaa9dd01bdb1329317cf21.tar.gz gcc-fe10ca37aba8f3cb9bfaa9dd01bdb1329317cf21.tar.bz2 |
Handle parsing match arms with no comma
When parsing a match expression such as:
```
match (f, g) {
(Foo::A, 1) => {}
(Foo::B, 2) => {}
_ => {}
}
```
The first match arm here has an empty block expression of {}. This was
being parsed into a CallExpr of {}(Foo::B, 2) which is wrong. The parsing
of match arms are expression statements so they can be a block but must not
consume the semi-colon as it is valid to have a comma to delimit the match
arm or it can be ignored if this is a ExprWithBlock.
Addresses #1081
Diffstat (limited to 'gcc/rust/backend/rust-compile-base.h')
0 files changed, 0 insertions, 0 deletions