Function rustc_mir::consumers::get_body_with_borrowck_facts [−][src]
pub fn get_body_with_borrowck_facts<'tcx>(
tcx: TyCtxt<'tcx>,
def: WithOptConstParam<LocalDefId>
) -> BodyWithBorrowckFacts<'tcx>
Expand description
This function computes Polonius facts for the given body. It makes a copy of the body because it needs to regenerate the region identifiers.
Note:
-
This function will panic if the required body was already stolen. This can, for example, happen when requesting a body of a
constfunction because they are evaluated during typechecking. The panic can be avoided by overriding themir_borrowckquery. You can find a complete example that shows how to do this atsrc/test/run-make/obtain-borrowck/. -
This function will also panic if computation of Polonius facts (
-Zpoloniusflag) is not enabled. -
Polonius is highly unstable, so expect regular changes in its signature or other details.