From 1d7192d6ea5a5fdbd90788f41d0e948a4dedeefa Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Thu, 30 Mar 2023 02:13:24 +0000 Subject: [PATCH] deep reject only unify numeric var with concrete numeric --- compiler/rustc_middle/src/ty/fast_reject.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler/rustc_middle/src/ty/fast_reject.rs b/compiler/rustc_middle/src/ty/fast_reject.rs index 0a6e94248e6e..726689d84461 100644 --- a/compiler/rustc_middle/src/ty/fast_reject.rs +++ b/compiler/rustc_middle/src/ty/fast_reject.rs @@ -321,6 +321,10 @@ impl DeepRejectCtxt { TreatParams::AsCandidateKey => true, }, + ty::Infer(ty::IntVar(_)) => impl_ty.is_integral(), + + ty::Infer(ty::FloatVar(_)) => impl_ty.is_floating_point(), + ty::Infer(_) => true, // As we're walking the whole type, it may encounter projections