diff options
| author | bors <bors@rust-lang.org> | 2023-09-14 19:56:55 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-09-14 19:56:55 +0000 |
| commit | dac91a82e146d89fefe94dcbb53cd6c2662e354f (patch) | |
| tree | b17e0f57c57a47fb6d4b54df4313174f090ee4e3 /src/tools/rustfmt | |
| parent | ccf817b9bbe449204a227430d0a84a4f1d1798cc (diff) | |
| parent | e324a59eb6ba1a7883bf23ff42d425ca96960f2a (diff) | |
| download | rust-dac91a82e146d89fefe94dcbb53cd6c2662e354f.tar.gz rust-dac91a82e146d89fefe94dcbb53cd6c2662e354f.zip | |
Auto merge of #115677 - matthewjasper:let-expr-recovery, r=b-naber
Improve invalid let expression handling - Move all of the checks for valid let expression positions to parsing. - Add a field to ExprKind::Let in AST/HIR to mark whether it's in a valid location. - Suppress some later errors and MIR construction for invalid let expressions. - Fix a (drop) scope issue that was also responsible for #104172. Fixes #104172 Fixes #104868
Diffstat (limited to 'src/tools/rustfmt')
| -rw-r--r-- | src/tools/rustfmt/src/expr.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/rustfmt/src/expr.rs b/src/tools/rustfmt/src/expr.rs index c3c07f310bf..03cdddc4140 100644 --- a/src/tools/rustfmt/src/expr.rs +++ b/src/tools/rustfmt/src/expr.rs @@ -664,7 +664,7 @@ struct ControlFlow<'a> { fn extract_pats_and_cond(expr: &ast::Expr) -> (Option<&ast::Pat>, &ast::Expr) { match expr.kind { - ast::ExprKind::Let(ref pat, ref cond, _) => (Some(pat), cond), + ast::ExprKind::Let(ref pat, ref cond, _, _) => (Some(pat), cond), _ => (None, expr), } } |
