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 4bb6b4a commit cc481a4Copy full SHA for cc481a4
src/libsyntax/parse/parser.rs
@@ -4629,6 +4629,9 @@ impl<'a> Parser<'a> {
4629
fn parse_block_tail(&mut self, lo: Span, s: BlockCheckMode) -> PResult<'a, P<Block>> {
4630
let mut stmts = vec![];
4631
while !self.eat(&token::CloseDelim(token::Brace)) {
4632
+ if self.token == token::Eof {
4633
+ break;
4634
+ }
4635
let stmt = match self.parse_full_stmt(false) {
4636
Err(mut err) => {
4637
err.emit();
@@ -4643,8 +4646,6 @@ impl<'a> Parser<'a> {
4643
4646
};
4644
4647
if let Some(stmt) = stmt {
4645
4648
stmts.push(stmt);
- } else if self.token == token::Eof {
- break;
4649
} else {
4650
// Found only `;` or `}`.
4651
continue;
0 commit comments