@@ -675,12 +675,17 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
675675 // ```
676676 let mut predicates: Vec < Span > = traits:: elaborate (
677677 tcx,
678- tcx. predicates_of ( def_id) . predicates . iter ( ) . map ( |( p, sp) | ( p. as_predicate ( ) , * sp) ) ,
678+ tcx. predicates_of ( def_id)
679+ . predicates
680+ . iter ( )
681+ . map ( |( p, sp) | ( p. as_predicate ( ) , * sp) )
682+ . chain (
683+ tcx. predicates_of ( parent)
684+ . predicates
685+ . iter ( )
686+ . map ( |( p, sp) | ( p. as_predicate ( ) , * sp) ) ,
687+ ) ,
679688 )
680- . chain ( traits:: elaborate (
681- tcx,
682- tcx. predicates_of ( parent) . predicates . iter ( ) . map ( |( p, sp) | ( p. as_predicate ( ) , * sp) ) ,
683- ) )
684689 . filter_map ( |( pred, pred_span) | {
685690 if let ty:: PredicateKind :: Clause ( clause) = pred. kind ( ) . skip_binder ( )
686691 && let ty:: ClauseKind :: TypeOutlives ( ty:: OutlivesPredicate ( pred_ty, r) ) = clause
@@ -690,7 +695,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
690695 && ( self . infcx . can_eq ( self . param_env , ty, pred_ty)
691696 || matches ! (
692697 pred_ty. kind( ) ,
693- ty:: Param ( name) if name. name. as_str ( ) == "Self" ) )
698+ ty:: Param ( name) if name. name == kw :: SelfUpper ) )
694699 {
695700 Some ( pred_span)
696701 } else {
0 commit comments