@@ -441,27 +441,17 @@ fn check_opaque_type_parameter_valid<'tcx>(
441441 opaque_type_key : OpaqueTypeKey < ' tcx > ,
442442 span : Span ,
443443) -> Result < ( ) , ErrorGuaranteed > {
444- let opaque_ty_hir = tcx. hir ( ) . expect_item ( opaque_type_key. def_id ) ;
445- let ( _parent, is_ty_alias) = match opaque_ty_hir. expect_opaque_ty ( ) . origin {
446- OpaqueTyOrigin :: TyAlias { parent, .. } => ( parent, true ) ,
447- OpaqueTyOrigin :: AsyncFn ( parent) | OpaqueTyOrigin :: FnReturn ( parent) => ( parent, false ) ,
448- } ;
449-
450444 let opaque_generics = tcx. generics_of ( opaque_type_key. def_id ) ;
451445 let opaque_env = LazyOpaqueTyEnv :: new ( tcx, opaque_type_key. def_id ) ;
452446 let mut seen_params: FxIndexMap < _ , Vec < _ > > = FxIndexMap :: default ( ) ;
453447
454448 for ( i, arg) in opaque_type_key. iter_captured_args ( tcx) {
455449 let arg_is_param = match arg. unpack ( ) {
456450 GenericArgKind :: Type ( ty) => matches ! ( ty. kind( ) , ty:: Param ( _) ) ,
457- GenericArgKind :: Lifetime ( lt) if is_ty_alias => {
451+ GenericArgKind :: Lifetime ( lt) => {
458452 matches ! ( * lt, ty:: ReEarlyParam ( _) | ty:: ReLateParam ( _) )
459453 || ( lt. is_static ( ) && opaque_env. param_equal_static ( i) )
460454 }
461- // FIXME(#113916): we can't currently check for unique lifetime params,
462- // see that issue for more. We will also have to ignore unused lifetime
463- // params for RPIT, but that's comparatively trivial ✨
464- GenericArgKind :: Lifetime ( _) => continue ,
465455 GenericArgKind :: Const ( ct) => matches ! ( ct. kind( ) , ty:: ConstKind :: Param ( _) ) ,
466456 } ;
467457
0 commit comments