Files
rust/compiler/rustc_parse
Jonathan Brouwer 9e4d2e62c7 Rollup merge of #160008 - TaKO8Ki:fix-stale-closure-recovery, r=mati865
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)
2026-07-28 21:07:59 +02:00
..
2026-07-27 10:33:18 +02:00