Skip to content

Commit

Permalink
Move polonius engine import
Browse files Browse the repository at this point in the history
  • Loading branch information
JustusAdam committed Aug 31, 2023
1 parent 570b634 commit 8a0ce41
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
1 change: 1 addition & 0 deletions crates/flowistry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
)]

extern crate either;
extern crate polonius_engine;
extern crate rustc_borrowck;
extern crate rustc_data_structures;
extern crate rustc_driver;
Expand Down
21 changes: 12 additions & 9 deletions crates/flowistry/src/mir/aliases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ use crate::{
mir::utils::AsyncHack,
};

extern crate polonius_engine;
type BorrowckLocationIndex = <rustc_borrowck::consumers::RustcFacts as polonius_engine::FactTypes>::Point;
type BorrowckLocationIndex =
<rustc_borrowck::consumers::RustcFacts as crate::polonius_engine::FactTypes>::Point;

#[derive(Default)]
struct GatherBorrows<'tcx> {
Expand Down Expand Up @@ -86,7 +86,7 @@ impl<'a, 'tcx> Aliases<'a, 'tcx> {
tcx: TyCtxt<'tcx>,
def_id: DefId,
body_with_facts: &'a BodyWithBorrowckFacts<'tcx>,
selector: impl Fn(RegionVid, RegionVid, BorrowckLocationIndex) -> bool
selector: impl Fn(RegionVid, RegionVid, BorrowckLocationIndex) -> bool,
) -> Self {
let loans = Self::compute_loans(tcx, def_id, body_with_facts, selector);
Aliases {
Expand All @@ -105,12 +105,15 @@ impl<'a, 'tcx> Aliases<'a, 'tcx> {
let start = Instant::now();
let body = &body_with_facts.body;
let static_region = RegionVid::from_usize(0);
let ref subset_base =
body_with_facts.input_facts.as_ref().unwrap().subset_base
.iter()
.cloned()
.filter(|(r1, r2, i)| constraint_selector(*r1, *r2, *i))
.collect::<Vec<_>>();
let ref subset_base = body_with_facts
.input_facts
.as_ref()
.unwrap()
.subset_base
.iter()
.cloned()
.filter(|(r1, r2, i)| constraint_selector(*r1, *r2, *i))
.collect::<Vec<_>>();

let all_pointers = body
.local_decls()
Expand Down

0 comments on commit 8a0ce41

Please sign in to comment.