From febb16a40fe2c3722f6e4202ee6783bf6b79b29c Mon Sep 17 00:00:00 2001 From: David Wood Date: Tue, 13 May 2025 16:47:10 +0000 Subject: [PATCH] type_ir: add faster exit for `types_may_unify` --- compiler/rustc_type_ir/src/fast_reject.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/rustc_type_ir/src/fast_reject.rs b/compiler/rustc_type_ir/src/fast_reject.rs index 11ec1f0a9fb0..34502f495500 100644 --- a/compiler/rustc_type_ir/src/fast_reject.rs +++ b/compiler/rustc_type_ir/src/fast_reject.rs @@ -232,6 +232,9 @@ impl bool { + if lhs == rhs { + return true; + } self.types_may_unify_inner(lhs, rhs, Self::STARTING_DEPTH) }