about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/mod.rs
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_parse/src/parser/mod.rs
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_parse/src/parser/mod.rs')
-rw-r--r--compiler/rustc_parse/src/parser/mod.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs
index 77c59bb3881..e84d8f5b358 100644
--- a/compiler/rustc_parse/src/parser/mod.rs
+++ b/compiler/rustc_parse/src/parser/mod.rs
@@ -13,6 +13,7 @@ mod ty;
 use crate::lexer::UnmatchedDelim;
 pub use attr_wrapper::AttrWrapper;
 pub use diagnostics::AttemptLocalParseRecovery;
+pub(crate) use expr::ForbiddenLetReason;
 pub(crate) use item::FnParseMode;
 pub use pat::{CommaRecoveryMode, RecoverColon, RecoverComma};
 pub use path::PathStyle;