diff options
| author | bors <bors@rust-lang.org> | 2025-04-26 05:18:22 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-04-26 05:18:22 +0000 |
| commit | 5ae50d3b2182f81eea4e4d90e8da3653547215b5 (patch) | |
| tree | b7dd25708b89658c91cde6ae2b44582a867f370a /compiler/rustc_parse/src/parser | |
| parent | d3508a8ad0163fab0c9b2188b3adf43c87200788 (diff) | |
| parent | c781c9ae94ef94a5b144b2ac6f5fd2075f16f854 (diff) | |
| download | rust-5ae50d3b2182f81eea4e4d90e8da3653547215b5.tar.gz rust-5ae50d3b2182f81eea4e4d90e8da3653547215b5.zip | |
Auto merge of #140324 - matthiaskrgr:rollup-jlzvdre, r=matthiaskrgr
Rollup of 8 pull requests
Successful merges:
- #139865 (Stabilize proc_macro::Span::{start,end,line,column}.)
- #140086 (If creating a temporary directory fails with permission denied then retry with backoff)
- #140216 (Document that "extern blocks must be unsafe" in Rust 2024)
- #140253 (Add XtensaAsmPrinter)
- #140272 (Improve error message for `||` (or) in let chains)
- #140305 (Track per-obligation recursion depth only if there is inference in the new solver)
- #140306 (handle specialization in the new trait solver)
- #140308 (stall generator witness obligations: add regression test)
r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_parse/src/parser')
| -rw-r--r-- | compiler/rustc_parse/src/parser/expr.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index 370eb3f402d..f3b53971b29 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -4073,14 +4073,18 @@ impl MutVisitor for CondChecker<'_> { match e.kind { ExprKind::Let(_, _, _, ref mut recovered @ Recovered::No) => { if let Some(reason) = self.forbid_let_reason { - *recovered = Recovered::Yes(self.parser.dcx().emit_err( - errors::ExpectedExpressionFoundLet { + let error = match reason { + NotSupportedOr(or_span) => { + self.parser.dcx().emit_err(errors::OrInLetChain { span: or_span }) + } + _ => self.parser.dcx().emit_err(errors::ExpectedExpressionFoundLet { span, reason, missing_let: self.missing_let, comparison: self.comparison, - }, - )); + }), + }; + *recovered = Recovered::Yes(error); } else if self.depth > 1 { // Top level `let` is always allowed; only gate chains match self.let_chains_policy { |
