@@ -336,18 +336,18 @@ fn check_opaque_meets_bounds<'tcx>(
336
336
origin : & hir:: OpaqueTyOrigin ,
337
337
) -> Result < ( ) , ErrorGuaranteed > {
338
338
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 ,
342
342
} ;
343
343
let param_env = tcx. param_env ( defining_use_anchor) ;
344
344
345
345
let infcx = tcx. infer_ctxt ( ) . with_opaque_type_inference ( defining_use_anchor) . build ( ) ;
346
346
let ocx = ObligationCtxt :: new_with_diagnostics ( & infcx) ;
347
347
348
348
let args = match * origin {
349
- hir:: OpaqueTyOrigin :: FnReturn ( parent)
350
- | hir:: OpaqueTyOrigin :: AsyncFn ( parent)
349
+ hir:: OpaqueTyOrigin :: FnReturn { parent }
350
+ | hir:: OpaqueTyOrigin :: AsyncFn { parent }
351
351
| hir:: OpaqueTyOrigin :: TyAlias { parent, .. } => GenericArgs :: identity_for_item (
352
352
tcx, parent,
353
353
)
@@ -409,7 +409,7 @@ fn check_opaque_meets_bounds<'tcx>(
409
409
let outlives_env = OutlivesEnvironment :: with_bounds ( param_env, implied_bounds) ;
410
410
ocx. resolve_regions_and_report_errors ( defining_use_anchor, & outlives_env) ?;
411
411
412
- if let hir:: OpaqueTyOrigin :: FnReturn ( .. ) | hir:: OpaqueTyOrigin :: AsyncFn ( .. ) = origin {
412
+ if let hir:: OpaqueTyOrigin :: FnReturn { .. } | hir:: OpaqueTyOrigin :: AsyncFn { .. } = origin {
413
413
// HACK: this should also fall through to the hidden type check below, but the original
414
414
// implementation had a bug where equivalent lifetimes are not identical. This caused us
415
415
// 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) {
736
736
check_opaque_precise_captures ( tcx, def_id) ;
737
737
738
738
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
741
741
&& let hir:: Node :: TraitItem ( trait_item) = tcx. hir_node_by_def_id ( fn_def_id)
742
742
&& let ( _, hir:: TraitFn :: Required ( ..) ) = trait_item. expect_fn ( )
743
743
{
0 commit comments