@@ -640,16 +640,30 @@ pub(super) fn implied_predicates_with_filter(
640640
641641 // Now require that immediate supertraits are converted, which will, in
642642 // turn, reach indirect supertraits, so we detect cycles now instead of
643- // overflowing during elaboration.
644- if matches ! ( filter, PredicateFilter :: SelfOnly ) {
645- for & ( pred, span) in implied_bounds {
646- debug ! ( "superbound: {:?}" , pred) ;
647- if let ty:: ClauseKind :: Trait ( bound) = pred. kind ( ) . skip_binder ( )
648- && bound. polarity == ty:: ImplPolarity :: Positive
649- {
650- tcx. at ( span) . super_predicates_of ( bound. def_id ( ) ) ;
643+ // overflowing during elaboration. Same for implied predicates, which
644+ // make sure we walk into associated type bounds.
645+ match filter {
646+ PredicateFilter :: SelfOnly => {
647+ for & ( pred, span) in implied_bounds {
648+ debug ! ( "superbound: {:?}" , pred) ;
649+ if let ty:: ClauseKind :: Trait ( bound) = pred. kind ( ) . skip_binder ( )
650+ && bound. polarity == ty:: ImplPolarity :: Positive
651+ {
652+ tcx. at ( span) . super_predicates_of ( bound. def_id ( ) ) ;
653+ }
654+ }
655+ }
656+ PredicateFilter :: SelfAndAssociatedTypeBounds => {
657+ for & ( pred, span) in implied_bounds {
658+ debug ! ( "superbound: {:?}" , pred) ;
659+ if let ty:: ClauseKind :: Trait ( bound) = pred. kind ( ) . skip_binder ( )
660+ && bound. polarity == ty:: ImplPolarity :: Positive
661+ {
662+ tcx. at ( span) . implied_predicates_of ( bound. def_id ( ) ) ;
663+ }
651664 }
652665 }
666+ _ => { }
653667 }
654668
655669 ty:: GenericPredicates { parent : None , predicates : implied_bounds }
0 commit comments