@@ -1683,7 +1683,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
16831683 _ => { }
16841684 }
16851685
1686- next_code = Some ( cause. derived . parent_code . as_ref ( ) ) ;
1686+ next_code = Some ( cause. derived . parent_code ( ) ) ;
16871687 }
16881688 ObligationCauseCode :: DerivedObligation ( derived_obligation)
16891689 | ObligationCauseCode :: BuiltinDerivedObligation ( derived_obligation) => {
@@ -1715,7 +1715,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
17151715 _ => { }
17161716 }
17171717
1718- next_code = Some ( derived_obligation. parent_code . as_ref ( ) ) ;
1718+ next_code = Some ( derived_obligation. parent_code ( ) ) ;
17191719 }
17201720 _ => break ,
17211721 }
@@ -2365,8 +2365,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
23652365 let is_upvar_tys_infer_tuple = if !matches ! ( ty. kind( ) , ty:: Tuple ( ..) ) {
23662366 false
23672367 } else {
2368- if let ObligationCauseCode :: BuiltinDerivedObligation ( ref data) =
2369- * data. parent_code
2368+ if let ObligationCauseCode :: BuiltinDerivedObligation ( data) = data. parent_code ( )
23702369 {
23712370 let parent_trait_ref =
23722371 self . resolve_vars_if_possible ( data. parent_trait_pred ) ;
@@ -2393,14 +2392,14 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
23932392 obligated_types. push ( ty) ;
23942393
23952394 let parent_predicate = parent_trait_ref. to_predicate ( tcx) ;
2396- if !self . is_recursive_obligation ( obligated_types, & data. parent_code ) {
2395+ if !self . is_recursive_obligation ( obligated_types, data. parent_code ( ) ) {
23972396 // #74711: avoid a stack overflow
23982397 ensure_sufficient_stack ( || {
23992398 self . note_obligation_cause_code (
24002399 err,
24012400 & parent_predicate,
24022401 param_env,
2403- & data. parent_code ,
2402+ data. parent_code ( ) ,
24042403 obligated_types,
24052404 seen_requirements,
24062405 )
@@ -2462,7 +2461,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
24622461 // We don't want to point at the ADT saying "required because it appears within
24632462 // the type `X`", like we would otherwise do in test `supertrait-auto-trait.rs`.
24642463 while let ObligationCauseCode :: BuiltinDerivedObligation ( derived) =
2465- & * data. parent_code
2464+ data. parent_code ( )
24662465 {
24672466 let child_trait_ref =
24682467 self . resolve_vars_if_possible ( derived. parent_trait_pred ) ;
@@ -2475,7 +2474,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
24752474 parent_trait_pred = child_trait_ref;
24762475 }
24772476 }
2478- while let ObligationCauseCode :: ImplDerivedObligation ( child) = & * data. parent_code {
2477+ while let ObligationCauseCode :: ImplDerivedObligation ( child) = data. parent_code ( ) {
24792478 // Skip redundant recursive obligation notes. See `ui/issue-20413.rs`.
24802479 let child_trait_pred =
24812480 self . resolve_vars_if_possible ( child. derived . parent_trait_pred ) ;
@@ -2506,7 +2505,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
25062505 err,
25072506 & parent_predicate,
25082507 param_env,
2509- & data. parent_code ,
2508+ data. parent_code ( ) ,
25102509 obligated_types,
25112510 seen_requirements,
25122511 )
@@ -2521,7 +2520,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
25212520 err,
25222521 & parent_predicate,
25232522 param_env,
2524- & data. parent_code ,
2523+ data. parent_code ( ) ,
25252524 obligated_types,
25262525 seen_requirements,
25272526 )
0 commit comments