Skip to content

Commit 3035a05

Browse files
committed
remove unused mk_sp_and_raw
1 parent 8bea334 commit 3035a05

File tree

1 file changed

+3
-10
lines changed
  • src/libsyntax/parse/lexer

1 file changed

+3
-10
lines changed

src/libsyntax/parse/lexer/mod.rs

+3-10
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,7 @@ impl<'a> StringReader<'a> {
9898
}
9999

100100
fn mk_sp(&self, lo: BytePos, hi: BytePos) -> Span {
101-
self.mk_sp_and_raw(lo, hi).0
102-
}
103-
104-
fn mk_sp_and_raw(&self, lo: BytePos, hi: BytePos) -> (Span, Span) {
105-
let raw = Span::new(lo, hi, NO_EXPANSION);
106-
let real = self.override_span.unwrap_or(raw);
107-
108-
(real, raw)
101+
self.override_span.unwrap_or_else(|| Span::new(lo, hi, NO_EXPANSION))
109102
}
110103

111104
fn unwrap_or_abort<T>(&mut self, res: Result<T, ()>) -> T {
@@ -133,8 +126,8 @@ impl<'a> StringReader<'a> {
133126
let start_pos = self.pos;
134127
(self.next_token_inner()?, start_pos, self.pos)
135128
};
136-
let (real, _raw) = self.mk_sp_and_raw(start_pos, end_pos);
137-
Ok(Token::new(kind, real))
129+
let span = self.mk_sp(start_pos, end_pos);
130+
Ok(Token::new(kind, span))
138131
}
139132
}
140133
}

0 commit comments

Comments
 (0)