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

@@ -102,9 +102,11 @@ impl GenericParamDef {
match &self.kind {
ty::GenericParamDefKind::Lifetime => ty::Region::new_error_misc(tcx).into(),
ty::GenericParamDefKind::Type { .. } => tcx.ty_error_misc().into(),
ty::GenericParamDefKind::Const { .. } => {
tcx.const_error_misc(tcx.type_of(self.def_id).subst(tcx, preceding_substs)).into()
}
ty::GenericParamDefKind::Const { .. } => ty::Const::new_misc_error(
tcx,
tcx.type_of(self.def_id).subst(tcx, preceding_substs),
)
.into(),
}
}
}