about summary refs log tree commit diff
diff options
context:
space:
mode:
authorlcnr <rust@lcnr.de>2025-06-11 12:13:57 +0200
committerlcnr <rust@lcnr.de>2025-06-11 12:13:57 +0200
commita48c08546cbbace9efc1e19ec56ed8fa7885435d (patch)
treea5a74b192c88604a06a758a236d334e1a65312b4
parent2b0274c71dba0e24370ebf65593da450e2e91868 (diff)
downloadrust-a48c08546cbbace9efc1e19ec56ed8fa7885435d.tar.gz
rust-a48c08546cbbace9efc1e19ec56ed8fa7885435d.zip
move fast reject into inner
to also fast reject inside of the folder
-rw-r--r--compiler/rustc_type_ir/src/fast_reject.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/rustc_type_ir/src/fast_reject.rs b/compiler/rustc_type_ir/src/fast_reject.rs
index 34502f49550..135a924e810 100644
--- a/compiler/rustc_type_ir/src/fast_reject.rs
+++ b/compiler/rustc_type_ir/src/fast_reject.rs
@@ -232,9 +232,6 @@ 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)
     }
 
@@ -263,6 +260,10 @@ impl<I: Interner, const INSTANTIATE_LHS_WITH_INFER: bool, const INSTANTIATE_RHS_
     }
 
     fn types_may_unify_inner(self, lhs: I::Ty, rhs: I::Ty, depth: usize) -> bool {
+        if lhs == rhs {
+            return true;
+        }
+
         match rhs.kind() {
             // Start by checking whether the `rhs` type may unify with
             // pretty much everything. Just return `true` in that case.