type_ir: add faster exit for types_may_unify

This commit is contained in:
David Wood
2025-05-13 16:47:10 +00:00
parent a5e1dba0cd
commit febb16a40f

View File

@@ -232,6 +232,9 @@ impl<I: Interner, const INSTANTIATE_LHS_WITH_INFER: bool, const INSTANTIATE_RHS_
}
pub fn types_may_unify(self, lhs: I::Ty, rhs: I::Ty) -> bool {
if lhs == rhs {
return true;
}
self.types_may_unify_inner(lhs, rhs, Self::STARTING_DEPTH)
}