Skip to content

Commit 32b5152

Browse files
committed
Auto merge of rust-lang#142355 - lcnr:fast_reject-reject, r=BoxyUwU
move fast reject into inner to also fast reject inside of the folder r? `@BoxyUwU`
2 parents 38c41d0 + a48c085 commit 32b5152

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

compiler/rustc_type_ir/src/fast_reject.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,6 @@ impl<I: Interner, const INSTANTIATE_LHS_WITH_INFER: bool, const INSTANTIATE_RHS_
237237
}
238238

239239
pub fn types_may_unify(self, lhs: I::Ty, rhs: I::Ty) -> bool {
240-
if lhs == rhs {
241-
return true;
242-
}
243240
self.types_may_unify_inner(lhs, rhs, Self::STARTING_DEPTH)
244241
}
245242

@@ -268,6 +265,10 @@ impl<I: Interner, const INSTANTIATE_LHS_WITH_INFER: bool, const INSTANTIATE_RHS_
268265
}
269266

270267
fn types_may_unify_inner(self, lhs: I::Ty, rhs: I::Ty, depth: usize) -> bool {
268+
if lhs == rhs {
269+
return true;
270+
}
271+
271272
match rhs.kind() {
272273
// Start by checking whether the `rhs` type may unify with
273274
// pretty much everything. Just return `true` in that case.

0 commit comments

Comments
 (0)