Skip to content

Commit 2c65469

Browse files
committed
move dump_polonius_mir
1 parent 0e294f2 commit 2c65469

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

Diff for: compiler/rustc_borrowck/src/lib.rs

+8-10
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,14 @@ fn do_mir_borrowck<'tcx>(
348348
// Dump MIR results into a file, if that is enabled. This lets us
349349
// write unit-tests, as well as helping with debugging.
350350
nll::dump_nll_mir(&infcx, body, &regioncx, &opt_closure_req, &borrow_set);
351+
polonius::dump_polonius_mir(
352+
&infcx,
353+
body,
354+
&regioncx,
355+
&opt_closure_req,
356+
&borrow_set,
357+
polonius_diagnostics.as_ref(),
358+
);
351359

352360
// We also have a `#[rustc_regions]` annotation that causes us to dump
353361
// information.
@@ -465,16 +473,6 @@ fn do_mir_borrowck<'tcx>(
465473

466474
mbcx.report_move_errors();
467475

468-
// If requested, dump polonius MIR.
469-
polonius::dump_polonius_mir(
470-
&infcx,
471-
body,
472-
&regioncx,
473-
&borrow_set,
474-
polonius_diagnostics.as_ref(),
475-
&opt_closure_req,
476-
);
477-
478476
// For each non-user used mutable variable, check if it's been assigned from
479477
// a user-declared local. If so, then put that local into the used_mut set.
480478
// Note that this set is expected to be small - only upvars from closures

Diff for: compiler/rustc_borrowck/src/polonius/dump.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ pub(crate) fn dump_polonius_mir<'tcx>(
2424
infcx: &BorrowckInferCtxt<'tcx>,
2525
body: &Body<'tcx>,
2626
regioncx: &RegionInferenceContext<'tcx>,
27+
closure_region_requirements: &Option<ClosureRegionRequirements<'tcx>>,
2728
borrow_set: &BorrowSet<'tcx>,
2829
polonius_diagnostics: Option<&PoloniusDiagnosticsContext>,
29-
closure_region_requirements: &Option<ClosureRegionRequirements<'tcx>>,
3030
) {
3131
let tcx = infcx.tcx;
3232
if !tcx.sess.opts.unstable_opts.polonius.is_next_enabled() {

0 commit comments

Comments
 (0)