@@ -252,10 +252,6 @@ struct Node<O: ForestObligation> {
252
252
obligation : O ,
253
253
state : Cell < NodeState > ,
254
254
255
- /// A predicate (and its key) can change during processing. If it does we need to register the
256
- /// old predicate so that we can remove or mark it as done if this node errors or is done.
257
- alternative_predicates : Vec < O :: CacheKey > ,
258
-
259
255
/// Obligations that depend on this obligation for their completion. They
260
256
/// must all be in a non-pending state.
261
257
dependents : Vec < NodeIndex > ,
@@ -291,7 +287,6 @@ where
291
287
Node {
292
288
obligation,
293
289
state : Cell :: new ( NodeState :: Pending ) ,
294
- alternative_predicates : vec ! [ ] ,
295
290
dependents : if let Some ( parent_index) = parent { vec ! [ parent_index] } else { vec ! [ ] } ,
296
291
reverse_dependents : vec ! [ ] ,
297
292
has_parent : parent. is_some ( ) ,
@@ -316,7 +311,6 @@ where
316
311
self . state
317
312
) ;
318
313
self . state . set ( NodeState :: Pending ) ;
319
- self . alternative_predicates . clear ( ) ;
320
314
self . dependents . clear ( ) ;
321
315
self . reverse_dependents . clear ( ) ;
322
316
if let Some ( parent_index) = parent {
@@ -625,6 +619,7 @@ impl<O: ForestObligation> ObligationForest<O> {
625
619
. drain ( ..)
626
620
. map ( |index| Unblocked { index, order : nodes[ index] . node_number } ) ,
627
621
) ;
622
+
628
623
while let Some ( Unblocked { index, .. } ) = self . unblocked . pop ( ) {
629
624
// Skip any duplicates since we only need to processes the node once
630
625
if self . unblocked . peek ( ) . map ( |u| u. index ) == Some ( index) {
@@ -665,12 +660,7 @@ impl<O: ForestObligation> ObligationForest<O> {
665
660
// `self.active_cache`. This means that `self.active_cache` can get
666
661
// out of sync with `nodes`. It's not very common, but it does
667
662
// happen, and code in `compress` has to allow for it.
668
- let before = node. obligation . as_cache_key ( ) ;
669
663
let result = processor. process_obligation ( & mut node. obligation ) ;
670
- let after = node. obligation . as_cache_key ( ) ;
671
- if before != after {
672
- node. alternative_predicates . push ( before) ;
673
- }
674
664
675
665
self . unblock_nodes ( processor) ;
676
666
let node = & mut self . nodes [ index] ;
@@ -940,16 +930,10 @@ impl<O: ForestObligation> ObligationForest<O> {
940
930
match node. state . get ( ) {
941
931
NodeState :: Done => {
942
932
// Mark as done
943
- if let Some ( opt) = self . active_cache . get_mut ( & node. obligation . as_cache_key ( ) ) {
944
- * opt = CacheState :: Done ;
945
- }
946
- // If the node's predicate changed at some point we mark all its alternate
947
- // predicates as done as well
948
- for alt in & node. alternative_predicates {
949
- if let Some ( opt) = self . active_cache . get_mut ( alt) {
950
- * opt = CacheState :: Done ;
951
- }
952
- }
933
+ * self
934
+ . active_cache
935
+ . entry ( node. obligation . as_cache_key ( ) )
936
+ . or_insert ( CacheState :: Done ) = CacheState :: Done ;
953
937
954
938
if do_completed == DoCompleted :: Yes {
955
939
// Extract the success stories.
@@ -965,11 +949,6 @@ impl<O: ForestObligation> ObligationForest<O> {
965
949
// tests must come up with a different type on every type error they
966
950
// check against.
967
951
self . active_cache . remove ( & node. obligation . as_cache_key ( ) ) ;
968
- // If the node's predicate changed at some point we remove all its alternate
969
- // predicates as well
970
- for alt in & node. alternative_predicates {
971
- self . active_cache . remove ( alt) ;
972
- }
973
952
self . insert_into_error_cache ( index) ;
974
953
self . dead_nodes . push ( index) ;
975
954
}
0 commit comments