8
8
// option. This file may not be copied, modified, or distributed
9
9
// except according to those terms.
10
10
11
- use rustc_data_structures:: indexed_vec:: { Idx , IndexVec } ;
12
- use rustc_data_structures:: fx:: FxHashSet ;
13
- use rustc:: ty:: RegionVid ;
14
11
use rustc:: mir:: Location ;
12
+ use rustc:: ty:: RegionVid ;
13
+ use rustc_data_structures:: fx:: FxHashSet ;
14
+ use rustc_data_structures:: indexed_vec:: { Idx , IndexVec } ;
15
15
16
16
use std:: fmt;
17
17
use syntax_pos:: Span ;
@@ -23,15 +23,11 @@ crate struct ConstraintSet {
23
23
}
24
24
25
25
impl ConstraintSet {
26
- pub fn new ( ) -> Self {
27
- Default :: default ( )
28
- }
29
-
30
26
pub fn push ( & mut self , constraint : OutlivesConstraint ) {
31
- debug ! ( "add_outlives({:?}: {:?} @ {:?}" ,
32
- constraint . sup ,
33
- constraint. sub,
34
- constraint . point ) ;
27
+ debug ! (
28
+ "add_outlives({:?}: {:?} @ {:?}" ,
29
+ constraint . sup , constraint. sub, constraint . point
30
+ ) ;
35
31
if constraint. sup == constraint. sub {
36
32
// 'a: 'a is pretty uninteresting
37
33
return ;
@@ -57,6 +53,17 @@ impl ConstraintSet {
57
53
58
54
map
59
55
}
56
+
57
+ pub fn each_affected_by_dirty (
58
+ & self ,
59
+ mut opt_dep_idx : Option < ConstraintIndex > ,
60
+ mut op : impl FnMut ( ConstraintIndex ) ,
61
+ ) {
62
+ while let Some ( dep_idx) = opt_dep_idx {
63
+ op ( dep_idx) ;
64
+ opt_dep_idx = self . constraints [ dep_idx] . next ;
65
+ }
66
+ }
60
67
}
61
68
62
69
#[ derive( Copy , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
@@ -105,4 +112,3 @@ impl fmt::Debug for OutlivesConstraint {
105
112
}
106
113
107
114
newtype_index ! ( ConstraintIndex { DEBUG_FORMAT = "ConstraintIndex({})" } ) ;
108
-
0 commit comments