type_ir: add faster exit for types_may_unify
This commit is contained in:
parent
a5e1dba0cd
commit
febb16a40f
1 changed files with 3 additions and 0 deletions
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue