We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dc925be commit bc8f0ddCopy full SHA for bc8f0dd
src/libsyntax/parse/parser.rs
@@ -4675,6 +4675,9 @@ impl<'a> Parser<'a> {
4675
fn parse_block_tail(&mut self, lo: Span, s: BlockCheckMode) -> PResult<'a, P<Block>> {
4676
let mut stmts = vec![];
4677
while !self.eat(&token::CloseDelim(token::Brace)) {
4678
+ if self.token == token::Eof {
4679
+ break;
4680
+ }
4681
let stmt = match self.parse_full_stmt(false) {
4682
Err(mut err) => {
4683
err.emit();
@@ -4689,8 +4692,6 @@ impl<'a> Parser<'a> {
4689
4692
};
4690
4693
if let Some(stmt) = stmt {
4691
4694
stmts.push(stmt);
- } else if self.token == token::Eof {
- break;
4695
} else {
4696
// Found only `;` or `}`.
4697
continue;
0 commit comments