diff options
| author | The Miri Cronjob Bot <miri@cron.bot> | 2025-03-16 05:12:15 +0000 |
|---|---|---|
| committer | The Miri Cronjob Bot <miri@cron.bot> | 2025-03-16 05:12:15 +0000 |
| commit | 17ae00d1228ced4eb5a19fa4371b080da87b6b2a (patch) | |
| tree | 001d780c6d9145424e81b3488d472beb488fa237 /compiler/rustc_parse/src/parser/expr.rs | |
| parent | 642634c39b00a4630e461b431cce0fc38a640b66 (diff) | |
| parent | 5434242af764d1525bd6ddf6e53ee5567042e381 (diff) | |
| download | rust-17ae00d1228ced4eb5a19fa4371b080da87b6b2a.tar.gz rust-17ae00d1228ced4eb5a19fa4371b080da87b6b2a.zip | |
Merge from rustc
Diffstat (limited to 'compiler/rustc_parse/src/parser/expr.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/expr.rs | 3 |
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 fc9a511d56a..41720e99e3b 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -2598,7 +2598,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)?; |
