@@ -43,9 +43,7 @@ pub(super) fn compute<T: FactTypes>(
43
43
let loan_live_at = iteration. variable :: < ( ( T :: Loan , T :: Point ) , ( ) ) > ( "loan_live_at" ) ;
44
44
45
45
// `loan_invalidated_at` facts, stored ready for joins
46
- let loan_invalidated_at =
47
- iteration. variable :: < ( ( T :: Loan , T :: Point ) , ( ) ) > ( "loan_invalidated_at" ) ;
48
- loan_invalidated_at. extend (
46
+ let loan_invalidated_at = Relation :: from_iter (
49
47
ctx. loan_invalidated_at
50
48
. iter ( )
51
49
. map ( |& ( loan, point) | ( ( loan, point) , ( ) ) ) ,
@@ -112,7 +110,7 @@ pub(super) fn compute<T: FactTypes>(
112
110
// .. and then start iterating rules!
113
111
while iteration. changed ( ) {
114
112
// Cleanup step: remove symmetries
115
- // - remove regions which are `subset`s of themselves
113
+ // - remove origins which are `subset`s of themselves
116
114
//
117
115
// FIXME: investigate whether is there a better way to do that without complicating
118
116
// the rules too much, because it would also require temporary variables and
@@ -222,12 +220,16 @@ pub(super) fn compute<T: FactTypes>(
222
220
223
221
// Rule 8: compute illegal access errors, i.e. an invalidation of a live loan.
224
222
//
223
+ // Here again, this join acts as a pure filter and could be a more efficient leapjoin.
224
+ // However, similarly to the `origin_live_on_entry` example described above, the
225
+ // leapjoin with a single `filter_with` leaper would currently not be well-formed.
226
+ //
225
227
// errors(Loan, Point) :-
226
228
// loan_invalidated_at(Loan, Point),
227
229
// loan_live_at(Loan, Point).
228
230
errors. from_join (
229
- & loan_invalidated_at,
230
231
& loan_live_at,
232
+ & loan_invalidated_at,
231
233
|& ( loan, point) , _, _| ( loan, point) ,
232
234
) ;
233
235
0 commit comments