Skip to content

Commit

Permalink
Rollup merge of #96543 - nnethercote:rm-make_token_stream-hacks, r=Aa…
Browse files Browse the repository at this point in the history
…ron1011

Remove hacks in `make_token_stream`.

`make_tokenstream` has three commented hacks, and a comment at the top
referring to #67062. These hacks have no observable effect, at least as judged
by running the test suite. The hacks were added in #82608, with an explanation
[here](rust-lang/rust#82608 (comment)). It
appears that one of the following is true: (a) they never did anything useful,
(b) they do something useful but we have no test coverage for them, or (c)
something has changed in the meantime that means they are no longer necessary.

This commit removes the hacks and the comments, in the hope that (b) is not
true.

r? `@Aaron1011`
  • Loading branch information
JohnTitor committed May 11, 2022
2 parents 050978b + 77f0964 commit 8fcf113
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/parse/macros/mod.rs
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 8fcf113

Please sign in to comment.