@@ -678,12 +678,17 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
678678 // ```
679679 let mut predicates: Vec < Span > = traits:: elaborate (
680680 tcx,
681- tcx. predicates_of ( def_id) . predicates . iter ( ) . map ( |( p, sp) | ( p. as_predicate ( ) , * sp) ) ,
681+ tcx. predicates_of ( def_id)
682+ . predicates
683+ . iter ( )
684+ . map ( |( p, sp) | ( p. as_predicate ( ) , * sp) )
685+ . chain (
686+ tcx. predicates_of ( parent)
687+ . predicates
688+ . iter ( )
689+ . map ( |( p, sp) | ( p. as_predicate ( ) , * sp) ) ,
690+ ) ,
682691 )
683- . chain ( traits:: elaborate (
684- tcx,
685- tcx. predicates_of ( parent) . predicates . iter ( ) . map ( |( p, sp) | ( p. as_predicate ( ) , * sp) ) ,
686- ) )
687692 . filter_map ( |( pred, pred_span) | {
688693 if let ty:: PredicateKind :: Clause ( clause) = pred. kind ( ) . skip_binder ( )
689694 && let ty:: ClauseKind :: TypeOutlives ( ty:: OutlivesPredicate ( pred_ty, r) ) = clause
@@ -693,7 +698,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
693698 && ( self . infcx . can_eq ( self . param_env , ty, pred_ty)
694699 || matches ! (
695700 pred_ty. kind( ) ,
696- ty:: Param ( name) if name. name. as_str ( ) == "Self" ) )
701+ ty:: Param ( name) if name. name == kw :: SelfUpper ) )
697702 {
698703 Some ( pred_span)
699704 } else {
0 commit comments