I want to write a lifetime visualization tool as a VSCode plugin. For that I tried to find how rustc can generate lifetime ranges of each variable or lifetime identifier. This must exist somewhere in rustc because it has to do the borrow check on top of it.
I did some digging and found there is a flag
-Z nll-facts that can generate some related info, but those info are presented without associations to the variable names or code positions. I also searched RLS and rust-analyzer and found nothing related to lifetime ranges.
I wonder if there's such a hope to enable rustc generating a mapping from each variable to its lifetimes in code positions.