@@ -20,7 +20,7 @@ use rustc_span::Span;
20
20
use tracing:: { debug, instrument, trace} ;
21
21
22
22
use crate :: ConstraintCategory ;
23
- use crate :: constraints:: graph:: { ConstraintGraph , Normal } ;
23
+ use crate :: constraints:: graph:: { ConstraintGraph , Normal , RegionGraph } ;
24
24
use crate :: constraints:: { ConstraintSccIndex , OutlivesConstraintSet } ;
25
25
use crate :: consumers:: OutlivesConstraint ;
26
26
use crate :: diagnostics:: { RegionErrorKind , RegionErrors } ;
@@ -556,6 +556,8 @@ fn find_region<'tcx>(
556
556
Visited ,
557
557
}
558
558
559
+ let graph = RegionGraph :: new ( constraints, graph, fr_static) ;
560
+
559
561
let mut context = IndexVec :: from_elem ( Trace :: NotVisited , definitions) ;
560
562
context[ start_region] = Trace :: StartRegion ;
561
563
@@ -567,11 +569,7 @@ fn find_region<'tcx>(
567
569
return r;
568
570
}
569
571
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) {
575
573
if let Trace :: NotVisited = context[ sub_region] {
576
574
context[ sub_region] = Trace :: Visited ;
577
575
deque. push_back ( sub_region) ;
0 commit comments