Skip to content

Commit d8df631

Browse files
committed
Make Parser::parse_for_head public for rustfmt usage
1 parent c0bb3b9 commit d8df631

File tree

1 file changed

+2
-1
lines changed
  • compiler/rustc_parse/src/parser

1 file changed

+2
-1
lines changed

compiler/rustc_parse/src/parser/expr.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2910,7 +2910,8 @@ impl<'a> Parser<'a> {
29102910
}
29112911
}
29122912

2913-
fn parse_for_head(&mut self) -> PResult<'a, (Box<Pat>, Box<Expr>)> {
2913+
// Public to use it for custom `for` expressions in rustfmt forks like https://github.com/tucant/rustfmt
2914+
pub fn parse_for_head(&mut self) -> PResult<'a, (Box<Pat>, Box<Expr>)> {
29142915
let begin_paren = if self.token == token::OpenParen {
29152916
// Record whether we are about to parse `for (`.
29162917
// This is used below for recovery in case of `for ( $stuff ) $block`

0 commit comments

Comments
 (0)