Fix internal compiler error on malformed match arm pattern.

Issue: 54379
This commit is contained in:
Donato Sciarra 2018-10-07 00:05:42 +02:00
parent 987a50bab3
commit b7248d5988
3 changed files with 48 additions and 0 deletions

View file

@ -3866,6 +3866,9 @@ impl<'a> Parser<'a> {
// check that a comma comes after every field
if !ate_comma {
let err = self.struct_span_err(self.prev_span, "expected `,`");
if let Some(mut delayed) = delayed_err {
delayed.emit();
}
return Err(err);
}
ate_comma = false;