Guard AliasTy creation against passing the wrong number of substs

This commit is contained in:
Oli Scherer
2022-12-13 10:25:21 +00:00
parent 7bdda8f801
commit fef872a875
9 changed files with 35 additions and 38 deletions

View File

@@ -1746,10 +1746,7 @@ pub fn check_type_bounds<'tcx>(
_ => predicates.push(
ty::Binder::bind_with_vars(
ty::ProjectionPredicate {
projection_ty: ty::AliasTy {
def_id: trait_ty.def_id,
substs: rebased_substs,
},
projection_ty: tcx.mk_alias_ty(trait_ty.def_id, rebased_substs),
term: impl_ty_value.into(),
},
bound_vars,