File tree 1 file changed +9
-0
lines changed
src/librustc_mir/borrow_check/nll
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,10 @@ impl ConstraintSet {
38
38
}
39
39
}
40
40
41
+ /// Once all constraints have been added, `link()` is used to thread together the constraints
42
+ /// based on which would be affected when a particular region changes. See the next field of
43
+ /// `OutlivesContraint` for more details.
44
+ /// link returns a map that is needed later by `each_affected_by_dirty`.
41
45
pub fn link ( & mut self , len : usize ) -> IndexVec < RegionVid , Option < ConstraintIndex > > {
42
46
let mut map = IndexVec :: from_elem_n ( None , len) ;
43
47
@@ -51,6 +55,11 @@ impl ConstraintSet {
51
55
map
52
56
}
53
57
58
+ /// When a region R1 changes, we need to reprocess all constraints R2: R1 to take into account
59
+ /// any new elements that R1 now has. This method will quickly enumerate all such constraints
60
+ /// (that is, constraints where R1 is in the "subregion" position).
61
+ /// To use it, invoke with `map[R1]` where map is the map returned by `link`;
62
+ /// the callback op will be invoked for each affected constraint.
54
63
pub fn each_affected_by_dirty (
55
64
& self ,
56
65
mut opt_dep_idx : Option < ConstraintIndex > ,
You can’t perform that action at this time.
0 commit comments