@@ -461,8 +461,11 @@ impl<'tcx> ProofTreeVisitor<'tcx> for BestObligation<'tcx> {
461
461
// for normalizes-to.
462
462
let pred_kind = goal. goal ( ) . predicate . kind ( ) ;
463
463
let child_mode = match pred_kind. skip_binder ( ) {
464
- ty:: PredicateKind :: Clause ( ty:: ClauseKind :: Trait ( parent_trait_pred) ) => {
465
- ChildMode :: Trait ( pred_kind. rebind ( parent_trait_pred) )
464
+ ty:: PredicateKind :: Clause ( ty:: ClauseKind :: Trait ( pred) ) => {
465
+ ChildMode :: Trait ( pred_kind. rebind ( pred) )
466
+ }
467
+ ty:: PredicateKind :: Clause ( ty:: ClauseKind :: HostEffect ( pred) ) => {
468
+ ChildMode :: Host ( pred_kind. rebind ( pred) )
466
469
}
467
470
ty:: PredicateKind :: NormalizesTo ( normalizes_to)
468
471
if matches ! (
@@ -491,7 +494,7 @@ impl<'tcx> ProofTreeVisitor<'tcx> for BestObligation<'tcx> {
491
494
492
495
let obligation;
493
496
match ( child_mode, nested_goal. source ( ) ) {
494
- ( ChildMode :: Trait ( _) , GoalSource :: Misc ) => {
497
+ ( ChildMode :: Trait ( _) | ChildMode :: Host ( _ ) , GoalSource :: Misc ) => {
495
498
continue ;
496
499
}
497
500
( ChildMode :: Trait ( parent_trait_pred) , GoalSource :: ImplWhereBound ) => {
@@ -504,6 +507,10 @@ impl<'tcx> ProofTreeVisitor<'tcx> for BestObligation<'tcx> {
504
507
) ) ;
505
508
impl_where_bound_count += 1 ;
506
509
}
510
+ ( ChildMode :: Host ( _) , GoalSource :: ImplWhereBound ) => {
511
+ // TODO:
512
+ obligation = make_obligation ( self . obligation . cause . clone ( ) ) ;
513
+ }
507
514
// Skip over a higher-ranked predicate.
508
515
( _, GoalSource :: InstantiateHigherRanked ) => {
509
516
obligation = self . obligation . clone ( ) ;
@@ -562,6 +569,11 @@ enum ChildMode<'tcx> {
562
569
// and skip all `GoalSource::Misc`, which represent useless obligations
563
570
// such as alias-eq which may not hold.
564
571
Trait ( ty:: PolyTraitPredicate < ' tcx > ) ,
572
+ // Try to derive an `ObligationCause::{ImplDerived,BuiltinDerived}`,
573
+ // and skip all `GoalSource::Misc`, which represent useless obligations
574
+ // such as alias-eq which may not hold.
575
+ #[ expect( dead_code) ]
576
+ Host ( ty:: Binder < ' tcx , ty:: HostEffectPredicate < ' tcx > > ) ,
565
577
// Skip trying to derive an `ObligationCause` from this obligation, and
566
578
// report *all* sub-obligations as if they came directly from the parent
567
579
// obligation.
0 commit comments