Skip to content

Commit a48c085

Browse files
committed
move fast reject into inner
to also fast reject inside of the folder
1 parent 2b0274c commit a48c085

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
@@ -232,9 +232,6 @@ impl<I: Interner, const INSTANTIATE_LHS_WITH_INFER: bool, const INSTANTIATE_RHS_
232232
}
233233

234234
pub fn types_may_unify(self, lhs: I::Ty, rhs: I::Ty) -> bool {
235-
if lhs == rhs {
236-
return true;
237-
}
238235
self.types_may_unify_inner(lhs, rhs, Self::STARTING_DEPTH)
239236
}
240237

@@ -263,6 +260,10 @@ impl<I: Interner, const INSTANTIATE_LHS_WITH_INFER: bool, const INSTANTIATE_RHS_
263260
}
264261

265262
fn types_may_unify_inner(self, lhs: I::Ty, rhs: I::Ty, depth: usize) -> bool {
263+
if lhs == rhs {
264+
return true;
265+
}
266+
266267
match rhs.kind() {
267268
// Start by checking whether the `rhs` type may unify with
268269
// pretty much everything. Just return `true` in that case.

0 commit comments

Comments
 (0)