mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
b8755a44fc
Avoid semicolon suggestion when tail expr is error Fixes rust-lang/rust#151610 When the tail expression is Err due to recovery, HIR constructs `StmtKind::Semi(Err(..))`. The suggestion path then uses `stmt.span.with_lo(tail_expr.span.hi())` to target the semicolon, but `stmt.span == tail_expr.span` so the derived span is empty/invalid.