diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs index beffbdc5de4..369650edd57 100644 --- a/compiler/rustc_parse/src/parser/diagnostics.rs +++ b/compiler/rustc_parse/src/parser/diagnostics.rs @@ -2109,8 +2109,7 @@ pub(super) fn consume_block(&mut self, delim: Delimiter, consume_close: ConsumeC brace_depth -= 1; continue; } - } else if self.token == token::Eof || self.eat(&token::CloseDelim(Delimiter::Invisible)) - { + } else if self.token == token::Eof { return; } else { self.bump(); diff --git a/src/tools/rustfmt/src/parse/macros/mod.rs b/src/tools/rustfmt/src/parse/macros/mod.rs index d4dbf21f8ca..67f3985926e 100644 --- a/src/tools/rustfmt/src/parse/macros/mod.rs +++ b/src/tools/rustfmt/src/parse/macros/mod.rs @@ -79,9 +79,7 @@ fn check_keyword<'a, 'b: 'a>(parser: &'a mut Parser<'b>) -> Option { for &keyword in RUST_KW.iter() { if parser.token.is_keyword(keyword) && parser.look_ahead(1, |t| { - t.kind == TokenKind::Eof - || t.kind == TokenKind::Comma - || t.kind == TokenKind::CloseDelim(Delimiter::Invisible) + t.kind == TokenKind::Eof || t.kind == TokenKind::Comma }) { parser.bump();