Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract lifetimes from compiler #13

Open
avadacatavra opened this issue May 8, 2018 · 2 comments
Open

Extract lifetimes from compiler #13

avadacatavra opened this issue May 8, 2018 · 2 comments
Labels

Comments

@avadacatavra
Copy link
Collaborator

No description provided.

@vakaras
Copy link

vakaras commented May 8, 2018

This is currently blocked until the NLL design gets stabilized.

@vakaras
Copy link

vakaras commented Dec 4, 2018

It seems that the borrow checker information that consumers would need is:

  1. The Polonius input facts. (Consumers can get output facts by running Polonius themselves. Also, I know at least one case where it is useful to modify the input facts before feeding them into Polonius.)
  2. The mapping between reference typed MIR places and region identifiers used in Polonius.

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants