@@ -402,24 +402,11 @@ fn check_opaque_meets_bounds<'tcx>(
402402 let guar = infcx. err_ctxt ( ) . report_fulfillment_errors ( errors) ;
403403 return Err ( guar) ;
404404 }
405- match origin {
406- // Nested opaque types occur only in associated types:
407- // ` type Opaque<T> = impl Trait<&'static T, AssocTy = impl Nested>; `
408- // They can only be referenced as `<Opaque<T> as Trait<&'static T>>::AssocTy`.
409- // We don't have to check them here because their well-formedness follows from the WF of
410- // the projection input types in the defining- and use-sites.
411- hir:: OpaqueTyOrigin :: TyAlias { .. }
412- if tcx. def_kind ( tcx. parent ( def_id. to_def_id ( ) ) ) == DefKind :: OpaqueTy => { }
413- // Can have different predicates to their defining use
414- hir:: OpaqueTyOrigin :: TyAlias { .. }
415- | hir:: OpaqueTyOrigin :: FnReturn ( ..)
416- | hir:: OpaqueTyOrigin :: AsyncFn ( ..) => {
417- let wf_tys = ocx. assumed_wf_types_and_report_errors ( param_env, defining_use_anchor) ?;
418- let implied_bounds = infcx. implied_bounds_tys ( param_env, def_id, & wf_tys) ;
419- let outlives_env = OutlivesEnvironment :: with_bounds ( param_env, implied_bounds) ;
420- ocx. resolve_regions_and_report_errors ( defining_use_anchor, & outlives_env) ?;
421- }
422- }
405+
406+ let wf_tys = ocx. assumed_wf_types_and_report_errors ( param_env, defining_use_anchor) ?;
407+ let implied_bounds = infcx. implied_bounds_tys ( param_env, def_id, & wf_tys) ;
408+ let outlives_env = OutlivesEnvironment :: with_bounds ( param_env, implied_bounds) ;
409+ ocx. resolve_regions_and_report_errors ( defining_use_anchor, & outlives_env) ?;
423410
424411 if let hir:: OpaqueTyOrigin :: FnReturn ( ..) | hir:: OpaqueTyOrigin :: AsyncFn ( ..) = origin {
425412 // HACK: this should also fall through to the hidden type check below, but the original
0 commit comments