Replace const_error methods with Const::new_error

This commit is contained in:
Boxy
2023-07-04 14:46:32 +01:00
parent ddbc774e74
commit d30f56dbf2
15 changed files with 66 additions and 59 deletions

View File

@@ -186,11 +186,10 @@ impl<'tcx> assembly::GoalKind<'tcx> for ProjectionPredicate<'tcx> {
"missing value for assoc item in impl",
);
let error_term = match assoc_def.item.kind {
ty::AssocKind::Const => tcx
.const_error(
tcx.type_of(goal.predicate.def_id())
.subst(tcx, goal.predicate.projection_ty.substs),
guar,
ty::AssocKind::Const => ty::Const::new_error(tcx,
guar,
tcx.type_of(goal.predicate.def_id())
.subst(tcx, goal.predicate.projection_ty.substs),
)
.into(),
ty::AssocKind::Type => tcx.ty_error(guar).into(),