@@ -335,7 +335,8 @@ fn create_generic_args<'tcx>(
335
335
tcx. impl_trait_header ( parent) . unwrap ( ) . trait_ref . instantiate_identity ( ) . args ;
336
336
337
337
let trait_args = ty:: GenericArgs :: identity_for_item ( tcx, sig_id) ;
338
- let method_args = tcx. mk_args_from_iter ( trait_args. iter ( ) . skip ( callee_generics. parent_count ) ) ;
338
+ let method_args =
339
+ tcx. mk_args_from_iter ( trait_args. iter ( ) . skip ( callee_generics. parent_count ) ) ;
339
340
let method_args = builder. build_from_args ( method_args) ;
340
341
341
342
tcx. mk_args_from_iter ( parent_args. iter ( ) . chain ( method_args) )
@@ -354,9 +355,9 @@ fn create_generic_args<'tcx>(
354
355
}
355
356
356
357
// For trait impl's `sig_id` is always equal to the corresponding trait method.
358
+ // For inherent methods delegation is not yet supported.
357
359
( FnKind :: AssocTraitImpl , _)
358
360
| ( _, FnKind :: AssocTraitImpl )
359
- // Delegation to inherent methods is not yet supported.
360
361
| ( _, FnKind :: AssocInherentImpl ) => unreachable ! ( ) ,
361
362
}
362
363
}
@@ -382,29 +383,26 @@ pub(crate) fn inherit_generics_for_delegation_item<'tcx>(
382
383
let caller_kind = fn_kind ( tcx, def_id. into ( ) ) ;
383
384
let callee_kind = fn_kind ( tcx, sig_id) ;
384
385
match ( caller_kind, callee_kind) {
385
- ( FnKind :: Free , FnKind :: Free )
386
- | ( FnKind :: Free , FnKind :: AssocTrait ) => builder. with_inheritance_kind ( InheritanceKind :: WithParent ( true ) ) . build ( ) ,
386
+ ( FnKind :: Free , FnKind :: Free ) | ( FnKind :: Free , FnKind :: AssocTrait ) => {
387
+ builder. with_inheritance_kind ( InheritanceKind :: WithParent ( true ) ) . build ( )
388
+ }
387
389
388
- ( FnKind :: AssocTraitImpl , FnKind :: AssocTrait ) => {
389
- builder
390
+ ( FnKind :: AssocTraitImpl , FnKind :: AssocTrait ) => builder
390
391
. with_parent ( tcx. parent ( def_id. into ( ) ) )
391
392
. with_inheritance_kind ( InheritanceKind :: Own )
392
- . build ( )
393
- }
393
+ . build ( ) ,
394
394
395
395
( FnKind :: AssocInherentImpl , FnKind :: AssocTrait )
396
396
| ( FnKind :: AssocTrait , FnKind :: AssocTrait )
397
397
| ( FnKind :: AssocInherentImpl , FnKind :: Free )
398
398
| ( FnKind :: AssocTrait , FnKind :: Free ) => {
399
- builder
400
- . with_parent ( tcx. parent ( def_id. into ( ) ) )
401
- . build ( )
399
+ builder. with_parent ( tcx. parent ( def_id. into ( ) ) ) . build ( )
402
400
}
403
401
404
402
// For trait impl's `sig_id` is always equal to the corresponding trait method.
403
+ // For inherent methods delegation is not yet supported.
405
404
( FnKind :: AssocTraitImpl , _)
406
405
| ( _, FnKind :: AssocTraitImpl )
407
- // Delegation to inherent methods is not yet supported.
408
406
| ( _, FnKind :: AssocInherentImpl ) => unreachable ! ( ) ,
409
407
}
410
408
}
@@ -420,31 +418,26 @@ pub(crate) fn inherit_predicates_for_delegation_item<'tcx>(
420
418
let caller_kind = fn_kind ( tcx, def_id. into ( ) ) ;
421
419
let callee_kind = fn_kind ( tcx, sig_id) ;
422
420
match ( caller_kind, callee_kind) {
423
- ( FnKind :: Free , FnKind :: Free )
424
- | ( FnKind :: Free , FnKind :: AssocTrait ) => {
421
+ ( FnKind :: Free , FnKind :: Free ) | ( FnKind :: Free , FnKind :: AssocTrait ) => {
425
422
builder. with_inheritance_kind ( InheritanceKind :: WithParent ( true ) ) . build ( )
426
423
}
427
424
428
- ( FnKind :: AssocTraitImpl , FnKind :: AssocTrait ) => {
429
- builder
425
+ ( FnKind :: AssocTraitImpl , FnKind :: AssocTrait ) => builder
430
426
. with_parent ( tcx. parent ( def_id. into ( ) ) )
431
427
. with_inheritance_kind ( InheritanceKind :: Own )
432
- . build ( )
433
- }
428
+ . build ( ) ,
434
429
435
430
( FnKind :: AssocInherentImpl , FnKind :: AssocTrait )
436
431
| ( FnKind :: AssocTrait , FnKind :: AssocTrait )
437
432
| ( FnKind :: AssocInherentImpl , FnKind :: Free )
438
433
| ( FnKind :: AssocTrait , FnKind :: Free ) => {
439
- builder
440
- . with_parent ( tcx. parent ( def_id. into ( ) ) )
441
- . build ( )
434
+ builder. with_parent ( tcx. parent ( def_id. into ( ) ) ) . build ( )
442
435
}
443
436
444
437
// For trait impl's `sig_id` is always equal to the corresponding trait method.
438
+ // For inherent methods delegation is not yet supported.
445
439
( FnKind :: AssocTraitImpl , _)
446
440
| ( _, FnKind :: AssocTraitImpl )
447
- // Delegation to inherent methods is not yet supported.
448
441
| ( _, FnKind :: AssocInherentImpl ) => unreachable ! ( ) ,
449
442
}
450
443
}
0 commit comments