Skip to content

Commit dc92ba9

Browse files
committed
Combine an if and a match in maybe_recover_struct_lit_bad_delims.
1 parent 2a5adf3 commit dc92ba9

File tree

1 file changed

+2
-5
lines changed
  • compiler/rustc_parse/src/parser

1 file changed

+2
-5
lines changed

compiler/rustc_parse/src/parser/expr.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,11 +1229,8 @@ impl<'a> Parser<'a> {
12291229
seq: &mut PResult<'a, P<Expr>>,
12301230
snapshot: Option<(SnapshotParser<'a>, ExprKind)>,
12311231
) -> Option<P<Expr>> {
1232-
if !self.may_recover() {
1233-
return None;
1234-
}
1235-
match (seq.as_mut(), snapshot) {
1236-
(Err(err), Some((mut snapshot, ExprKind::Path(None, path)))) => {
1232+
match (self.may_recover(), seq.as_mut(), snapshot) {
1233+
(true, Err(err), Some((mut snapshot, ExprKind::Path(None, path)))) => {
12371234
snapshot.bump(); // `(`
12381235
match snapshot.parse_struct_fields(path.clone(), false, Delimiter::Parenthesis) {
12391236
Ok((fields, ..))

0 commit comments

Comments
 (0)