diff options
| author | lcnr <rust@lcnr.de> | 2025-04-11 11:24:24 +0200 |
|---|---|---|
| committer | lcnr <rust@lcnr.de> | 2025-04-11 12:12:34 +0200 |
| commit | 2c65469c2751f11e93e3cc5a9b1dcf1856039196 (patch) | |
| tree | 98ee46ec3bbb34731ea6f075f326af8abdb06a3c /compiler | |
| parent | 0e294f2c2f56c688ea14acdeb03f491268f260ac (diff) | |
| download | rust-2c65469c2751f11e93e3cc5a9b1dcf1856039196.tar.gz rust-2c65469c2751f11e93e3cc5a9b1dcf1856039196.zip | |
move `dump_polonius_mir`
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_borrowck/src/lib.rs | 18 | ||||
| -rw-r--r-- | compiler/rustc_borrowck/src/polonius/dump.rs | 2 |
2 files changed, 9 insertions, 11 deletions
diff --git a/compiler/rustc_borrowck/src/lib.rs b/compiler/rustc_borrowck/src/lib.rs index e9b9cdf6e20..820952283bd 100644 --- a/compiler/rustc_borrowck/src/lib.rs +++ b/compiler/rustc_borrowck/src/lib.rs @@ -348,6 +348,14 @@ fn do_mir_borrowck<'tcx>( // Dump MIR results into a file, if that is enabled. This lets us // write unit-tests, as well as helping with debugging. nll::dump_nll_mir(&infcx, body, ®ioncx, &opt_closure_req, &borrow_set); + polonius::dump_polonius_mir( + &infcx, + body, + ®ioncx, + &opt_closure_req, + &borrow_set, + polonius_diagnostics.as_ref(), + ); // We also have a `#[rustc_regions]` annotation that causes us to dump // information. @@ -465,16 +473,6 @@ fn do_mir_borrowck<'tcx>( mbcx.report_move_errors(); - // If requested, dump polonius MIR. - polonius::dump_polonius_mir( - &infcx, - body, - ®ioncx, - &borrow_set, - polonius_diagnostics.as_ref(), - &opt_closure_req, - ); - // For each non-user used mutable variable, check if it's been assigned from // a user-declared local. If so, then put that local into the used_mut set. // Note that this set is expected to be small - only upvars from closures diff --git a/compiler/rustc_borrowck/src/polonius/dump.rs b/compiler/rustc_borrowck/src/polonius/dump.rs index eb53a98832c..6a943e19208 100644 --- a/compiler/rustc_borrowck/src/polonius/dump.rs +++ b/compiler/rustc_borrowck/src/polonius/dump.rs @@ -24,9 +24,9 @@ pub(crate) fn dump_polonius_mir<'tcx>( infcx: &BorrowckInferCtxt<'tcx>, body: &Body<'tcx>, regioncx: &RegionInferenceContext<'tcx>, + closure_region_requirements: &Option<ClosureRegionRequirements<'tcx>>, borrow_set: &BorrowSet<'tcx>, polonius_diagnostics: Option<&PoloniusDiagnosticsContext>, - closure_region_requirements: &Option<ClosureRegionRequirements<'tcx>>, ) { let tcx = infcx.tcx; if !tcx.sess.opts.unstable_opts.polonius.is_next_enabled() { |
