@@ -124,8 +124,8 @@ impl<'tcx> ReuseableProvisionalCacheEntry<'tcx> {
124
124
let actual = match stack[ stack_depth] . provisional_result {
125
125
Some ( actual) => actual,
126
126
None => {
127
- let is_coinductive_cycle =
128
- self . is_coinductive && SearchGraph :: stack_coinductive_from ( tcx, stack, stack_depth) ;
127
+ let is_coinductive_cycle = self . is_coinductive
128
+ && SearchGraph :: stack_coinductive_from ( tcx, stack, stack_depth) ;
129
129
let input = stack[ stack_depth] . input ;
130
130
if is_coinductive_cycle {
131
131
SearchGraph :: response_no_constraints ( tcx, input, Certainty :: Yes )
@@ -265,20 +265,24 @@ impl<'tcx> CycleData<'tcx> {
265
265
let mut heads = entry. heads ;
266
266
267
267
for head in heads. iter ( ) . copied ( ) {
268
- let is_coinductive_cycle =
269
- entry . is_coinductive && SearchGraph :: stack_coinductive_from ( tcx, stack, head) ;
270
-
268
+ let is_coinductive_cycle = entry . is_coinductive
269
+ && SearchGraph :: stack_coinductive_from ( tcx, stack, head) ;
270
+
271
271
if is_coinductive_cycle {
272
272
stack[ head] . has_been_used |= HasBeenUsed :: COINDUCTIVE_CYCLE
273
273
} else {
274
274
stack[ head] . has_been_used |= HasBeenUsed :: INDUCTIVE_CYCLE
275
275
} ;
276
276
}
277
277
heads. push ( stack. next_index ( ) ) ;
278
- cache_entry. with_inductive_stack =
279
- Some ( DetachedEntry { heads : heads. clone ( ) , result : entry. result } ) ;
280
- cache_entry. with_coinductive_stack =
281
- Some ( DetachedEntry { heads, result : entry. result } ) ;
278
+
279
+ if entry. is_coinductive {
280
+ cache_entry. with_coinductive_stack =
281
+ Some ( DetachedEntry { heads, result : entry. result } ) ;
282
+ } else {
283
+ cache_entry. with_inductive_stack =
284
+ Some ( DetachedEntry { heads : heads. clone ( ) , result : entry. result } ) ;
285
+ }
282
286
}
283
287
}
284
288
Some ( result. result )
0 commit comments