mirror of
https://github.com/allankoechke/rust.git
synced 2026-12-03 17:48:43 +00:00
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.