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