@@ -669,12 +669,17 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
669669 // ```
670670 let mut predicates: Vec < Span > = traits:: elaborate (
671671 tcx,
672- tcx. predicates_of ( def_id) . predicates . iter ( ) . map ( |( p, sp) | ( p. as_predicate ( ) , * sp) ) ,
672+ tcx. predicates_of ( def_id)
673+ . predicates
674+ . iter ( )
675+ . map ( |( p, sp) | ( p. as_predicate ( ) , * sp) )
676+ . chain (
677+ tcx. predicates_of ( parent)
678+ . predicates
679+ . iter ( )
680+ . map ( |( p, sp) | ( p. as_predicate ( ) , * sp) ) ,
681+ ) ,
673682 )
674- . chain ( traits:: elaborate (
675- tcx,
676- tcx. predicates_of ( parent) . predicates . iter ( ) . map ( |( p, sp) | ( p. as_predicate ( ) , * sp) ) ,
677- ) )
678683 . filter_map ( |( pred, pred_span) | {
679684 if let ty:: PredicateKind :: Clause ( clause) = pred. kind ( ) . skip_binder ( )
680685 && let ty:: ClauseKind :: TypeOutlives ( ty:: OutlivesPredicate ( pred_ty, r) ) = clause
@@ -684,7 +689,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
684689 && ( self . infcx . can_eq ( self . param_env , ty, pred_ty)
685690 || matches ! (
686691 pred_ty. kind( ) ,
687- ty:: Param ( name) if name. name. as_str ( ) == "Self" ) )
692+ ty:: Param ( name) if name. name == kw :: SelfUpper ) )
688693 {
689694 Some ( pred_span)
690695 } else {
0 commit comments