rust/compiler/rustc_mir/src
bors 30a0a9b694 Auto merge of #86977 - vakaras:body_with_borrowck_facts, r=nikomatsakis
Enable compiler consumers to obtain mir::Body with Polonius facts.

This PR adds a function (``get_body_with_borrowck_facts``) that can be used by compiler consumers to obtain ``mir::Body`` with accompanying borrow checker information.

The most important borrow checker information that [our verifier called Prusti](https://github.com/viperproject/prusti-dev) needs is lifetime constraints. I have not found a reasonable way to compute the lifetime constraints on the Prusti side. In the compiler, the constraints are computed during the borrow checking phase and then dropped. This PR adds an additional parameter to the `do_mir_borrowck` function that tells it to return the computed information instead of dropping it.

The additionally returned information by `do_mir_borrowck` contains a ``mir::Body`` with non-erased lifetime regions and Polonius facts. I have decided to reuse the Polonius facts because this way I needed fewer changes to the compiler and Polonius facts contains other useful information that we otherwise would need to recompute.

Just FYI: up to now, Prusti was obtaining this information by [parsing the compiler logs](b58ced8dfd/prusti-interface/src/environment/borrowck/regions.rs (L25-L39)). This is not only a hacky approach, but we also reached its limits.

r? `@nikomatsakis`
2021-08-17 19:08:31 +00:00
..
borrow_check Auto merge of #86977 - vakaras:body_with_borrowck_facts, r=nikomatsakis 2021-08-17 19:08:31 +00:00
const_eval Improve comments about const panic handling 2021-07-28 16:18:38 +02:00
dataflow re-export SwitchIntEdgeEffects 2021-07-04 13:33:22 +02:00
interpret Implement black_box using intrinsic 2021-08-12 16:16:57 +01:00
monomorphize clippy:: append_instead_of_extend 2021-07-25 12:26:02 +02:00
transform Auto merge of #88056 - erikdesjardins:revertzst, r=oli-obk 2021-08-17 14:02:55 +00:00
util clippy::useless_format 2021-07-25 12:26:03 +02:00
lib.rs Auto merge of #86977 - vakaras:body_with_borrowck_facts, r=nikomatsakis 2021-08-17 19:08:31 +00:00
shim.rs rustc: Fill out remaining parts of C-unwind ABI 2021-08-03 07:06:19 -07:00