about summary refs log tree commit diff
path: root/src/test/ui/structs-enums/tuple-struct-construct.rs
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-07-06 02:38:01 +0200
committerGitHub <noreply@github.com>2019-07-06 02:38:01 +0200
commit952ee778717d0fd0173ebc179d0975aa8a22353c (patch)
tree92a4ef046603fb80220cde9acaedaf7ee94361e6 /src/test/ui/structs-enums/tuple-struct-construct.rs
parent3c4a6c860609fbf135fdd92996a65f14c3eb00da (diff)
parent3e362a4800932186c7351972753ecdf715050983 (diff)
downloadrust-952ee778717d0fd0173ebc179d0975aa8a22353c.tar.gz
rust-952ee778717d0fd0173ebc179d0975aa8a22353c.zip
Rollup merge of #62329 - matklad:no-peeking, r=petrochenkov
Remove support for 1-token lookahead from the lexer

`StringReader` maintained `peek_token` and `peek_span_src_raw` for look ahead.

`peek_token` was used only by rustdoc syntax coloring. After moving peeking logic into highlighter, I was able to remove `peek_token` from the lexer. I tried to use `iter::Peekable`, but that wasn't as pretty as I hoped, due to buffered fatal errors. So I went with hand-rolled peeking.

After that I've noticed that the only peeking behavior left was for raw tokens to test tt jointness. I've rewritten it in terms of trivia tokens, and not just spans.

After that it became possible to simplify the awkward constructor of the lexer, which could return `Err` if the first peeked token contained error.
Diffstat (limited to 'src/test/ui/structs-enums/tuple-struct-construct.rs')
0 files changed, 0 insertions, 0 deletions