@@ -461,8 +461,11 @@ impl<'tcx> ProofTreeVisitor<'tcx> for BestObligation<'tcx> {
461461 // for normalizes-to.
462462 let pred_kind = goal. goal ( ) . predicate . kind ( ) ;
463463 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) )
466469 }
467470 ty:: PredicateKind :: NormalizesTo ( normalizes_to)
468471 if matches ! (
@@ -491,7 +494,7 @@ impl<'tcx> ProofTreeVisitor<'tcx> for BestObligation<'tcx> {
491494
492495 let obligation;
493496 match ( child_mode, nested_goal. source ( ) ) {
494- ( ChildMode :: Trait ( _) , GoalSource :: Misc ) => {
497+ ( ChildMode :: Trait ( _) | ChildMode :: Host ( _ ) , GoalSource :: Misc ) => {
495498 continue ;
496499 }
497500 ( ChildMode :: Trait ( parent_trait_pred) , GoalSource :: ImplWhereBound ) => {
@@ -504,6 +507,10 @@ impl<'tcx> ProofTreeVisitor<'tcx> for BestObligation<'tcx> {
504507 ) ) ;
505508 impl_where_bound_count += 1 ;
506509 }
510+ ( ChildMode :: Host ( _) , GoalSource :: ImplWhereBound ) => {
511+ // TODO:
512+ obligation = make_obligation ( self . obligation . cause . clone ( ) ) ;
513+ }
507514 // Skip over a higher-ranked predicate.
508515 ( _, GoalSource :: InstantiateHigherRanked ) => {
509516 obligation = self . obligation . clone ( ) ;
@@ -562,6 +569,11 @@ enum ChildMode<'tcx> {
562569 // and skip all `GoalSource::Misc`, which represent useless obligations
563570 // such as alias-eq which may not hold.
564571 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 > > ) ,
565577 // Skip trying to derive an `ObligationCause` from this obligation, and
566578 // report *all* sub-obligations as if they came directly from the parent
567579 // obligation.
0 commit comments