about summary refs log tree commit diff
diff options
context:
space:
mode:
authorlcnr <rust@lcnr.de>2023-08-14 15:27:14 +0200
committerlcnr <rust@lcnr.de>2023-08-14 15:27:14 +0200
commite04f582e567e1519a2c6909453b33ebc1497750a (patch)
tree1dbb9103019ea28fe677e1396bf4290c24b575b3
parent95fddbc501ba8029eba3b1ab36ed86d2677bfd17 (diff)
review
-rw-r--r--compiler/rustc_borrowck/src/region_infer/opaque_types.rs15
1 files changed, 6 insertions, 9 deletions
diff --git a/compiler/rustc_borrowck/src/region_infer/opaque_types.rs b/compiler/rustc_borrowck/src/region_infer/opaque_types.rs
index ff3883240e2..4da7b602571 100644
--- a/compiler/rustc_borrowck/src/region_infer/opaque_types.rs
+++ b/compiler/rustc_borrowck/src/region_infer/opaque_types.rs
@@ -385,16 +385,13 @@ fn check_opaque_type_parameter_valid(
 
         let arg_is_param = match arg.unpack() {
             GenericArgKind::Type(ty) => matches!(ty.kind(), ty::Param(_)),
-            GenericArgKind::Lifetime(lt) => {
-                if is_ty_alias {
-                    matches!(*lt, ty::ReEarlyBound(_) | ty::ReFree(_))
-                } else {
-                    // FIXME(#113916): we can't currently check for unique lifetime params,
-                    // see that issue for more. We will also have to ignore bivariant lifetime
-                    // params for RPIT, but that's comparatively trivial ✨
-                    continue;
-                }
+            GenericArgKind::Lifetime(lt) if is_ty_alias => {
+                matches!(*lt, ty::ReEarlyBound(_) | ty::ReFree(_))
             }
+            // FIXME(#113916): we can't currently check for unique lifetime params,
+            // see that issue for more. We will also have to ignore unused lifetime
+            // params for RPIT, but that's comparatively trivial ✨
+            GenericArgKind::Lifetime(_) => continue,
             GenericArgKind::Const(ct) => matches!(ct.kind(), ty::ConstKind::Param(_)),
         };