Skip to content

Commit b7eed53

Browse files
committed
Remove field TtReader::next_tok.
1 parent 23ad6fd commit b7eed53

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

src/libsyntax/ext/tt/transcribe.rs

-5
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ pub struct TtReader<'a> {
4444
/* cached: */
4545
pub cur_tok: Token,
4646
pub cur_span: Span,
47-
pub next_tok: Option<TokenAndSpan>,
4847
/// Transform doc comments. Only useful in macro invocations
4948
pub fatal_errs: Vec<DiagnosticBuilder<'a>>,
5049
}
@@ -77,7 +76,6 @@ pub fn new_tt_reader(sp_diag: &Handler,
7776
/* dummy values, never read: */
7877
cur_tok: token::Eof,
7978
cur_span: DUMMY_SP,
80-
next_tok: None,
8179
fatal_errs: Vec::new(),
8280
};
8381
tt_next_token(&mut r); /* get cur_tok and cur_span set up */
@@ -156,9 +154,6 @@ fn lockstep_iter_size(t: &TokenTree, r: &TtReader) -> LockstepIterSize {
156154
/// Return the next token from the TtReader.
157155
/// EFFECT: advances the reader's token field
158156
pub fn tt_next_token(r: &mut TtReader) -> TokenAndSpan {
159-
if let Some(tok) = r.next_tok.take() {
160-
return tok;
161-
}
162157
// FIXME(pcwalton): Bad copy?
163158
let ret_val = TokenAndSpan {
164159
tok: r.cur_tok.clone(),

src/libsyntax/parse/lexer/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,10 @@ impl<'a> Reader for TtReader<'a> {
171171
self.fatal_errs.clear();
172172
}
173173
fn peek(&self) -> TokenAndSpan {
174-
self.next_tok.clone().unwrap_or(TokenAndSpan {
174+
TokenAndSpan {
175175
tok: self.cur_tok.clone(),
176176
sp: self.cur_span,
177-
})
177+
}
178178
}
179179
}
180180

0 commit comments

Comments
 (0)