@@ -23,8 +23,8 @@ pub(crate) type ReverseConstraintGraph = ConstraintGraph<Reverse>;
23
23
/// Marker trait that controls whether a `R1: R2` constraint
24
24
/// represents an edge `R1 -> R2` or `R2 -> R1`.
25
25
pub ( crate ) trait ConstraintGraphDirection : Copy + ' static {
26
- fn start_region ( c : & OutlivesConstraint < ' _ > ) -> RegionVid ;
27
- fn end_region ( c : & OutlivesConstraint < ' _ > ) -> RegionVid ;
26
+ fn start_region ( sup : RegionVid , sub : RegionVid ) -> RegionVid ;
27
+ fn end_region ( sup : RegionVid , sub : RegionVid ) -> RegionVid ;
28
28
fn is_normal ( ) -> bool ;
29
29
}
30
30
@@ -36,12 +36,12 @@ pub(crate) trait ConstraintGraphDirection: Copy + 'static {
36
36
pub ( crate ) struct Normal ;
37
37
38
38
impl ConstraintGraphDirection for Normal {
39
- fn start_region ( c : & OutlivesConstraint < ' _ > ) -> RegionVid {
40
- c . sup
39
+ fn start_region ( sup : RegionVid , _sub : RegionVid ) -> RegionVid {
40
+ sup
41
41
}
42
42
43
- fn end_region ( c : & OutlivesConstraint < ' _ > ) -> RegionVid {
44
- c . sub
43
+ fn end_region ( _sup : RegionVid , sub : RegionVid ) -> RegionVid {
44
+ sub
45
45
}
46
46
47
47
fn is_normal ( ) -> bool {
@@ -57,12 +57,12 @@ impl ConstraintGraphDirection for Normal {
57
57
pub ( crate ) struct Reverse ;
58
58
59
59
impl ConstraintGraphDirection for Reverse {
60
- fn start_region ( c : & OutlivesConstraint < ' _ > ) -> RegionVid {
61
- c . sub
60
+ fn start_region ( _sup : RegionVid , sub : RegionVid ) -> RegionVid {
61
+ sub
62
62
}
63
63
64
- fn end_region ( c : & OutlivesConstraint < ' _ > ) -> RegionVid {
65
- c . sup
64
+ fn end_region ( sup : RegionVid , _sub : RegionVid ) -> RegionVid {
65
+ sup
66
66
}
67
67
68
68
fn is_normal ( ) -> bool {
@@ -84,7 +84,7 @@ impl<D: ConstraintGraphDirection> ConstraintGraph<D> {
84
84
let mut next_constraints = IndexVec :: from_elem ( None , & set. outlives ) ;
85
85
86
86
for ( idx, constraint) in set. outlives . iter_enumerated ( ) . rev ( ) {
87
- let head = & mut first_constraints[ D :: start_region ( constraint) ] ;
87
+ let head = & mut first_constraints[ D :: start_region ( constraint. sup , constraint . sub ) ] ;
88
88
let next = & mut next_constraints[ idx] ;
89
89
debug_assert ! ( next. is_none( ) ) ;
90
90
* next = * head;
@@ -207,7 +207,7 @@ impl<'a, 'tcx, D: ConstraintGraphDirection> Iterator for Successors<'a, 'tcx, D>
207
207
type Item = RegionVid ;
208
208
209
209
fn next ( & mut self ) -> Option < Self :: Item > {
210
- self . edges . next ( ) . map ( |c| D :: end_region ( & c ) )
210
+ self . edges . next ( ) . map ( |c| D :: end_region ( c . sup , c . sub ) )
211
211
}
212
212
}
213
213
0 commit comments