@@ -71,7 +71,7 @@ struct StackEntry<I: Interner> {
71
71
/// C :- D
72
72
/// D :- C
73
73
/// ```
74
- cycle_participants : HashSet < CanonicalInput < I > > ,
74
+ nested_goals : HashSet < CanonicalInput < I > > ,
75
75
/// Starts out as `None` and gets set when rerunning this
76
76
/// goal in case we encounter a cycle.
77
77
provisional_result : Option < QueryResult < I > > ,
@@ -215,8 +215,8 @@ impl<I: Interner> SearchGraph<I> {
215
215
let current_cycle_root = & mut stack[ current_root. as_usize ( ) ] ;
216
216
for entry in cycle_participants {
217
217
entry. non_root_cycle_participant = entry. non_root_cycle_participant . max ( Some ( head) ) ;
218
- current_cycle_root. cycle_participants . insert ( entry. input ) ;
219
- current_cycle_root. cycle_participants . extend ( mem:: take ( & mut entry. cycle_participants ) ) ;
218
+ current_cycle_root. nested_goals . insert ( entry. input ) ;
219
+ current_cycle_root. nested_goals . extend ( mem:: take ( & mut entry. nested_goals ) ) ;
220
220
}
221
221
}
222
222
@@ -335,7 +335,7 @@ impl<I: Interner> SearchGraph<I> {
335
335
non_root_cycle_participant : None ,
336
336
encountered_overflow : false ,
337
337
has_been_used : HasBeenUsed :: empty ( ) ,
338
- cycle_participants : Default :: default ( ) ,
338
+ nested_goals : Default :: default ( ) ,
339
339
provisional_result : None ,
340
340
} ;
341
341
assert_eq ! ( self . stack. push( entry) , depth) ;
@@ -389,15 +389,15 @@ impl<I: Interner> SearchGraph<I> {
389
389
//
390
390
// We must not use the global cache entry of a root goal if a cycle
391
391
// participant is on the stack. This is necessary to prevent unstable
392
- // results. See the comment of `StackEntry::cycle_participants ` for
392
+ // results. See the comment of `StackEntry::nested_goals ` for
393
393
// more details.
394
394
self . global_cache ( cx) . insert (
395
395
cx,
396
396
input,
397
397
proof_tree,
398
398
reached_depth,
399
399
final_entry. encountered_overflow ,
400
- final_entry. cycle_participants ,
400
+ final_entry. nested_goals ,
401
401
dep_node,
402
402
result,
403
403
)
@@ -544,27 +544,27 @@ impl<I: Interner> SearchGraph<I> {
544
544
non_root_cycle_participant,
545
545
encountered_overflow : _,
546
546
has_been_used,
547
- ref cycle_participants ,
547
+ ref nested_goals ,
548
548
provisional_result,
549
549
} = * entry;
550
550
let cache_entry = provisional_cache. get ( & entry. input ) . unwrap ( ) ;
551
551
assert_eq ! ( cache_entry. stack_depth, Some ( depth) ) ;
552
552
if let Some ( head) = non_root_cycle_participant {
553
553
assert ! ( head < depth) ;
554
- assert ! ( cycle_participants . is_empty( ) ) ;
554
+ assert ! ( nested_goals . is_empty( ) ) ;
555
555
assert_ne ! ( stack[ head] . has_been_used, HasBeenUsed :: empty( ) ) ;
556
556
557
557
let mut current_root = head;
558
558
while let Some ( parent) = stack[ current_root] . non_root_cycle_participant {
559
559
current_root = parent;
560
560
}
561
- assert ! ( stack[ current_root] . cycle_participants . contains( & input) ) ;
561
+ assert ! ( stack[ current_root] . nested_goals . contains( & input) ) ;
562
562
}
563
563
564
- if !cycle_participants . is_empty ( ) {
564
+ if !nested_goals . is_empty ( ) {
565
565
assert ! ( provisional_result. is_some( ) || !has_been_used. is_empty( ) ) ;
566
566
for entry in stack. iter ( ) . take ( depth. as_usize ( ) ) {
567
- assert_eq ! ( cycle_participants . get( & entry. input) , None ) ;
567
+ assert_eq ! ( nested_goals . get( & entry. input) , None ) ;
568
568
}
569
569
}
570
570
}
0 commit comments