Auto merge of #109750 - compiler-errors:deep-reject-less-permissive-num-var, r=lcnr

numeric vars can only be unified with numerical types in deep reject

Don't consider numeric vars (int and float vars) to unify with non-numeric types during deep reject. This helps us reject incompatible impls sooner.
This commit is contained in:
bors 2023-03-31 00:59:04 +00:00
commit 276029deae

View file

@ -322,6 +322,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