@@ -149,7 +149,7 @@ pub struct ObligationForest<O: ForestObligation> {
149
149
/// A cache of the nodes in `nodes`, indexed by predicate. Unfortunately,
150
150
/// its contents are not guaranteed to match those of `nodes`. See the
151
151
/// comments in `process_obligation` for details.
152
- waiting_cache : FxHashMap < O :: Predicate , usize > ,
152
+ active_cache : FxHashMap < O :: Predicate , usize > ,
153
153
154
154
/// A scratch vector reused in various operations, to avoid allocating new
155
155
/// vectors.
@@ -278,7 +278,7 @@ impl<O: ForestObligation> ObligationForest<O> {
278
278
ObligationForest {
279
279
nodes : vec ! [ ] ,
280
280
done_cache : Default :: default ( ) ,
281
- waiting_cache : Default :: default ( ) ,
281
+ active_cache : Default :: default ( ) ,
282
282
scratch : RefCell :: new ( vec ! [ ] ) ,
283
283
obligation_tree_id_generator : ( 0 ..) . map ( ObligationTreeId ) ,
284
284
error_cache : Default :: default ( ) ,
@@ -303,15 +303,15 @@ impl<O: ForestObligation> ObligationForest<O> {
303
303
return Ok ( ( ) ) ;
304
304
}
305
305
306
- match self . waiting_cache . entry ( obligation. as_predicate ( ) . clone ( ) ) {
306
+ match self . active_cache . entry ( obligation. as_predicate ( ) . clone ( ) ) {
307
307
Entry :: Occupied ( o) => {
308
308
debug ! ( "register_obligation_at({:?}, {:?}) - duplicate of {:?}!" ,
309
309
obligation, parent, o. get( ) ) ;
310
310
let node = & mut self . nodes [ * o. get ( ) ] ;
311
311
if let Some ( parent_index) = parent {
312
- // If the node is already in `waiting_cache `, it has
313
- // already had its chance to be marked with a parent. So if
314
- // it's not already present, just dump `parent` into the
312
+ // If the node is already in `active_cache `, it has already
313
+ // had its chance to be marked with a parent. So if it's
314
+ // not already present, just dump `parent` into the
315
315
// dependents as a non-parent.
316
316
if !node. dependents . contains ( & parent_index) {
317
317
node. dependents . push ( parent_index) ;
@@ -405,8 +405,8 @@ impl<O: ForestObligation> ObligationForest<O> {
405
405
406
406
// `processor.process_obligation` can modify the predicate within
407
407
// `node.obligation`, and that predicate is the key used for
408
- // `self.waiting_cache `. This means that `self.waiting_cache ` can
409
- // get out of sync with `nodes`. It's not very common, but it does
408
+ // `self.active_cache `. This means that `self.active_cache ` can get
409
+ // out of sync with `nodes`. It's not very common, but it does
410
410
// happen, and code in `compress` has to allow for it.
411
411
let result = match node. state . get ( ) {
412
412
NodeState :: Pending => processor. process_obligation ( & mut node. obligation ) ,
@@ -637,11 +637,11 @@ impl<O: ForestObligation> ObligationForest<O> {
637
637
}
638
638
NodeState :: Done => {
639
639
// This lookup can fail because the contents of
640
- // `self.waiting_cache ` is not guaranteed to match those of
640
+ // `self.active_cache ` is not guaranteed to match those of
641
641
// `self.nodes`. See the comment in `process_obligation`
642
642
// for more details.
643
- if let Some ( ( predicate, _) ) = self . waiting_cache
644
- . remove_entry ( node. obligation . as_predicate ( ) )
643
+ if let Some ( ( predicate, _) ) =
644
+ self . active_cache . remove_entry ( node. obligation . as_predicate ( ) )
645
645
{
646
646
self . done_cache . insert ( predicate) ;
647
647
} else {
@@ -654,7 +654,7 @@ impl<O: ForestObligation> ObligationForest<O> {
654
654
// We *intentionally* remove the node from the cache at this point. Otherwise
655
655
// tests must come up with a different type on every type error they
656
656
// check against.
657
- self . waiting_cache . remove ( node. obligation . as_predicate ( ) ) ;
657
+ self . active_cache . remove ( node. obligation . as_predicate ( ) ) ;
658
658
node_rewrites[ index] = nodes_len;
659
659
dead_nodes += 1 ;
660
660
self . insert_into_error_cache ( index) ;
@@ -714,9 +714,9 @@ impl<O: ForestObligation> ObligationForest<O> {
714
714
}
715
715
}
716
716
717
- // This updating of `self.waiting_cache ` is necessary because the
717
+ // This updating of `self.active_cache ` is necessary because the
718
718
// removal of nodes within `compress` can fail. See above.
719
- self . waiting_cache . retain ( |_predicate, index| {
719
+ self . active_cache . retain ( |_predicate, index| {
720
720
let new_index = node_rewrites[ * index] ;
721
721
if new_index >= nodes_len {
722
722
false
0 commit comments