1
Fork 0

make Representability::Infinite carry ErrorGuaranteed

This commit is contained in:
Lukas Markeffsky 2024-03-13 18:52:25 +01:00
parent 30f74ff0dc
commit 0e7e1bfdbc
5 changed files with 9 additions and 9 deletions

View file

@ -12,7 +12,7 @@ pub(crate) fn provide(providers: &mut Providers) {
macro_rules! rtry {
($e:expr) => {
match $e {
e @ Representability::Infinite => return e,
e @ Representability::Infinite(_) => return e,
Representability::Representable => {}
}
};

View file

@ -99,8 +99,8 @@ fn adt_sized_constraint<'tcx>(
def_id: DefId,
) -> ty::EarlyBinder<&'tcx ty::List<Ty<'tcx>>> {
if let Some(def_id) = def_id.as_local() {
if matches!(tcx.representability(def_id), ty::Representability::Infinite) {
return ty::EarlyBinder::bind(tcx.mk_type_list(&[Ty::new_misc_error(tcx)]));
if let ty::Representability::Infinite(guar) = tcx.representability(def_id) {
return ty::EarlyBinder::bind(tcx.mk_type_list(&[Ty::new_error(tcx, guar)]));
}
}
let def = tcx.adt_def(def_id);