about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/variance/constraints.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_hir_analysis/src/variance/constraints.rs')
-rw-r--r--compiler/rustc_hir_analysis/src/variance/constraints.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler/rustc_hir_analysis/src/variance/constraints.rs b/compiler/rustc_hir_analysis/src/variance/constraints.rs
index 4a3d522e488..8a40509d7cc 100644
--- a/compiler/rustc_hir_analysis/src/variance/constraints.rs
+++ b/compiler/rustc_hir_analysis/src/variance/constraints.rs
@@ -78,9 +78,8 @@ pub fn add_constraints_from_crate<'a, 'tcx>(
                 }
             }
             DefKind::Fn | DefKind::AssocFn => constraint_cx.build_constraints_for_item(def_id),
-            DefKind::TyAlias
-                if tcx.features().lazy_type_alias
-                    || tcx.type_of(def_id).instantiate_identity().has_opaque_types() =>
+            DefKind::TyAlias { lazy }
+                if lazy || tcx.type_of(def_id).instantiate_identity().has_opaque_types() =>
             {
                 constraint_cx.build_constraints_for_item(def_id)
             }
@@ -111,8 +110,8 @@ impl<'a, 'tcx> ConstraintContext<'a, 'tcx> {
 
         // The type as returned by `type_of` is the underlying type and generally not a weak projection.
         // Therefore we need to check the `DefKind` first.
-        if let DefKind::TyAlias = tcx.def_kind(def_id)
-            && (tcx.features().lazy_type_alias || ty.has_opaque_types())
+        if let DefKind::TyAlias { lazy } = tcx.def_kind(def_id)
+            && (lazy || ty.has_opaque_types())
         {
             self.add_constraints_from_ty(current_item, ty, self.covariant);
             return;