@@ -44,25 +44,27 @@ impl<X: Cx> GlobalCache<X> {
44
44
cx : X ,
45
45
input : X :: Input ,
46
46
47
- result : X :: Result ,
47
+ origin_result : X :: Result ,
48
48
dep_node : X :: DepNodeIndex ,
49
49
50
50
additional_depth : usize ,
51
51
encountered_overflow : bool ,
52
52
nested_goals : NestedGoals < X > ,
53
53
) {
54
- let result = cx. mk_tracked ( result , dep_node) ;
54
+ let result = cx. mk_tracked ( origin_result , dep_node) ;
55
55
let entry = self . map . entry ( input) . or_default ( ) ;
56
56
if encountered_overflow {
57
57
let with_overflow = WithOverflow { nested_goals, result } ;
58
58
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
+ }
62
63
} else {
63
64
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) ;
66
68
}
67
69
}
68
70
}
0 commit comments