about summary refs log tree commit diff
path: root/compiler/rustc_ty_utils/src/ty.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_ty_utils/src/ty.rs')
-rw-r--r--compiler/rustc_ty_utils/src/ty.rs4
1 files changed, 2 insertions, 2 deletions
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);