Open avadacatavra opened 6 years ago
It seems that the borrow checker information that consumers would need is:
As far as I know, the only way to get Polonius input facts is to pass -Znll-facts
flag to the compiler and then parse the emitted CSV files. The most hacky part of this is parsing strings to restore actual IDs used in MIR.
Obtaining the mapping requires passing the -Zdump-mir=renumber
flag to the compiler that makes it to dump a diagnostics file, which can then be parsed to obtain the mapping.
An ideal solution for me would be to have a query (or queries) on TyCtxt that returns Polonius input facts and a mapping between MIR places and region IDs. Having such a query would not only simplify verifiers that need Polonius information, but would also enable showing visualisations of borrows in the IDE (we already have some code for this).
This is currently blocked until the NLL design gets stabilized.