diff --git a/crates/ty_python_semantic/src/types.rs b/crates/ty_python_semantic/src/types.rs index a2fd967759..9d3a4b48ad 100644 --- a/crates/ty_python_semantic/src/types.rs +++ b/crates/ty_python_semantic/src/types.rs @@ -548,7 +548,7 @@ impl<'db> PropertyInstanceType<'db> { self, db: &'db dyn Db, other: Self, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, ) -> ConstraintSet<'db> { self.is_equivalent_to_impl(db, other, inferable, &IsEquivalentVisitor::default()) } @@ -557,7 +557,7 @@ impl<'db> PropertyInstanceType<'db> { self, db: &'db dyn Db, other: Self, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, visitor: &IsEquivalentVisitor<'db>, ) -> ConstraintSet<'db> { let getter_equivalence = if let Some(getter) = self.getter(db) { @@ -1286,7 +1286,7 @@ impl<'db> Type<'db> { self, db: &'db dyn Db, target: Type<'db>, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, ) -> Type<'db> { self.filter_union(db, |elem| { !elem @@ -1613,7 +1613,7 @@ impl<'db> Type<'db> { self, db: &'db dyn Db, target: Type<'db>, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, ) -> ConstraintSet<'db> { self.has_relation_to(db, target, inferable, TypeRelation::Subtyping) } @@ -1627,7 +1627,7 @@ impl<'db> Type<'db> { db: &'db dyn Db, target: Type<'db>, constraints: ConstraintSet<'db>, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, ) -> ConstraintSet<'db> { self.has_relation_to( db, @@ -1649,7 +1649,7 @@ impl<'db> Type<'db> { self, db: &'db dyn Db, target: Type<'db>, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, ) -> ConstraintSet<'db> { self.has_relation_to(db, target, inferable, TypeRelation::Assignability) } @@ -1667,7 +1667,7 @@ impl<'db> Type<'db> { self, db: &'db dyn Db, target: Type<'db>, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, relation: TypeRelation<'db>, ) -> ConstraintSet<'db> { self.has_relation_to_impl( @@ -1684,7 +1684,7 @@ impl<'db> Type<'db> { self, db: &'db dyn Db, target: Type<'db>, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, relation: TypeRelation<'db>, relation_visitor: &HasRelationToVisitor<'db>, disjointness_visitor: &IsDisjointVisitor<'db>, @@ -2552,7 +2552,7 @@ impl<'db> Type<'db> { self, db: &'db dyn Db, other: Type<'db>, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, ) -> ConstraintSet<'db> { self.is_equivalent_to_impl(db, other, inferable, &IsEquivalentVisitor::default()) } @@ -2561,7 +2561,7 @@ impl<'db> Type<'db> { self, db: &'db dyn Db, other: Type<'db>, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, visitor: &IsEquivalentVisitor<'db>, ) -> ConstraintSet<'db> { if self == other { @@ -2679,7 +2679,7 @@ impl<'db> Type<'db> { self, db: &'db dyn Db, other: Type<'db>, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, ) -> ConstraintSet<'db> { self.is_disjoint_from_impl( db, @@ -2694,7 +2694,7 @@ impl<'db> Type<'db> { self, db: &'db dyn Db, other: Type<'db>, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, disjointness_visitor: &IsDisjointVisitor<'db>, relation_visitor: &HasRelationToVisitor<'db>, ) -> ConstraintSet<'db> { @@ -2702,7 +2702,7 @@ impl<'db> Type<'db> { db: &'db dyn Db, protocol: ProtocolInstanceType<'db>, other: Type<'db>, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, disjointness_visitor: &IsDisjointVisitor<'db>, relation_visitor: &HasRelationToVisitor<'db>, ) -> ConstraintSet<'db> { @@ -10541,7 +10541,7 @@ impl<'db> BoundMethodType<'db> { self, db: &'db dyn Db, other: Self, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, relation: TypeRelation<'db>, relation_visitor: &HasRelationToVisitor<'db>, disjointness_visitor: &IsDisjointVisitor<'db>, @@ -10575,7 +10575,7 @@ impl<'db> BoundMethodType<'db> { self, db: &'db dyn Db, other: Self, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, visitor: &IsEquivalentVisitor<'db>, ) -> ConstraintSet<'db> { self.function(db) @@ -10708,7 +10708,7 @@ impl<'db> CallableType<'db> { self, db: &'db dyn Db, other: Self, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, relation: TypeRelation<'db>, relation_visitor: &HasRelationToVisitor<'db>, disjointness_visitor: &IsDisjointVisitor<'db>, @@ -10733,7 +10733,7 @@ impl<'db> CallableType<'db> { self, db: &'db dyn Db, other: Self, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, visitor: &IsEquivalentVisitor<'db>, ) -> ConstraintSet<'db> { if self == other { @@ -10817,7 +10817,7 @@ impl<'db> KnownBoundMethodType<'db> { self, db: &'db dyn Db, other: Self, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, relation: TypeRelation<'db>, relation_visitor: &HasRelationToVisitor<'db>, disjointness_visitor: &IsDisjointVisitor<'db>, @@ -10919,7 +10919,7 @@ impl<'db> KnownBoundMethodType<'db> { self, db: &'db dyn Db, other: Self, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, visitor: &IsEquivalentVisitor<'db>, ) -> ConstraintSet<'db> { match (self, other) { @@ -11964,7 +11964,7 @@ impl<'db> UnionType<'db> { self, db: &'db dyn Db, other: Self, - _inferable: InferableTypeVars<'_, 'db>, + _inferable: InferableTypeVars<'db>, _visitor: &IsEquivalentVisitor<'db>, ) -> ConstraintSet<'db> { if self == other { @@ -12066,7 +12066,7 @@ impl<'db> IntersectionType<'db> { self, db: &'db dyn Db, other: Self, - _inferable: InferableTypeVars<'_, 'db>, + _inferable: InferableTypeVars<'db>, _visitor: &IsEquivalentVisitor<'db>, ) -> ConstraintSet<'db> { if self == other { diff --git a/crates/ty_python_semantic/src/types/call/bind.rs b/crates/ty_python_semantic/src/types/call/bind.rs index cfd60ad829..b08c57bf75 100644 --- a/crates/ty_python_semantic/src/types/call/bind.rs +++ b/crates/ty_python_semantic/src/types/call/bind.rs @@ -2690,7 +2690,7 @@ struct ArgumentTypeChecker<'a, 'db> { return_ty: Type<'db>, errors: &'a mut Vec>, - inferable_typevars: InferableTypeVars<'db, 'db>, + inferable_typevars: InferableTypeVars<'db>, specialization: Option>, } @@ -3039,7 +3039,7 @@ impl<'a, 'db> ArgumentTypeChecker<'a, 'db> { fn finish( self, ) -> ( - InferableTypeVars<'db, 'db>, + InferableTypeVars<'db>, Option>, Type<'db>, ) { @@ -3109,7 +3109,7 @@ pub(crate) struct Binding<'db> { return_ty: Type<'db>, /// The inferable typevars in this signature. - inferable_typevars: InferableTypeVars<'db, 'db>, + inferable_typevars: InferableTypeVars<'db>, /// The specialization that was inferred from the argument types, if the callable is generic. specialization: Option>, @@ -3361,7 +3361,7 @@ impl<'db> Binding<'db> { #[derive(Clone, Debug)] struct BindingSnapshot<'db> { return_ty: Type<'db>, - inferable_typevars: InferableTypeVars<'db, 'db>, + inferable_typevars: InferableTypeVars<'db>, specialization: Option>, argument_matches: Box<[MatchedArgument<'db>]>, parameter_tys: Box<[Option>]>, diff --git a/crates/ty_python_semantic/src/types/class.rs b/crates/ty_python_semantic/src/types/class.rs index ee5c1b5cde..3214173f04 100644 --- a/crates/ty_python_semantic/src/types/class.rs +++ b/crates/ty_python_semantic/src/types/class.rs @@ -524,7 +524,7 @@ impl<'db> ClassType<'db> { self, db: &'db dyn Db, other: ClassType<'db>, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, ) -> ConstraintSet<'db> { self.has_relation_to_impl( db, @@ -540,7 +540,7 @@ impl<'db> ClassType<'db> { self, db: &'db dyn Db, other: Self, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, relation: TypeRelation<'db>, relation_visitor: &HasRelationToVisitor<'db>, disjointness_visitor: &IsDisjointVisitor<'db>, @@ -593,7 +593,7 @@ impl<'db> ClassType<'db> { self, db: &'db dyn Db, other: ClassType<'db>, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, visitor: &IsEquivalentVisitor<'db>, ) -> ConstraintSet<'db> { if self == other { diff --git a/crates/ty_python_semantic/src/types/constraints.rs b/crates/ty_python_semantic/src/types/constraints.rs index 3714868d4f..10f9008ed1 100644 --- a/crates/ty_python_semantic/src/types/constraints.rs +++ b/crates/ty_python_semantic/src/types/constraints.rs @@ -246,7 +246,7 @@ impl<'db> ConstraintSet<'db> { pub(crate) fn satisfied_by_all_typevars( self, db: &'db dyn Db, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, ) -> bool { self.node.satisfied_by_all_typevars(db, inferable) } @@ -816,11 +816,7 @@ impl<'db> Node<'db> { self.satisfies(db, constraint) } - fn satisfied_by_all_typevars( - self, - db: &'db dyn Db, - inferable: InferableTypeVars<'_, 'db>, - ) -> bool { + fn satisfied_by_all_typevars(self, db: &'db dyn Db, inferable: InferableTypeVars<'db>) -> bool { match self { Node::AlwaysTrue => return true, Node::AlwaysFalse => return false, diff --git a/crates/ty_python_semantic/src/types/function.rs b/crates/ty_python_semantic/src/types/function.rs index 5e216762e5..8903e24698 100644 --- a/crates/ty_python_semantic/src/types/function.rs +++ b/crates/ty_python_semantic/src/types/function.rs @@ -970,7 +970,7 @@ impl<'db> FunctionType<'db> { self, db: &'db dyn Db, other: Self, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, relation: TypeRelation<'db>, relation_visitor: &HasRelationToVisitor<'db>, disjointness_visitor: &IsDisjointVisitor<'db>, @@ -1009,7 +1009,7 @@ impl<'db> FunctionType<'db> { self, db: &'db dyn Db, other: Self, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, visitor: &IsEquivalentVisitor<'db>, ) -> ConstraintSet<'db> { if self.normalized(db) == other.normalized(db) { diff --git a/crates/ty_python_semantic/src/types/generics.rs b/crates/ty_python_semantic/src/types/generics.rs index 10fe7bfa54..4ae9f60e33 100644 --- a/crates/ty_python_semantic/src/types/generics.rs +++ b/crates/ty_python_semantic/src/types/generics.rs @@ -1,7 +1,6 @@ use std::cell::RefCell; use std::collections::hash_map::Entry; use std::fmt::Display; -use std::marker::PhantomData; use itertools::Itertools; use ruff_python_ast as ast; @@ -121,9 +120,9 @@ pub(crate) fn typing_self<'db>( } #[derive(Clone, Copy, Debug)] -pub(crate) enum InferableTypeVars<'a, 'db> { +pub(crate) enum InferableTypeVars<'db> { None, - One(InferableTypeVarsInner<'db>, PhantomData<&'a ()>), + One(InferableTypeVarsInner<'db>), } #[salsa::tracked(debug, heap_size=ruff_memory_usage::heap_size)] @@ -136,14 +135,10 @@ pub(crate) struct InferableTypeVarsInner<'db> { impl get_size2::GetSize for InferableTypeVarsInner<'_> {} impl<'db> BoundTypeVarInstance<'db> { - pub(crate) fn is_inferable( - self, - db: &'db dyn Db, - inferable: InferableTypeVars<'_, 'db>, - ) -> bool { + pub(crate) fn is_inferable(self, db: &'db dyn Db, inferable: InferableTypeVars<'db>) -> bool { match inferable { InferableTypeVars::None => false, - InferableTypeVars::One(inner, _) => inner + InferableTypeVars::One(inner) => inner .inferable(db) .binary_search(&self.identity(db)) .is_ok(), @@ -151,24 +146,24 @@ impl<'db> BoundTypeVarInstance<'db> { } } -impl<'db> InferableTypeVars<'_, 'db> { +impl<'db> InferableTypeVars<'db> { pub(crate) fn from_bound_typevars( db: &'db dyn Db, bound_typevars: impl IntoIterator>, ) -> Self { - InferableTypeVars::One( - InferableTypeVarsInner::from_bound_typevars(db, bound_typevars), - PhantomData, - ) + InferableTypeVars::One(InferableTypeVarsInner::from_bound_typevars( + db, + bound_typevars, + )) } pub(crate) fn merge(self, db: &'db dyn Db, other: Self) -> Self { match (self, other) { (InferableTypeVars::None, InferableTypeVars::None) => self, - (InferableTypeVars::One(_, _), InferableTypeVars::None) => self, - (InferableTypeVars::None, InferableTypeVars::One(_, _)) => other, - (InferableTypeVars::One(self_inner, _), InferableTypeVars::One(other_inner, _)) => { - InferableTypeVars::One(self_inner.merge(db, other_inner), PhantomData) + (InferableTypeVars::One(_), InferableTypeVars::None) => self, + (InferableTypeVars::None, InferableTypeVars::One(_)) => other, + (InferableTypeVars::One(self_inner), InferableTypeVars::One(other_inner)) => { + InferableTypeVars::One(self_inner.merge(db, other_inner)) } } } @@ -177,7 +172,7 @@ impl<'db> InferableTypeVars<'_, 'db> { #[expect(dead_code)] pub(crate) fn display(self, db: &'db dyn Db) -> impl Display { let inferable = match self { - InferableTypeVars::One(inner, _) => inner.inferable(db), + InferableTypeVars::One(inner) => inner.inferable(db), InferableTypeVars::None => return String::from("[]"), }; format!( @@ -319,7 +314,7 @@ impl<'db> GenericContext<'db> { ) } - pub(crate) fn inferable_typevars(self, db: &'db dyn Db) -> InferableTypeVars<'db, 'db> { + pub(crate) fn inferable_typevars(self, db: &'db dyn Db) -> InferableTypeVars<'db> { #[derive(Default)] struct CollectTypeVars<'db> { typevars: RefCell; 4]>>, @@ -366,7 +361,7 @@ impl<'db> GenericContext<'db> { // This ensures that salsa caches the InferableTypeVarsInner, not the InferableTypeVars // that wraps it. (That way InferableTypeVars can contain a reference, and doesn't need to // impl salsa::Update.) - InferableTypeVars::One(inferable_typevars_inner(db, self), PhantomData) + InferableTypeVars::One(inferable_typevars_inner(db, self)) } pub(crate) fn variables( @@ -727,7 +722,7 @@ fn is_subtype_in_invariant_position<'db>( derived_materialization: MaterializationKind, base_type: &Type<'db>, base_materialization: MaterializationKind, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, relation_visitor: &HasRelationToVisitor<'db>, disjointness_visitor: &IsDisjointVisitor<'db>, ) -> ConstraintSet<'db> { @@ -805,7 +800,7 @@ fn has_relation_in_invariant_position<'db>( derived_materialization: Option, base_type: &Type<'db>, base_materialization: Option, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, relation: TypeRelation<'db>, relation_visitor: &HasRelationToVisitor<'db>, disjointness_visitor: &IsDisjointVisitor<'db>, @@ -1153,7 +1148,7 @@ impl<'db> Specialization<'db> { self, db: &'db dyn Db, other: Self, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, relation: TypeRelation<'db>, relation_visitor: &HasRelationToVisitor<'db>, disjointness_visitor: &IsDisjointVisitor<'db>, @@ -1231,7 +1226,7 @@ impl<'db> Specialization<'db> { self, db: &'db dyn Db, other: Specialization<'db>, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, visitor: &IsEquivalentVisitor<'db>, ) -> ConstraintSet<'db> { if self.materialization_kind(db) != other.materialization_kind(db) { @@ -1345,12 +1340,12 @@ impl<'db> PartialSpecialization<'_, 'db> { /// specialization of a generic function. pub(crate) struct SpecializationBuilder<'db> { db: &'db dyn Db, - inferable: InferableTypeVars<'db, 'db>, + inferable: InferableTypeVars<'db>, types: FxHashMap, Type<'db>>, } impl<'db> SpecializationBuilder<'db> { - pub(crate) fn new(db: &'db dyn Db, inferable: InferableTypeVars<'db, 'db>) -> Self { + pub(crate) fn new(db: &'db dyn Db, inferable: InferableTypeVars<'db>) -> Self { Self { db, inferable, diff --git a/crates/ty_python_semantic/src/types/instance.rs b/crates/ty_python_semantic/src/types/instance.rs index 84f8ab07d0..cca1709fe1 100644 --- a/crates/ty_python_semantic/src/types/instance.rs +++ b/crates/ty_python_semantic/src/types/instance.rs @@ -122,7 +122,7 @@ impl<'db> Type<'db> { self, db: &'db dyn Db, protocol: ProtocolInstanceType<'db>, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, relation: TypeRelation<'db>, relation_visitor: &HasRelationToVisitor<'db>, disjointness_visitor: &IsDisjointVisitor<'db>, @@ -365,7 +365,7 @@ impl<'db> NominalInstanceType<'db> { self, db: &'db dyn Db, other: Self, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, relation: TypeRelation<'db>, relation_visitor: &HasRelationToVisitor<'db>, disjointness_visitor: &IsDisjointVisitor<'db>, @@ -398,7 +398,7 @@ impl<'db> NominalInstanceType<'db> { self, db: &'db dyn Db, other: Self, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, visitor: &IsEquivalentVisitor<'db>, ) -> ConstraintSet<'db> { match (self.0, other.0) { @@ -420,7 +420,7 @@ impl<'db> NominalInstanceType<'db> { self, db: &'db dyn Db, other: Self, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, disjointness_visitor: &IsDisjointVisitor<'db>, relation_visitor: &HasRelationToVisitor<'db>, ) -> ConstraintSet<'db> { @@ -719,7 +719,7 @@ impl<'db> ProtocolInstanceType<'db> { self, db: &'db dyn Db, other: Self, - _inferable: InferableTypeVars<'_, 'db>, + _inferable: InferableTypeVars<'db>, _visitor: &IsEquivalentVisitor<'db>, ) -> ConstraintSet<'db> { if self == other { @@ -741,7 +741,7 @@ impl<'db> ProtocolInstanceType<'db> { self, _db: &'db dyn Db, _other: Self, - _inferable: InferableTypeVars<'_, 'db>, + _inferable: InferableTypeVars<'db>, _visitor: &IsDisjointVisitor<'db>, ) -> ConstraintSet<'db> { ConstraintSet::from(false) diff --git a/crates/ty_python_semantic/src/types/protocol_class.rs b/crates/ty_python_semantic/src/types/protocol_class.rs index 6cb204231f..31acf47416 100644 --- a/crates/ty_python_semantic/src/types/protocol_class.rs +++ b/crates/ty_python_semantic/src/types/protocol_class.rs @@ -233,7 +233,7 @@ impl<'db> ProtocolInterface<'db> { self, db: &'db dyn Db, other: Self, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, relation: TypeRelation<'db>, relation_visitor: &HasRelationToVisitor<'db>, disjointness_visitor: &IsDisjointVisitor<'db>, @@ -608,7 +608,7 @@ impl<'a, 'db> ProtocolMember<'a, 'db> { &self, db: &'db dyn Db, other: Type<'db>, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, disjointness_visitor: &IsDisjointVisitor<'db>, relation_visitor: &HasRelationToVisitor<'db>, ) -> ConstraintSet<'db> { @@ -633,7 +633,7 @@ impl<'a, 'db> ProtocolMember<'a, 'db> { &self, db: &'db dyn Db, other: Type<'db>, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, relation: TypeRelation<'db>, relation_visitor: &HasRelationToVisitor<'db>, disjointness_visitor: &IsDisjointVisitor<'db>, diff --git a/crates/ty_python_semantic/src/types/signatures.rs b/crates/ty_python_semantic/src/types/signatures.rs index cf103adecb..76d93b64fd 100644 --- a/crates/ty_python_semantic/src/types/signatures.rs +++ b/crates/ty_python_semantic/src/types/signatures.rs @@ -217,7 +217,7 @@ impl<'db> CallableSignature<'db> { &self, db: &'db dyn Db, other: &Self, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, ) -> ConstraintSet<'db> { self.has_relation_to_impl( db, @@ -233,7 +233,7 @@ impl<'db> CallableSignature<'db> { &self, db: &'db dyn Db, other: &Self, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, relation: TypeRelation<'db>, relation_visitor: &HasRelationToVisitor<'db>, disjointness_visitor: &IsDisjointVisitor<'db>, @@ -255,7 +255,7 @@ impl<'db> CallableSignature<'db> { db: &'db dyn Db, self_signatures: &[Signature<'db>], other_signatures: &[Signature<'db>], - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, relation: TypeRelation<'db>, relation_visitor: &HasRelationToVisitor<'db>, disjointness_visitor: &IsDisjointVisitor<'db>, @@ -321,7 +321,7 @@ impl<'db> CallableSignature<'db> { &self, db: &'db dyn Db, other: &Self, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, visitor: &IsEquivalentVisitor<'db>, ) -> ConstraintSet<'db> { match (self.overloads.as_slice(), other.overloads.as_slice()) { @@ -628,7 +628,7 @@ impl<'db> Signature<'db> { } } - fn inferable_typevars(&self, db: &'db dyn Db) -> InferableTypeVars<'db, 'db> { + fn inferable_typevars(&self, db: &'db dyn Db) -> InferableTypeVars<'db> { match self.generic_context { Some(generic_context) => generic_context.inferable_typevars(db), None => InferableTypeVars::None, @@ -642,7 +642,7 @@ impl<'db> Signature<'db> { &self, db: &'db dyn Db, other: &Signature<'db>, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, visitor: &IsEquivalentVisitor<'db>, ) -> ConstraintSet<'db> { // The typevars in self and other should also be considered inferable when checking whether @@ -734,7 +734,7 @@ impl<'db> Signature<'db> { &self, db: &'db dyn Db, other: &Signature<'db>, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, relation: TypeRelation<'db>, relation_visitor: &HasRelationToVisitor<'db>, disjointness_visitor: &IsDisjointVisitor<'db>, diff --git a/crates/ty_python_semantic/src/types/subclass_of.rs b/crates/ty_python_semantic/src/types/subclass_of.rs index 20bf9f322b..3ff8cadf5c 100644 --- a/crates/ty_python_semantic/src/types/subclass_of.rs +++ b/crates/ty_python_semantic/src/types/subclass_of.rs @@ -136,7 +136,7 @@ impl<'db> SubclassOfType<'db> { self, db: &'db dyn Db, other: SubclassOfType<'db>, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, relation: TypeRelation<'db>, relation_visitor: &HasRelationToVisitor<'db>, disjointness_visitor: &IsDisjointVisitor<'db>, @@ -174,7 +174,7 @@ impl<'db> SubclassOfType<'db> { self, db: &'db dyn Db, other: Self, - _inferable: InferableTypeVars<'_, 'db>, + _inferable: InferableTypeVars<'db>, _visitor: &IsDisjointVisitor<'db>, ) -> ConstraintSet<'db> { match (self.subclass_of, other.subclass_of) { diff --git a/crates/ty_python_semantic/src/types/tuple.rs b/crates/ty_python_semantic/src/types/tuple.rs index e773315d68..43d0873546 100644 --- a/crates/ty_python_semantic/src/types/tuple.rs +++ b/crates/ty_python_semantic/src/types/tuple.rs @@ -259,7 +259,7 @@ impl<'db> TupleType<'db> { self, db: &'db dyn Db, other: Self, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, relation: TypeRelation<'db>, relation_visitor: &HasRelationToVisitor<'db>, disjointness_visitor: &IsDisjointVisitor<'db>, @@ -278,7 +278,7 @@ impl<'db> TupleType<'db> { self, db: &'db dyn Db, other: Self, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, visitor: &IsEquivalentVisitor<'db>, ) -> ConstraintSet<'db> { self.tuple(db) @@ -441,7 +441,7 @@ impl<'db> FixedLengthTuple> { &self, db: &'db dyn Db, other: &Tuple>, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, relation: TypeRelation<'db>, relation_visitor: &HasRelationToVisitor<'db>, disjointness_visitor: &IsDisjointVisitor<'db>, @@ -528,7 +528,7 @@ impl<'db> FixedLengthTuple> { &self, db: &'db dyn Db, other: &Self, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, visitor: &IsEquivalentVisitor<'db>, ) -> ConstraintSet<'db> { ConstraintSet::from(self.0.len() == other.0.len()).and(db, || { @@ -798,7 +798,7 @@ impl<'db> VariableLengthTuple> { &self, db: &'db dyn Db, other: &Tuple>, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, relation: TypeRelation<'db>, relation_visitor: &HasRelationToVisitor<'db>, disjointness_visitor: &IsDisjointVisitor<'db>, @@ -977,7 +977,7 @@ impl<'db> VariableLengthTuple> { &self, db: &'db dyn Db, other: &Self, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, visitor: &IsEquivalentVisitor<'db>, ) -> ConstraintSet<'db> { self.variable @@ -1190,7 +1190,7 @@ impl<'db> Tuple> { &self, db: &'db dyn Db, other: &Self, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, relation: TypeRelation<'db>, relation_visitor: &HasRelationToVisitor<'db>, disjointness_visitor: &IsDisjointVisitor<'db>, @@ -1219,7 +1219,7 @@ impl<'db> Tuple> { &self, db: &'db dyn Db, other: &Self, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, visitor: &IsEquivalentVisitor<'db>, ) -> ConstraintSet<'db> { match (self, other) { @@ -1239,7 +1239,7 @@ impl<'db> Tuple> { &self, db: &'db dyn Db, other: &Self, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, disjointness_visitor: &IsDisjointVisitor<'db>, relation_visitor: &HasRelationToVisitor<'db>, ) -> ConstraintSet<'db> { @@ -1259,7 +1259,7 @@ impl<'db> Tuple> { db: &'db dyn Db, a: impl IntoIterator>, b: impl IntoIterator>, - inferable: InferableTypeVars<'_, 'db>, + inferable: InferableTypeVars<'db>, disjointness_visitor: &IsDisjointVisitor<'db>, relation_visitor: &HasRelationToVisitor<'db>, ) -> ConstraintSet<'db>