@@ -44,25 +44,27 @@ impl<X: Cx> GlobalCache<X> {
4444 cx : X ,
4545 input : X :: Input ,
4646
47- result : X :: Result ,
47+ origin_result : X :: Result ,
4848 dep_node : X :: DepNodeIndex ,
4949
5050 additional_depth : usize ,
5151 encountered_overflow : bool ,
5252 nested_goals : NestedGoals < X > ,
5353 ) {
54- let result = cx. mk_tracked ( result , dep_node) ;
54+ let result = cx. mk_tracked ( origin_result , dep_node) ;
5555 let entry = self . map . entry ( input) . or_default ( ) ;
5656 if encountered_overflow {
5757 let with_overflow = WithOverflow { nested_goals, result } ;
5858 let prev = entry. with_overflow . insert ( additional_depth, with_overflow) ;
59- if !cx. evaluation_is_concurrent ( ) {
60- assert ! ( prev. is_none( ) ) ;
61- } ;
59+ if let Some ( prev) = & prev {
60+ assert ! ( cx. evaluation_is_concurrent( ) ) ;
61+ assert_eq ! ( cx. get_tracked( & prev. result) , origin_result) ;
62+ }
6263 } else {
6364 let prev = entry. success . replace ( Success { additional_depth, nested_goals, result } ) ;
64- if !cx. evaluation_is_concurrent ( ) {
65- assert ! ( prev. is_none( ) ) ;
65+ if let Some ( prev) = & prev {
66+ assert ! ( cx. evaluation_is_concurrent( ) ) ;
67+ assert_eq ! ( cx. get_tracked( & prev. result) , origin_result) ;
6668 }
6769 }
6870 }
0 commit comments