@@ -199,27 +199,27 @@ impl UsageKind {
199
199
/// This is a necessary condition to rebase provisional cache
200
200
/// entries.
201
201
#[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
202
- pub enum AllPathsToHeadCoinductive {
202
+ pub enum AllPathsToHeadForcedAmbiguity {
203
203
Yes ,
204
204
No ,
205
205
}
206
- impl From < PathKind > for AllPathsToHeadCoinductive {
207
- fn from ( path : PathKind ) -> AllPathsToHeadCoinductive {
206
+ impl From < PathKind > for AllPathsToHeadForcedAmbiguity {
207
+ fn from ( path : PathKind ) -> AllPathsToHeadForcedAmbiguity {
208
208
match path {
209
- PathKind :: Coinductive => AllPathsToHeadCoinductive :: Yes ,
210
- _ => AllPathsToHeadCoinductive :: No ,
209
+ PathKind :: ForcedAmbiguity => AllPathsToHeadForcedAmbiguity :: Yes ,
210
+ _ => AllPathsToHeadForcedAmbiguity :: No ,
211
211
}
212
212
}
213
213
}
214
- impl AllPathsToHeadCoinductive {
214
+ impl AllPathsToHeadForcedAmbiguity {
215
215
#[ must_use]
216
216
fn merge ( self , other : impl Into < Self > ) -> Self {
217
217
match ( self , other. into ( ) ) {
218
- ( AllPathsToHeadCoinductive :: Yes , AllPathsToHeadCoinductive :: Yes ) => {
219
- AllPathsToHeadCoinductive :: Yes
218
+ ( AllPathsToHeadForcedAmbiguity :: Yes , AllPathsToHeadForcedAmbiguity :: Yes ) => {
219
+ AllPathsToHeadForcedAmbiguity :: Yes
220
220
}
221
- ( AllPathsToHeadCoinductive :: No , _) | ( _, AllPathsToHeadCoinductive :: No ) => {
222
- AllPathsToHeadCoinductive :: No
221
+ ( AllPathsToHeadForcedAmbiguity :: No , _) | ( _, AllPathsToHeadForcedAmbiguity :: No ) => {
222
+ AllPathsToHeadForcedAmbiguity :: No
223
223
}
224
224
}
225
225
}
@@ -269,7 +269,7 @@ impl AvailableDepth {
269
269
/// when rebasing provisional cache results.
270
270
#[ derive( Clone , Debug , PartialEq , Eq , Default ) ]
271
271
struct CycleHeads {
272
- heads : BTreeMap < StackDepth , AllPathsToHeadCoinductive > ,
272
+ heads : BTreeMap < StackDepth , AllPathsToHeadForcedAmbiguity > ,
273
273
}
274
274
275
275
impl CycleHeads {
@@ -297,19 +297,19 @@ impl CycleHeads {
297
297
fn insert (
298
298
& mut self ,
299
299
head : StackDepth ,
300
- path_from_entry : impl Into < AllPathsToHeadCoinductive > + Copy ,
300
+ path_from_entry : impl Into < AllPathsToHeadForcedAmbiguity > + Copy ,
301
301
) {
302
302
self . heads . entry ( head) . or_insert ( path_from_entry. into ( ) ) . and_merge ( path_from_entry) ;
303
303
}
304
304
305
305
fn merge ( & mut self , heads : & CycleHeads ) {
306
306
for ( & head, & path_from_entry) in heads. heads . iter ( ) {
307
307
self . insert ( head, path_from_entry) ;
308
- debug_assert ! ( matches!( self . heads[ & head] , AllPathsToHeadCoinductive :: Yes ) ) ;
308
+ debug_assert ! ( matches!( self . heads[ & head] , AllPathsToHeadForcedAmbiguity :: Yes ) ) ;
309
309
}
310
310
}
311
311
312
- fn iter ( & self ) -> impl Iterator < Item = ( StackDepth , AllPathsToHeadCoinductive ) > + ' _ {
312
+ fn iter ( & self ) -> impl Iterator < Item = ( StackDepth , AllPathsToHeadForcedAmbiguity ) > + ' _ {
313
313
self . heads . iter ( ) . map ( |( k, v) | ( * k, * v) )
314
314
}
315
315
@@ -325,9 +325,8 @@ impl CycleHeads {
325
325
}
326
326
327
327
let path_from_entry = match step_kind {
328
- PathKind :: Coinductive => AllPathsToHeadCoinductive :: Yes ,
329
- // TODO
330
- PathKind :: Unknown | PathKind :: Inductive | PathKind :: ForcedAmbiguity => {
328
+ PathKind :: ForcedAmbiguity => AllPathsToHeadForcedAmbiguity :: Yes ,
329
+ PathKind :: Unknown | PathKind :: Inductive | PathKind :: Coinductive => {
331
330
path_from_entry
332
331
}
333
332
} ;
@@ -873,12 +872,12 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D> {
873
872
// to its heads are coinductive. In this case these cycle
874
873
// kinds won't change, no matter the goals between these
875
874
// heads and the provisional cache entry.
876
- if heads. iter ( ) . any ( |( _, p) | matches ! ( p, AllPathsToHeadCoinductive :: No ) ) {
875
+ if heads. iter ( ) . any ( |( _, p) | matches ! ( p, AllPathsToHeadForcedAmbiguity :: No ) ) {
877
876
return false ;
878
877
}
879
878
880
879
// The same for nested goals of the cycle head.
881
- if stack_entry. heads . iter ( ) . any ( |( _, p) | matches ! ( p, AllPathsToHeadCoinductive :: No ) )
880
+ if stack_entry. heads . iter ( ) . any ( |( _, p) | matches ! ( p, AllPathsToHeadForcedAmbiguity :: No ) )
882
881
{
883
882
return false ;
884
883
}
0 commit comments