about summary refs log tree commit diff
path: root/compiler/rustc_resolve/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-09-14 19:56:55 +0000
committerbors <bors@rust-lang.org>2023-09-14 19:56:55 +0000
commitdac91a82e146d89fefe94dcbb53cd6c2662e354f (patch)
treeb17e0f57c57a47fb6d4b54df4313174f090ee4e3 /compiler/rustc_resolve/src
parentccf817b9bbe449204a227430d0a84a4f1d1798cc (diff)
parente324a59eb6ba1a7883bf23ff42d425ca96960f2a (diff)
downloadrust-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 'compiler/rustc_resolve/src')
-rw-r--r--compiler/rustc_resolve/src/late.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs
index d40b1b2e3a9..01f9f060594 100644
--- a/compiler/rustc_resolve/src/late.rs
+++ b/compiler/rustc_resolve/src/late.rs
@@ -4180,7 +4180,7 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
                 self.resolve_expr(e, Some(&expr));
             }
 
-            ExprKind::Let(ref pat, ref scrutinee, _) => {
+            ExprKind::Let(ref pat, ref scrutinee, _, _) => {
                 self.visit_expr(scrutinee);
                 self.resolve_pattern_top(pat, PatternSource::Let);
             }