Skip to content

Commit f4c5c34

Browse files
authored
Rollup merge of #146094 - mohe2015:patch-2, r=lcnr
Make `Parser::parse_for_head` public for rustfmt usage Similar to #138511, I want to add [dioxus rsx](https://dioxuslabs.com/learn/0.6/reference/rsx) formatting to [my rustfmt fork](https://github.com/tucant/rustfmt) and it would be much easier if that method would be public. Thanks.
2 parents 50e38b5 + d8df631 commit f4c5c34

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)