mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-28 20:16:58 +03:00
619d19c318
Improve debuginfo for closures and async functions on Windows MSVC The issue was that the resulting debuginfo was too complex for LLVM to translate into CodeView records correctly. As a result, it simply ignored the debuginfo which meant Windows debuggers could not display any closed over variables when stepping inside a closure or async fn. This fixes that by creating additional allocas on the stack so that the resulting debuginfo is simple (just `*my_variable.dbg.spill`) and LLVM can generate the correct CV records. I also updated some of our existing tests to run in CDB to cover this case. Before (closure):  After (closure):  Before (async):  After (async):  Fixes #83709