mirror of
https://github.com/allankoechke/rust.git
synced 2026-11-30 11:05:36 +00:00
Avoid stale closure recovery state across statements Fixes rust-lang/rust#159989 `current_closure` was cleared when starting a new expression through `parse_expr`, but statement expressions call `parse_expr_res` directly. This allowed closure recovery state from one statement to remain active while parsing the next statement. This pr clears `current_closure` when entering `parse_stmt_without_recovery`, matching the behavior of `parse_expr`.da2697d1d8/compiler/rustc_parse/src/parser/expr.rs (L55-L56)da2697d1d8/compiler/rustc_parse/src/parser/expr.rs (L63-L64)