mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
defee2995b
Avoid stack overflow in FindExprBySpan Fixes rust-lang/rust#153583. Deeply nested `?` desugarings can build a very deep HIR expression spine. When `FindExprBySpan` walks that expression during error reporting, the recursive `visit_expr` traversal can overflow the stack before rustc emits the actual diagnostic. This wraps the recursive expression walk in `ensure_sufficient_stack`, which lets the compiler report the expected E0277 instead of crashing. Added a UI regression test for a deeply nested `?` chain.