@@ -9,7 +9,7 @@ use rustc_middle::mir::{
99 BasicBlock , Body , ClosureOutlivesSubject , ClosureRegionRequirements , LocalKind , Location ,
1010 Promoted ,
1111} ;
12- use rustc_middle:: ty:: { self , InstanceDef , RegionKind , RegionVid } ;
12+ use rustc_middle:: ty:: { self , RegionKind , RegionVid } ;
1313use rustc_span:: symbol:: sym;
1414use std:: env;
1515use std:: fmt:: Debug ;
@@ -24,7 +24,6 @@ use polonius_engine::{Algorithm, Output};
2424use crate :: dataflow:: impls:: MaybeInitializedPlaces ;
2525use crate :: dataflow:: move_paths:: { InitKind , InitLocation , MoveData } ;
2626use crate :: dataflow:: ResultsCursor ;
27- use crate :: transform:: MirSource ;
2827use crate :: util as mir_util;
2928use crate :: util:: pretty;
3029
@@ -72,8 +71,7 @@ pub(in crate::borrow_check) fn replace_regions_in_mir<'cx, 'tcx>(
7271 // Replace all remaining regions with fresh inference variables.
7372 renumber:: renumber_mir ( infcx, body, promoted) ;
7473
75- let source = MirSource { instance : InstanceDef :: Item ( def. to_global ( ) ) , promoted : None } ;
76- mir_util:: dump_mir ( infcx. tcx , None , "renumber" , & 0 , source, body, |_, _| Ok ( ( ) ) ) ;
74+ mir_util:: dump_mir ( infcx. tcx , None , "renumber" , & 0 , body, |_, _| Ok ( ( ) ) ) ;
7775
7876 universal_regions
7977}
@@ -315,16 +313,15 @@ pub(in crate::borrow_check) fn compute_regions<'cx, 'tcx>(
315313
316314pub ( super ) fn dump_mir_results < ' a , ' tcx > (
317315 infcx : & InferCtxt < ' a , ' tcx > ,
318- source : MirSource < ' tcx > ,
319316 body : & Body < ' tcx > ,
320317 regioncx : & RegionInferenceContext < ' tcx > ,
321318 closure_region_requirements : & Option < ClosureRegionRequirements < ' _ > > ,
322319) {
323- if !mir_util:: dump_enabled ( infcx. tcx , "nll" , source. def_id ( ) ) {
320+ if !mir_util:: dump_enabled ( infcx. tcx , "nll" , body . source . def_id ( ) ) {
324321 return ;
325322 }
326323
327- mir_util:: dump_mir ( infcx. tcx , None , "nll" , & 0 , source , body, |pass_where, out| {
324+ mir_util:: dump_mir ( infcx. tcx , None , "nll" , & 0 , body, |pass_where, out| {
328325 match pass_where {
329326 // Before the CFG, dump out the values for each region variable.
330327 PassWhere :: BeforeCFG => {
@@ -352,14 +349,14 @@ pub(super) fn dump_mir_results<'a, 'tcx>(
352349 // Also dump the inference graph constraints as a graphviz file.
353350 let _: io:: Result < ( ) > = try {
354351 let mut file =
355- pretty:: create_dump_file ( infcx. tcx , "regioncx.all.dot" , None , "nll" , & 0 , source) ?;
352+ pretty:: create_dump_file ( infcx. tcx , "regioncx.all.dot" , None , "nll" , & 0 , body . source ) ?;
356353 regioncx. dump_graphviz_raw_constraints ( & mut file) ?;
357354 } ;
358355
359356 // Also dump the inference graph constraints as a graphviz file.
360357 let _: io:: Result < ( ) > = try {
361358 let mut file =
362- pretty:: create_dump_file ( infcx. tcx , "regioncx.scc.dot" , None , "nll" , & 0 , source) ?;
359+ pretty:: create_dump_file ( infcx. tcx , "regioncx.scc.dot" , None , "nll" , & 0 , body . source ) ?;
363360 regioncx. dump_graphviz_scc_constraints ( & mut file) ?;
364361 } ;
365362}
0 commit comments