Skip to content

Commit eabe41c

Browse files
author
Sasha Pourcelot
committed
Fix misplaced match arm
1 parent 3bdda1c commit eabe41c

File tree

1 file changed

+8
-10
lines changed
  • compiler/rustc_parse/src/parser

1 file changed

+8
-10
lines changed

compiler/rustc_parse/src/parser/mod.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -779,15 +779,6 @@ impl<'a> Parser<'a> {
779779
let token_str = pprust::token_kind_to_string(t);
780780

781781
match self.last_closure_body.take() {
782-
None => {
783-
// Attempt to keep parsing if it was a similar separator.
784-
if let Some(ref tokens) = t.similar_tokens() {
785-
if tokens.contains(&self.token.kind) && !unclosed_delims {
786-
self.bump();
787-
}
788-
}
789-
}
790-
791782
Some(right_pipe_span) if self.token.kind == TokenKind::Semi => {
792783
// Finding a semicolon instead of a comma
793784
// after a closure body indicates that the
@@ -803,7 +794,14 @@ impl<'a> Parser<'a> {
803794
continue;
804795
}
805796

806-
_ => {}
797+
_ => {
798+
// Attempt to keep parsing if it was a similar separator.
799+
if let Some(ref tokens) = t.similar_tokens() {
800+
if tokens.contains(&self.token.kind) && !unclosed_delims {
801+
self.bump();
802+
}
803+
}
804+
}
807805
}
808806

809807
// If this was a missing `@` in a binding pattern

0 commit comments

Comments
 (0)