@@ -413,6 +413,7 @@ impl<'tcx> BestObligation<'tcx> {
413
413
matches ! (
414
414
nested_goal. source( ) ,
415
415
GoalSource :: ImplWhereBound
416
+ | GoalSource :: AliasBoundConstCondition
416
417
| GoalSource :: InstantiateHigherRanked
417
418
| GoalSource :: AliasWellFormed
418
419
) && match self . consider_ambiguities {
@@ -495,7 +496,6 @@ impl<'tcx> ProofTreeVisitor<'tcx> for BestObligation<'tcx> {
495
496
} ;
496
497
497
498
let mut impl_where_bound_count = 0 ;
498
- let mut impl_const_condition_bound_count = 0 ;
499
499
for nested_goal in candidate. instantiate_nested_goals ( self . span ( ) ) {
500
500
trace ! ( nested_goal = ?( nested_goal. goal( ) , nested_goal. source( ) , nested_goal. result( ) ) ) ;
501
501
@@ -521,21 +521,25 @@ impl<'tcx> ProofTreeVisitor<'tcx> for BestObligation<'tcx> {
521
521
) ) ;
522
522
impl_where_bound_count += 1 ;
523
523
}
524
- ( ChildMode :: Host ( parent_host_pred) , GoalSource :: ImplWhereBound ) => {
524
+ (
525
+ ChildMode :: Host ( parent_host_pred) ,
526
+ GoalSource :: ImplWhereBound | GoalSource :: AliasBoundConstCondition ,
527
+ ) => {
525
528
obligation = make_obligation ( derive_host_cause (
526
529
tcx,
527
530
candidate. kind ( ) ,
528
531
self . obligation . cause . clone ( ) ,
529
- impl_const_condition_bound_count ,
532
+ impl_where_bound_count ,
530
533
parent_host_pred,
531
534
) ) ;
532
- impl_const_condition_bound_count += 1 ;
535
+ impl_where_bound_count += 1 ;
533
536
}
534
537
// Skip over a higher-ranked predicate.
535
538
( _, GoalSource :: InstantiateHigherRanked ) => {
536
539
obligation = self . obligation . clone ( ) ;
537
540
}
538
- ( ChildMode :: PassThrough , _) | ( _, GoalSource :: AliasWellFormed ) => {
541
+ ( ChildMode :: PassThrough , _)
542
+ | ( _, GoalSource :: AliasWellFormed | GoalSource :: AliasBoundConstCondition ) => {
539
543
obligation = make_obligation ( self . obligation . cause . clone ( ) ) ;
540
544
}
541
545
}
0 commit comments