Skip to content

Commit

Permalink
Remove some unnecessary invisible delimiter checks.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nnethercote committed May 11, 2022
1 parent bb398ca commit 3cd8e98
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions compiler/rustc_parse/src/parser/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2109,8 +2109,7 @@ impl<'a> Parser<'a> {
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();
Expand Down
4 changes: 1 addition & 3 deletions src/tools/rustfmt/src/parse/macros/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ fn check_keyword<'a, 'b: 'a>(parser: &'a mut Parser<'b>) -> Option<MacroArg> {
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();
Expand Down

0 comments on commit 3cd8e98

Please sign in to comment.