diff --git a/crates/ty_python_semantic/src/types/signatures.rs b/crates/ty_python_semantic/src/types/signatures.rs index 478b75b057..061c9b513d 100644 --- a/crates/ty_python_semantic/src/types/signatures.rs +++ b/crates/ty_python_semantic/src/types/signatures.rs @@ -247,7 +247,7 @@ impl<'db> VarianceInferable<'db> for &CallableSignature<'db> { } /// The signature of one of the overloads of a callable. -#[derive(Clone, Debug, salsa::Update, get_size2::GetSize)] +#[derive(Clone, Debug, salsa::Update, get_size2::GetSize, PartialEq, Eq, Hash)] pub struct Signature<'db> { /// The generic context for this overload, if it is generic. pub(crate) generic_context: Option>, @@ -993,28 +993,6 @@ impl<'db> Signature<'db> { } } -// Manual implementations of PartialEq, Eq, and Hash that exclude the definition field -// since the definition is not relevant for type equality/equivalence -impl PartialEq for Signature<'_> { - fn eq(&self, other: &Self) -> bool { - self.generic_context == other.generic_context - && self.inherited_generic_context == other.inherited_generic_context - && self.parameters == other.parameters - && self.return_ty == other.return_ty - } -} - -impl Eq for Signature<'_> {} - -impl std::hash::Hash for Signature<'_> { - fn hash(&self, state: &mut H) { - self.generic_context.hash(state); - self.inherited_generic_context.hash(state); - self.parameters.hash(state); - self.return_ty.hash(state); - } -} - impl<'db> VarianceInferable<'db> for &Signature<'db> { fn variance_of(self, db: &'db dyn Db, typevar: BoundTypeVarInstance<'db>) -> TypeVarVariance { tracing::debug!(