Update obtain-borrowck test

This commit is contained in:
Dominik Stolz 2023-05-17 16:30:12 +02:00
parent ab9e7037d1
commit 75e172e710

View File

@ -102,7 +102,7 @@ fn after_analysis<'tcx>(
println!("Bodies retrieved for:");
for (def_id, body) in bodies {
println!("{}", def_id);
assert!(body.input_facts.cfg_edge.len() > 0);
assert!(body.input_facts.unwrap().cfg_edge.len() > 0);
}
});
@ -127,7 +127,8 @@ fn override_queries(_session: &Session, local: &mut Providers, _external: &mut E
}
fn mir_borrowck<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> ProvidedValue<'tcx> {
let body_with_facts = rustc_borrowck::consumers::get_body_with_borrowck_facts(tcx, def_id);
let opts = ConsumerOptions::PoloniusInputFacts;
let body_with_facts = rustc_borrowck::consumers::get_body_with_borrowck_facts(tcx, def_id, opts);
// SAFETY: The reader casts the 'static lifetime to 'tcx before using it.
let body_with_facts: BodyWithBorrowckFacts<'static> =
unsafe { std::mem::transmute(body_with_facts) };