introduce beginnings of polonius MIR dump

This is mostly for test purposes to show the localized constraints until
the MIR debugger is set up.
This commit is contained in:
Rémy Rakic
2024-12-13 15:44:39 +00:00
parent ee93ce9c61
commit c75c5176c5
4 changed files with 118 additions and 0 deletions

View File

@@ -316,6 +316,16 @@ fn do_mir_borrowck<'tcx>(
mbcx.report_move_errors();
// If requested, dump polonius MIR.
polonius::dump_polonius_mir(
&infcx,
body,
&regioncx,
&borrow_set,
&localized_outlives_constraints,
&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