Lifetime locations in MIR

I am working on a project to mark the source code of simple Rust programs with the Live, Dead, borrow, move, drop locations of each local. I believe this information is available in the MIR but I am struggling to extract the source code locations. For each function, I iterate through the local_decls and get the declaration location from span. However, the associated locations for Live, borrow, move, and drop are basic block locations. The source code locations are included in the playground mir but not part of the body returned from optimized_mir. How do I get the source code location mapping of StorageLive, StorageDead, move and drop from the function body returned from optimized_mir()?
I am new to Rust so apologize if I missed something obvious. Any suggestions, examples, links, repos are welcome and appreciated.

1 Like

There's a second forum dedicated to compiler internals. You may have better luck finding right people there:

Also compiler devs are active on Zulip: Zulip - Rust Forge

1 Like

Will do. Thanks!