Skip to content

Commit 276029d

Browse files
committed
Auto merge of rust-lang#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.
2 parents c1d3610 + 1d7192d commit 276029d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: compiler/rustc_middle/src/ty/fast_reject.rs

+4
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,10 @@ impl DeepRejectCtxt {
322322
TreatParams::AsCandidateKey => true,
323323
},
324324

325+
ty::Infer(ty::IntVar(_)) => impl_ty.is_integral(),
326+
327+
ty::Infer(ty::FloatVar(_)) => impl_ty.is_floating_point(),
328+
325329
ty::Infer(_) => true,
326330

327331
// As we're walking the whole type, it may encounter projections

0 commit comments

Comments
 (0)