@@ -369,17 +369,6 @@ impl Default for MemberLookupPolicy {
369369 }
370370}
371371
372- fn member_lookup_cycle_recover < ' db > (
373- _db : & ' db dyn Db ,
374- _value : & PlaceAndQualifiers < ' db > ,
375- _count : u32 ,
376- _self : Type < ' db > ,
377- _name : Name ,
378- _policy : MemberLookupPolicy ,
379- ) -> salsa:: CycleRecoveryAction < PlaceAndQualifiers < ' db > > {
380- salsa:: CycleRecoveryAction :: Iterate
381- }
382-
383372fn member_lookup_cycle_initial < ' db > (
384373 _db : & ' db dyn Db ,
385374 _self : Type < ' db > ,
@@ -389,17 +378,6 @@ fn member_lookup_cycle_initial<'db>(
389378 Place :: bound ( Type :: Never ) . into ( )
390379}
391380
392- fn class_lookup_cycle_recover < ' db > (
393- _db : & ' db dyn Db ,
394- _value : & PlaceAndQualifiers < ' db > ,
395- _count : u32 ,
396- _self : Type < ' db > ,
397- _name : Name ,
398- _policy : MemberLookupPolicy ,
399- ) -> salsa:: CycleRecoveryAction < PlaceAndQualifiers < ' db > > {
400- salsa:: CycleRecoveryAction :: Iterate
401- }
402-
403381fn class_lookup_cycle_initial < ' db > (
404382 _db : & ' db dyn Db ,
405383 _self : Type < ' db > ,
@@ -409,21 +387,6 @@ fn class_lookup_cycle_initial<'db>(
409387 Place :: bound ( Type :: Never ) . into ( )
410388}
411389
412- #[ allow( clippy:: trivially_copy_pass_by_ref) ]
413- fn variance_cycle_recover < ' db , T > (
414- _db : & ' db dyn Db ,
415- _value : & TypeVarVariance ,
416- count : u32 ,
417- _self : T ,
418- _typevar : BoundTypeVarInstance < ' db > ,
419- ) -> salsa:: CycleRecoveryAction < TypeVarVariance > {
420- assert ! (
421- count <= 2 ,
422- "Should only be able to cycle at most twice: there are only three levels in the lattice, each cycle should move us one"
423- ) ;
424- salsa:: CycleRecoveryAction :: Iterate
425- }
426-
427390fn variance_cycle_initial < ' db , T > (
428391 _db : & ' db dyn Db ,
429392 _self : T ,
@@ -1582,7 +1545,7 @@ impl<'db> Type<'db> {
15821545 /// Return `true` if it would be redundant to add `self` to a union that already contains `other`.
15831546 ///
15841547 /// See [`TypeRelation::Redundancy`] for more details.
1585- #[ salsa:: tracked( cycle_fn=is_redundant_with_cycle_recover , cycle_initial=is_redundant_with_cycle_initial, heap_size=ruff_memory_usage:: heap_size) ]
1548+ #[ salsa:: tracked( cycle_initial=is_redundant_with_cycle_initial, heap_size=ruff_memory_usage:: heap_size) ]
15861549 pub ( crate ) fn is_redundant_with ( self , db : & ' db dyn Db , other : Type < ' db > ) -> bool {
15871550 self . has_relation_to ( db, other, InferableTypeVars :: None , TypeRelation :: Redundancy )
15881551 . is_always_satisfied ( )
@@ -3628,7 +3591,7 @@ impl<'db> Type<'db> {
36283591 self . class_member_with_policy ( db, name, MemberLookupPolicy :: default ( ) )
36293592 }
36303593
3631- #[ salsa:: tracked( cycle_fn=class_lookup_cycle_recover , cycle_initial=class_lookup_cycle_initial, heap_size=ruff_memory_usage:: heap_size) ]
3594+ #[ salsa:: tracked( cycle_initial=class_lookup_cycle_initial, heap_size=ruff_memory_usage:: heap_size) ]
36323595 fn class_member_with_policy (
36333596 self ,
36343597 db : & ' db dyn Db ,
@@ -4093,7 +4056,7 @@ impl<'db> Type<'db> {
40934056
40944057 /// Similar to [`Type::member`], but allows the caller to specify what policy should be used
40954058 /// when looking up attributes. See [`MemberLookupPolicy`] for more information.
4096- #[ salsa:: tracked( cycle_fn=member_lookup_cycle_recover , cycle_initial=member_lookup_cycle_initial, heap_size=ruff_memory_usage:: heap_size) ]
4059+ #[ salsa:: tracked( cycle_initial=member_lookup_cycle_initial, heap_size=ruff_memory_usage:: heap_size) ]
40974060 fn member_lookup_with_policy (
40984061 self ,
40994062 db : & ' db dyn Db ,
@@ -6616,7 +6579,7 @@ impl<'db> Type<'db> {
66166579 /// Note that this does not specialize generic classes, functions, or type aliases! That is a
66176580 /// different operation that is performed explicitly (via a subscript operation), or implicitly
66186581 /// via a call to the generic object.
6619- #[ salsa:: tracked( heap_size=ruff_memory_usage:: heap_size, cycle_fn=apply_specialization_cycle_recover , cycle_initial=apply_specialization_cycle_initial) ]
6582+ #[ salsa:: tracked( heap_size=ruff_memory_usage:: heap_size, cycle_initial=apply_specialization_cycle_initial) ]
66206583 pub ( crate ) fn apply_specialization (
66216584 self ,
66226585 db : & ' db dyn Db ,
@@ -7336,16 +7299,6 @@ impl<'db> VarianceInferable<'db> for Type<'db> {
73367299}
73377300
73387301#[ allow( clippy:: trivially_copy_pass_by_ref) ]
7339- fn is_redundant_with_cycle_recover < ' db > (
7340- _db : & ' db dyn Db ,
7341- _value : & bool ,
7342- _count : u32 ,
7343- _subtype : Type < ' db > ,
7344- _supertype : Type < ' db > ,
7345- ) -> salsa:: CycleRecoveryAction < bool > {
7346- salsa:: CycleRecoveryAction :: Iterate
7347- }
7348-
73497302fn is_redundant_with_cycle_initial < ' db > (
73507303 _db : & ' db dyn Db ,
73517304 _subtype : Type < ' db > ,
@@ -7354,16 +7307,6 @@ fn is_redundant_with_cycle_initial<'db>(
73547307 true
73557308}
73567309
7357- fn apply_specialization_cycle_recover < ' db > (
7358- _db : & ' db dyn Db ,
7359- _value : & Type < ' db > ,
7360- _count : u32 ,
7361- _self : Type < ' db > ,
7362- _specialization : Specialization < ' db > ,
7363- ) -> salsa:: CycleRecoveryAction < Type < ' db > > {
7364- salsa:: CycleRecoveryAction :: Iterate
7365- }
7366-
73677310fn apply_specialization_cycle_initial < ' db > (
73687311 _db : & ' db dyn Db ,
73697312 _self : Type < ' db > ,
@@ -8340,7 +8283,6 @@ impl<'db> TypeVarInstance<'db> {
83408283 }
83418284
83428285 #[ salsa:: tracked(
8343- cycle_fn=lazy_bound_or_constraints_cycle_recover,
83448286 cycle_initial=lazy_bound_or_constraints_cycle_initial,
83458287 heap_size=ruff_memory_usage:: heap_size
83468288 ) ]
@@ -8365,7 +8307,6 @@ impl<'db> TypeVarInstance<'db> {
83658307 }
83668308
83678309 #[ salsa:: tracked(
8368- cycle_fn=lazy_bound_or_constraints_cycle_recover,
83698310 cycle_initial=lazy_bound_or_constraints_cycle_initial,
83708311 heap_size=ruff_memory_usage:: heap_size
83718312 ) ]
@@ -8443,16 +8384,6 @@ impl<'db> TypeVarInstance<'db> {
84438384 }
84448385}
84458386
8446- #[ allow( clippy:: ref_option) ]
8447- fn lazy_bound_or_constraints_cycle_recover < ' db > (
8448- _db : & ' db dyn Db ,
8449- _value : & Option < TypeVarBoundOrConstraints < ' db > > ,
8450- _count : u32 ,
8451- _self : TypeVarInstance < ' db > ,
8452- ) -> salsa:: CycleRecoveryAction < Option < TypeVarBoundOrConstraints < ' db > > > {
8453- salsa:: CycleRecoveryAction :: Iterate
8454- }
8455-
84568387fn lazy_bound_or_constraints_cycle_initial < ' db > (
84578388 _db : & ' db dyn Db ,
84588389 _self : TypeVarInstance < ' db > ,
@@ -9975,16 +9906,6 @@ fn walk_bound_method_type<'db, V: visitor::TypeVisitor<'db> + ?Sized>(
99759906 visitor. visit_type ( db, method. self_instance ( db) ) ;
99769907}
99779908
9978- #[ allow( clippy:: trivially_copy_pass_by_ref) ]
9979- fn into_callable_type_cycle_recover < ' db > (
9980- _db : & ' db dyn Db ,
9981- _value : & CallableType < ' db > ,
9982- _count : u32 ,
9983- _self : BoundMethodType < ' db > ,
9984- ) -> salsa:: CycleRecoveryAction < CallableType < ' db > > {
9985- salsa:: CycleRecoveryAction :: Iterate
9986- }
9987-
99889909fn into_callable_type_cycle_initial < ' db > (
99899910 db : & ' db dyn Db ,
99909911 _self : BoundMethodType < ' db > ,
@@ -10013,7 +9934,7 @@ impl<'db> BoundMethodType<'db> {
100139934 Self :: new ( db, self . function ( db) , f ( self . self_instance ( db) ) )
100149935 }
100159936
10016- #[ salsa:: tracked( cycle_fn=into_callable_type_cycle_recover , cycle_initial=into_callable_type_cycle_initial, heap_size=ruff_memory_usage:: heap_size) ]
9937+ #[ salsa:: tracked( cycle_initial=into_callable_type_cycle_initial, heap_size=ruff_memory_usage:: heap_size) ]
100179938 pub ( crate ) fn into_callable_type ( self , db : & ' db dyn Db ) -> CallableType < ' db > {
100189939 let function = self . function ( db) ;
100199940 let self_instance = self . typing_self_type ( db) ;
@@ -10777,7 +10698,7 @@ impl<'db> PEP695TypeAliasType<'db> {
1077710698 }
1077810699
1077910700 /// The RHS type of a PEP-695 style type alias with specialization applied.
10780- #[ salsa:: tracked( cycle_fn=value_type_cycle_recover , cycle_initial=value_type_cycle_initial, heap_size=ruff_memory_usage:: heap_size) ]
10701+ #[ salsa:: tracked( cycle_initial=value_type_cycle_initial, heap_size=ruff_memory_usage:: heap_size) ]
1078110702 pub ( crate ) fn value_type ( self , db : & ' db dyn Db ) -> Type < ' db > {
1078210703 let value_type = self . raw_value_type ( db) ;
1078310704
@@ -10840,7 +10761,7 @@ impl<'db> PEP695TypeAliasType<'db> {
1084010761 self . specialization ( db) . is_some ( )
1084110762 }
1084210763
10843- #[ salsa:: tracked( cycle_fn=generic_context_cycle_recover , cycle_initial=generic_context_cycle_initial, heap_size=ruff_memory_usage:: heap_size) ]
10764+ #[ salsa:: tracked( cycle_initial=generic_context_cycle_initial, heap_size=ruff_memory_usage:: heap_size) ]
1084410765 pub ( crate ) fn generic_context ( self , db : & ' db dyn Db ) -> Option < GenericContext < ' db > > {
1084510766 let scope = self . rhs_scope ( db) ;
1084610767 let file = scope. file ( db) ;
@@ -10863,32 +10784,13 @@ impl<'db> PEP695TypeAliasType<'db> {
1086310784 }
1086410785}
1086510786
10866- #[ allow( clippy:: ref_option, clippy:: trivially_copy_pass_by_ref) ]
10867- fn generic_context_cycle_recover < ' db > (
10868- _db : & ' db dyn Db ,
10869- _value : & Option < GenericContext < ' db > > ,
10870- _count : u32 ,
10871- _self : PEP695TypeAliasType < ' db > ,
10872- ) -> salsa:: CycleRecoveryAction < Option < GenericContext < ' db > > > {
10873- salsa:: CycleRecoveryAction :: Iterate
10874- }
10875-
1087610787fn generic_context_cycle_initial < ' db > (
1087710788 _db : & ' db dyn Db ,
1087810789 _self : PEP695TypeAliasType < ' db > ,
1087910790) -> Option < GenericContext < ' db > > {
1088010791 None
1088110792}
1088210793
10883- fn value_type_cycle_recover < ' db > (
10884- _db : & ' db dyn Db ,
10885- _value : & Type < ' db > ,
10886- _count : u32 ,
10887- _self : PEP695TypeAliasType < ' db > ,
10888- ) -> salsa:: CycleRecoveryAction < Type < ' db > > {
10889- salsa:: CycleRecoveryAction :: Iterate
10890- }
10891-
1089210794fn value_type_cycle_initial < ' db > ( _db : & ' db dyn Db , _self : PEP695TypeAliasType < ' db > ) -> Type < ' db > {
1089310795 Type :: Never
1089410796}
0 commit comments