Skip to content

Commit

Permalink
parser: restore some fn visibility for rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
calebcartwright committed Aug 30, 2020
1 parent 85fbf49 commit 883b1e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion compiler/rustc_parse/src/parser/mod.rs
Expand Up @@ -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));
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_parse/src/parser/stmt.rs
Expand Up @@ -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);
Expand Down

0 comments on commit 883b1e7

Please sign in to comment.