Add a test for get_body_with_borrowck_facts.
This commit is contained in:
parent
ad2b4f4441
commit
b913a4591a
5 changed files with 245 additions and 0 deletions
|
@ -15,6 +15,15 @@ pub use super::{
|
|||
|
||||
/// 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 `const` function
|
||||
/// because they are evaluated during typechecking. The panic can be avoided
|
||||
/// by overriding the `mir_borrowck` query. You can find a complete example
|
||||
/// that shows how to do this at `src/test/run-make/obtain-borrowck/`.
|
||||
/// * This function will also panic if computation of Polonius facts
|
||||
/// (`-Zpolonius` flag) is not enabled.
|
||||
pub fn get_body_with_borrowck_facts<'tcx>(
|
||||
tcx: TyCtxt<'tcx>,
|
||||
def: ty::WithOptConstParam<LocalDefId>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue