@@ -20,7 +20,7 @@ use rustc_span::Span;
2020use tracing:: { debug, instrument, trace} ;
2121
2222use crate :: ConstraintCategory ;
23- use crate :: constraints:: graph:: { ConstraintGraph , Normal } ;
23+ use crate :: constraints:: graph:: { ConstraintGraph , Normal , RegionGraph } ;
2424use crate :: constraints:: { ConstraintSccIndex , OutlivesConstraintSet } ;
2525use crate :: consumers:: OutlivesConstraint ;
2626use crate :: diagnostics:: { RegionErrorKind , RegionErrors } ;
@@ -556,6 +556,8 @@ fn find_region<'tcx>(
556556 Visited ,
557557 }
558558
559+ let graph = RegionGraph :: new ( constraints, graph, fr_static) ;
560+
559561 let mut context = IndexVec :: from_elem ( Trace :: NotVisited , definitions) ;
560562 context[ start_region] = Trace :: StartRegion ;
561563
@@ -567,11 +569,7 @@ fn find_region<'tcx>(
567569 return r;
568570 }
569571
570- let outgoing_edges_from_graph = graph. outgoing_edges ( r, constraints, Some ( fr_static) ) ;
571-
572- for constraint in outgoing_edges_from_graph {
573- debug_assert_eq ! ( constraint. sup, r) ;
574- let sub_region = constraint. sub ;
572+ for sub_region in graph. outgoing_regions ( r) {
575573 if let Trace :: NotVisited = context[ sub_region] {
576574 context[ sub_region] = Trace :: Visited ;
577575 deque. push_back ( sub_region) ;
0 commit comments