about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/expr.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-03-15 02:22:46 +0000
committerbors <bors@rust-lang.org>2025-03-15 02:22:46 +0000
commit282865097d138c7f0f7a7566db5b761312dd145c (patch)
tree74464a3e73c98a0647d3235ca555d85c113d7592 /compiler/rustc_parse/src/parser/expr.rs
parentd9e5539a39192028a7b15ae596a8685017faecee (diff)
parent9838591694099ae068900ddd3ad0aebec38ea49a (diff)
downloadrust-282865097d138c7f0f7a7566db5b761312dd145c.tar.gz
rust-282865097d138c7f0f7a7566db5b761312dd145c.zip
Auto merge of #138523 - fmease:rollup-j2j5h59, r=fmease
Rollup of 9 pull requests

Successful merges:

 - #138056 (rustc_target: Add target features for LoongArch v1.1)
 - #138451 (Build GCC on CI with GCC, not Clang)
 - #138454 (Improve post-merge workflow)
 - #138460 (Pass struct field HirId when check_expr_struct_fields)
 - #138474 (Refactor is_snake_case.)
 - #138482 (Fix HIR printing of parameters)
 - #138507 (Mirror NetBSD sources)
 - #138511 (Make `Parser::parse_expr_cond` public)
 - #138518 (Fix typo in hir lowering lint diag)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_parse/src/parser/expr.rs')
-rw-r--r--compiler/rustc_parse/src/parser/expr.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs
index 9b2d562a69e..0774324eae7 100644
--- a/compiler/rustc_parse/src/parser/expr.rs
+++ b/compiler/rustc_parse/src/parser/expr.rs
@@ -2588,7 +2588,8 @@ impl<'a> Parser<'a> {
     }
 
     /// Parses the condition of a `if` or `while` expression.
-    fn parse_expr_cond(&mut self) -> PResult<'a, P<Expr>> {
+    // 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.
+    pub fn parse_expr_cond(&mut self) -> PResult<'a, P<Expr>> {
         let attrs = self.parse_outer_attributes()?;
         let (mut cond, _) =
             self.parse_expr_res(Restrictions::NO_STRUCT_LITERAL | Restrictions::ALLOW_LET, attrs)?;