@@ -336,18 +336,18 @@ fn check_opaque_meets_bounds<'tcx>(
336336 origin : & hir:: OpaqueTyOrigin ,
337337) -> Result < ( ) , ErrorGuaranteed > {
338338 let defining_use_anchor = match * origin {
339- hir:: OpaqueTyOrigin :: FnReturn ( did )
340- | hir:: OpaqueTyOrigin :: AsyncFn ( did )
341- | hir:: OpaqueTyOrigin :: TyAlias { parent : did , .. } => did ,
339+ hir:: OpaqueTyOrigin :: FnReturn { parent }
340+ | hir:: OpaqueTyOrigin :: AsyncFn { parent }
341+ | hir:: OpaqueTyOrigin :: TyAlias { parent, .. } => parent ,
342342 } ;
343343 let param_env = tcx. param_env ( defining_use_anchor) ;
344344
345345 let infcx = tcx. infer_ctxt ( ) . with_opaque_type_inference ( defining_use_anchor) . build ( ) ;
346346 let ocx = ObligationCtxt :: new_with_diagnostics ( & infcx) ;
347347
348348 let args = match * origin {
349- hir:: OpaqueTyOrigin :: FnReturn ( parent)
350- | hir:: OpaqueTyOrigin :: AsyncFn ( parent)
349+ hir:: OpaqueTyOrigin :: FnReturn { parent }
350+ | hir:: OpaqueTyOrigin :: AsyncFn { parent }
351351 | hir:: OpaqueTyOrigin :: TyAlias { parent, .. } => GenericArgs :: identity_for_item (
352352 tcx, parent,
353353 )
@@ -409,7 +409,7 @@ fn check_opaque_meets_bounds<'tcx>(
409409 let outlives_env = OutlivesEnvironment :: with_bounds ( param_env, implied_bounds) ;
410410 ocx. resolve_regions_and_report_errors ( defining_use_anchor, & outlives_env) ?;
411411
412- if let hir:: OpaqueTyOrigin :: FnReturn ( .. ) | hir:: OpaqueTyOrigin :: AsyncFn ( .. ) = origin {
412+ if let hir:: OpaqueTyOrigin :: FnReturn { .. } | hir:: OpaqueTyOrigin :: AsyncFn { .. } = origin {
413413 // HACK: this should also fall through to the hidden type check below, but the original
414414 // implementation had a bug where equivalent lifetimes are not identical. This caused us
415415 // to reject existing stable code that is otherwise completely fine. The real fix is to
@@ -736,8 +736,8 @@ pub(crate) fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) {
736736 check_opaque_precise_captures ( tcx, def_id) ;
737737
738738 let origin = tcx. opaque_type_origin ( def_id) ;
739- if let hir:: OpaqueTyOrigin :: FnReturn ( fn_def_id)
740- | hir:: OpaqueTyOrigin :: AsyncFn ( fn_def_id) = origin
739+ if let hir:: OpaqueTyOrigin :: FnReturn { parent : fn_def_id }
740+ | hir:: OpaqueTyOrigin :: AsyncFn { parent : fn_def_id } = origin
741741 && let hir:: Node :: TraitItem ( trait_item) = tcx. hir_node_by_def_id ( fn_def_id)
742742 && let ( _, hir:: TraitFn :: Required ( ..) ) = trait_item. expect_fn ( )
743743 {
0 commit comments