diff options
| author | Aleksey Kladov <aleksey.kladov@gmail.com> | 2020-08-31 18:01:01 +0200 |
|---|---|---|
| committer | Aleksey Kladov <aleksey.kladov@gmail.com> | 2020-08-31 18:01:01 +0200 |
| commit | 30ce15f1fa763904835c5b3df155964668937683 (patch) | |
| tree | 06db6ed0bd685f44c383720147d8812bc131bfa4 /compiler/rustc_parse | |
| parent | 1baf3ff7e98ea14e84159e213bd9872efd53e07f (diff) | |
| download | rust-30ce15f1fa763904835c5b3df155964668937683.tar.gz rust-30ce15f1fa763904835c5b3df155964668937683.zip | |
Make StringReader private
After the recent refactorings, we can actually completely hide this type. It should help with #63689.
Diffstat (limited to 'compiler/rustc_parse')
| -rw-r--r-- | compiler/rustc_parse/src/lexer/mod.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_parse/src/lexer/mod.rs b/compiler/rustc_parse/src/lexer/mod.rs index c4ef35bc30c..1131f00cb42 100644 --- a/compiler/rustc_parse/src/lexer/mod.rs +++ b/compiler/rustc_parse/src/lexer/mod.rs @@ -27,7 +27,7 @@ pub struct UnmatchedBrace { pub candidate_span: Option<Span>, } -pub struct StringReader<'a> { +crate struct StringReader<'a> { sess: &'a ParseSess, /// Initial position, read-only. start_pos: BytePos, @@ -41,7 +41,7 @@ pub struct StringReader<'a> { } impl<'a> StringReader<'a> { - pub fn new( + crate fn new( sess: &'a ParseSess, source_file: Lrc<rustc_span::SourceFile>, override_span: Option<Span>, @@ -66,7 +66,7 @@ impl<'a> StringReader<'a> { } /// Returns the next token, including trivia like whitespace or comments. - pub fn next_token(&mut self) -> Token { + fn next_token(&mut self) -> Token { let start_src_index = self.src_index(self.pos); let text: &str = &self.src[start_src_index..self.end_src_index]; |
