Assert that various types have the right amount of generic args and fix the sites that used the wrong amount

This commit is contained in:
Oli Scherer
2022-11-17 11:21:39 +00:00
parent d9a02b0fb7
commit 6f77c97b38
27 changed files with 153 additions and 144 deletions

View File

@@ -1782,10 +1782,7 @@ fn receiver_is_implemented<'tcx>(
receiver_ty: Ty<'tcx>,
) -> bool {
let tcx = wfcx.tcx();
let trait_ref = ty::Binder::dummy(ty::TraitRef {
def_id: receiver_trait_def_id,
substs: tcx.mk_substs_trait(receiver_ty, &[]),
});
let trait_ref = ty::Binder::dummy(tcx.mk_trait_ref(receiver_trait_def_id, receiver_ty, &[]));
let obligation = traits::Obligation::new(tcx, cause, wfcx.param_env, trait_ref.without_const());