Skip to content

Commit 30ce15f

Browse files
committed
Make StringReader private
After the recent refactorings, we can actually completely hide this type. It should help with rust-lang#63689.
1 parent 1baf3ff commit 30ce15f

File tree

1 file changed

+3
-3
lines changed
  • compiler/rustc_parse/src/lexer

1 file changed

+3
-3
lines changed

compiler/rustc_parse/src/lexer/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub struct UnmatchedBrace {
2727
pub candidate_span: Option<Span>,
2828
}
2929

30-
pub struct StringReader<'a> {
30+
crate struct StringReader<'a> {
3131
sess: &'a ParseSess,
3232
/// Initial position, read-only.
3333
start_pos: BytePos,
@@ -41,7 +41,7 @@ pub struct StringReader<'a> {
4141
}
4242

4343
impl<'a> StringReader<'a> {
44-
pub fn new(
44+
crate fn new(
4545
sess: &'a ParseSess,
4646
source_file: Lrc<rustc_span::SourceFile>,
4747
override_span: Option<Span>,
@@ -66,7 +66,7 @@ impl<'a> StringReader<'a> {
6666
}
6767

6868
/// Returns the next token, including trivia like whitespace or comments.
69-
pub fn next_token(&mut self) -> Token {
69+
fn next_token(&mut self) -> Token {
7070
let start_src_index = self.src_index(self.pos);
7171
let text: &str = &self.src[start_src_index..self.end_src_index];
7272

0 commit comments

Comments
 (0)