Skip to content

Commit 3cd8e98

Browse files
committed
Remove some unnecessary invisible delimiter checks.
These seem to have no useful effect... they don't seem useful from a code inspection point of view, and they affect anything in the test suite.
1 parent bb398ca commit 3cd8e98

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

compiler/rustc_parse/src/parser/diagnostics.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -2109,8 +2109,7 @@ impl<'a> Parser<'a> {
21092109
brace_depth -= 1;
21102110
continue;
21112111
}
2112-
} else if self.token == token::Eof || self.eat(&token::CloseDelim(Delimiter::Invisible))
2113-
{
2112+
} else if self.token == token::Eof {
21142113
return;
21152114
} else {
21162115
self.bump();

src/tools/rustfmt/src/parse/macros/mod.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,7 @@ fn check_keyword<'a, 'b: 'a>(parser: &'a mut Parser<'b>) -> Option<MacroArg> {
7979
for &keyword in RUST_KW.iter() {
8080
if parser.token.is_keyword(keyword)
8181
&& parser.look_ahead(1, |t| {
82-
t.kind == TokenKind::Eof
83-
|| t.kind == TokenKind::Comma
84-
|| t.kind == TokenKind::CloseDelim(Delimiter::Invisible)
82+
t.kind == TokenKind::Eof || t.kind == TokenKind::Comma
8583
})
8684
{
8785
parser.bump();

0 commit comments

Comments
 (0)