diff options
| author | bors <bors@rust-lang.org> | 2020-08-31 13:30:13 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-08-31 13:30:13 +0000 |
| commit | 1fd8636d2428658cf46df53fb4f445558689fd1c (patch) | |
| tree | 80c3f9bec7279f5d98c0d7e77588d2754072ee5e /compiler/rustc_parse/src | |
| parent | 3b4797cb598260b96dd8d6e47cd429210e14c1f6 (diff) | |
| parent | 9caf08f05291276288defa6fba7a4fb5c0e56ade (diff) | |
| download | rust-1fd8636d2428658cf46df53fb4f445558689fd1c.tar.gz rust-1fd8636d2428658cf46df53fb4f445558689fd1c.zip | |
Auto merge of #76159 - matklad:rollup-8jydjg3, r=matklad
Rollup of 5 pull requests Successful merges: - #75938 (Added some `min_const_generics` revisions into `const_generics` tests) - #76050 (Remove unused function) - #76075 (datastructures: replace `once_cell` crate with an impl from std) - #76115 (Restore public visibility on some parsing functions for rustfmt) - #76127 (rustbuild: Remove one LLD workaround) Failed merges: r? @ghost
Diffstat (limited to 'compiler/rustc_parse/src')
| -rw-r--r-- | compiler/rustc_parse/src/lexer/mod.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_parse/src/parser/mod.rs | 3 | ||||
| -rw-r--r-- | compiler/rustc_parse/src/parser/stmt.rs | 3 |
3 files changed, 4 insertions, 6 deletions
diff --git a/compiler/rustc_parse/src/lexer/mod.rs b/compiler/rustc_parse/src/lexer/mod.rs index a65d3446819..c4ef35bc30c 100644 --- a/compiler/rustc_parse/src/lexer/mod.rs +++ b/compiler/rustc_parse/src/lexer/mod.rs @@ -439,10 +439,6 @@ impl<'a> StringReader<'a> { (lit_kind, id) } - pub fn pos(&self) -> BytePos { - self.pos - } - #[inline] fn src_index(&self, pos: BytePos) -> usize { (pos - self.start_pos).to_usize() diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs index d67ed74bc99..d90a61cd34a 100644 --- a/compiler/rustc_parse/src/parser/mod.rs +++ b/compiler/rustc_parse/src/parser/mod.rs @@ -1014,7 +1014,8 @@ impl<'a> Parser<'a> { /// If the following element can't be a tuple (i.e., it's a function definition), then /// it's not a tuple struct field), and the contents within the parentheses isn't valid, /// so emit a proper diagnostic. - pub(crate) fn parse_visibility(&mut self, fbt: FollowedByType) -> PResult<'a, Visibility> { + // Public for rustfmt usage. + pub fn parse_visibility(&mut self, fbt: FollowedByType) -> PResult<'a, Visibility> { maybe_whole!(self, NtVis, |x| x); self.expected_tokens.push(TokenType::Keyword(kw::Crate)); diff --git a/compiler/rustc_parse/src/parser/stmt.rs b/compiler/rustc_parse/src/parser/stmt.rs index ac067cb0eab..0f522fd788c 100644 --- a/compiler/rustc_parse/src/parser/stmt.rs +++ b/compiler/rustc_parse/src/parser/stmt.rs @@ -21,7 +21,8 @@ use std::mem; impl<'a> Parser<'a> { /// Parses a statement. This stops just before trailing semicolons on everything but items. /// e.g., a `StmtKind::Semi` parses to a `StmtKind::Expr`, leaving the trailing `;` unconsumed. - pub(super) fn parse_stmt(&mut self) -> PResult<'a, Option<Stmt>> { + // Public for rustfmt usage. + pub fn parse_stmt(&mut self) -> PResult<'a, Option<Stmt>> { Ok(self.parse_stmt_without_recovery().unwrap_or_else(|mut e| { e.emit(); self.recover_stmt_(SemiColonMode::Break, BlockMode::Ignore); |
