about summary refs log tree commit diff
path: root/compiler/rustc_ty_utils
diff options
context:
space:
mode:
authorLukas Markeffsky <@>2024-03-13 18:52:25 +0100
committerLukas Markeffsky <@>2024-03-14 20:52:13 +0100
commit0e7e1bfdbc52931d03e40438a74b400276e46bbd (patch)
treeba0604027ab7852617b97ed881ed280c05b06351 /compiler/rustc_ty_utils
parent30f74ff0dc4d66debc8b50724c446f817e5f75f4 (diff)
downloadrust-0e7e1bfdbc52931d03e40438a74b400276e46bbd.tar.gz
rust-0e7e1bfdbc52931d03e40438a74b400276e46bbd.zip
make `Representability::Infinite` carry `ErrorGuaranteed`
Diffstat (limited to 'compiler/rustc_ty_utils')
-rw-r--r--compiler/rustc_ty_utils/src/representability.rs2
-rw-r--r--compiler/rustc_ty_utils/src/ty.rs4
2 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_ty_utils/src/representability.rs b/compiler/rustc_ty_utils/src/representability.rs
index bb546cee2dd..a5ffa553c2a 100644
--- a/compiler/rustc_ty_utils/src/representability.rs
+++ b/compiler/rustc_ty_utils/src/representability.rs
@@ -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 => {}
         }
     };
diff --git a/compiler/rustc_ty_utils/src/ty.rs b/compiler/rustc_ty_utils/src/ty.rs
index 2b6b91672c3..310fd55e863 100644
--- a/compiler/rustc_ty_utils/src/ty.rs
+++ b/compiler/rustc_ty_utils/src/ty.rs
@@ -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);