Skip to content

Commit 8d5cbc6

Browse files
committed
tmp: use polonius loan scopes to see how terribly slow it is
1 parent 0f2156c commit 8d5cbc6

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

compiler/rustc_borrowck/src/dataflow.rs

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -403,13 +403,10 @@ impl<'a, 'tcx> Borrows<'a, 'tcx> {
403403
regioncx: &'a RegionInferenceContext<'tcx>,
404404
borrow_set: &'a BorrowSet<'tcx>,
405405
) -> Self {
406-
let mut borrows_out_of_scope_at_location =
407-
calculate_borrows_out_of_scope_at_location(body, regioncx, borrow_set);
408-
409-
// The in-tree polonius analysis computes loans going out of scope using the set-of-loans
410-
// model, and makes sure they're identical to the existing computation of the set-of-points
411-
// model.
412-
if tcx.sess.opts.unstable_opts.polonius.is_next_enabled() {
406+
let borrows_out_of_scope_at_location = {
407+
// The in-tree polonius analysis computes loans going out of scope using the set-of-loans
408+
// model, and makes sure they're identical to the existing computation of the set-of-points
409+
// model.
413410
let mut polonius_prec = PoloniusOutOfScopePrecomputer::new(body, regioncx);
414411
for (loan_idx, loan_data) in borrow_set.iter_enumerated() {
415412
let issuing_region = loan_data.region;
@@ -422,13 +419,8 @@ impl<'a, 'tcx> Borrows<'a, 'tcx> {
422419
);
423420
}
424421

425-
assert_eq!(
426-
borrows_out_of_scope_at_location, polonius_prec.loans_out_of_scope_at_location,
427-
"the loans out of scope must be the same as the borrows out of scope"
428-
);
429-
430-
borrows_out_of_scope_at_location = polonius_prec.loans_out_of_scope_at_location;
431-
}
422+
polonius_prec.loans_out_of_scope_at_location
423+
};
432424

433425
Borrows { tcx, body, borrow_set, borrows_out_of_scope_at_location }
434426
}

compiler/rustc_session/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3433,7 +3433,7 @@ pub enum Polonius {
34333433

34343434
impl Default for Polonius {
34353435
fn default() -> Self {
3436-
Polonius::Off
3436+
Polonius::Next
34373437
}
34383438
}
34393439

0 commit comments

Comments
 (0)