mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-30 13:06:28 +03:00
1159cb541c
coverage: Use original HIR info for synthetic by-move coroutine bodies > This is a copy of #156952(because my git was acting weird) Synthetic by-move coroutine bodies created for async closures don't have useful HIR of their own. Coverage was falling back to the parent async closure for HIR info, which means the executed `AsyncFnOnce` body could inherit hole spans from the wrong body and report the user-written closure body as uncovered. This PR uses the synthetic body's coroutine type to recover the original coroutine body def-id, then extracts HIR info from that body instead. That keeps the coverage spans tied to the body the synthetic MIR was cloned from. Fixes rust-lang/rust#151135. r? Zalathar