Skip to content

Commit 66c49c7

Browse files
committed
Make Parser::parse_expr_cond public.
This allows usage in rustfmt and rustfmt forks.
1 parent f7b4354 commit 66c49c7

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -2588,7 +2588,8 @@ impl<'a> Parser<'a> {
25882588
}
25892589

25902590
/// Parses the condition of a `if` or `while` expression.
2591-
fn parse_expr_cond(&mut self) -> PResult<'a, P<Expr>> {
2591+
// Public because it is used in rustfmt forks such as https://github.com/tucant/rustfmt/blob/30c83df9e1db10007bdd16dafce8a86b404329b2/src/parse/macros/html.rs#L57 for custom if expressions.
2592+
pub fn parse_expr_cond(&mut self) -> PResult<'a, P<Expr>> {
25922593
let attrs = self.parse_outer_attributes()?;
25932594
let (mut cond, _) =
25942595
self.parse_expr_res(Restrictions::NO_STRUCT_LITERAL | Restrictions::ALLOW_LET, attrs)?;

0 commit comments

Comments
 (0)