@@ -1683,7 +1683,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
1683
1683
_ => { }
1684
1684
}
1685
1685
1686
- next_code = Some ( cause. derived . parent_code . as_ref ( ) ) ;
1686
+ next_code = Some ( cause. derived . parent_code ( ) ) ;
1687
1687
}
1688
1688
ObligationCauseCode :: DerivedObligation ( derived_obligation)
1689
1689
| ObligationCauseCode :: BuiltinDerivedObligation ( derived_obligation) => {
@@ -1715,7 +1715,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
1715
1715
_ => { }
1716
1716
}
1717
1717
1718
- next_code = Some ( derived_obligation. parent_code . as_ref ( ) ) ;
1718
+ next_code = Some ( derived_obligation. parent_code ( ) ) ;
1719
1719
}
1720
1720
_ => break ,
1721
1721
}
@@ -2365,8 +2365,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
2365
2365
let is_upvar_tys_infer_tuple = if !matches ! ( ty. kind( ) , ty:: Tuple ( ..) ) {
2366
2366
false
2367
2367
} else {
2368
- if let ObligationCauseCode :: BuiltinDerivedObligation ( ref data) =
2369
- * data. parent_code
2368
+ if let ObligationCauseCode :: BuiltinDerivedObligation ( data) = data. parent_code ( )
2370
2369
{
2371
2370
let parent_trait_ref =
2372
2371
self . resolve_vars_if_possible ( data. parent_trait_pred ) ;
@@ -2393,14 +2392,14 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
2393
2392
obligated_types. push ( ty) ;
2394
2393
2395
2394
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 ( ) ) {
2397
2396
// #74711: avoid a stack overflow
2398
2397
ensure_sufficient_stack ( || {
2399
2398
self . note_obligation_cause_code (
2400
2399
err,
2401
2400
& parent_predicate,
2402
2401
param_env,
2403
- & data. parent_code ,
2402
+ data. parent_code ( ) ,
2404
2403
obligated_types,
2405
2404
seen_requirements,
2406
2405
)
@@ -2462,7 +2461,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
2462
2461
// We don't want to point at the ADT saying "required because it appears within
2463
2462
// the type `X`", like we would otherwise do in test `supertrait-auto-trait.rs`.
2464
2463
while let ObligationCauseCode :: BuiltinDerivedObligation ( derived) =
2465
- & * data. parent_code
2464
+ data. parent_code ( )
2466
2465
{
2467
2466
let child_trait_ref =
2468
2467
self . resolve_vars_if_possible ( derived. parent_trait_pred ) ;
@@ -2475,7 +2474,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
2475
2474
parent_trait_pred = child_trait_ref;
2476
2475
}
2477
2476
}
2478
- while let ObligationCauseCode :: ImplDerivedObligation ( child) = & * data. parent_code {
2477
+ while let ObligationCauseCode :: ImplDerivedObligation ( child) = data. parent_code ( ) {
2479
2478
// Skip redundant recursive obligation notes. See `ui/issue-20413.rs`.
2480
2479
let child_trait_pred =
2481
2480
self . resolve_vars_if_possible ( child. derived . parent_trait_pred ) ;
@@ -2506,7 +2505,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
2506
2505
err,
2507
2506
& parent_predicate,
2508
2507
param_env,
2509
- & data. parent_code ,
2508
+ data. parent_code ( ) ,
2510
2509
obligated_types,
2511
2510
seen_requirements,
2512
2511
)
@@ -2521,7 +2520,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
2521
2520
err,
2522
2521
& parent_predicate,
2523
2522
param_env,
2524
- & data. parent_code ,
2523
+ data. parent_code ( ) ,
2525
2524
obligated_types,
2526
2525
seen_requirements,
2527
2526
)
0 commit comments