@@ -675,12 +675,17 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
675
675
// ```
676
676
let mut predicates: Vec < Span > = traits:: elaborate (
677
677
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
+ ) ,
679
688
)
680
- . chain ( traits:: elaborate (
681
- tcx,
682
- tcx. predicates_of ( parent) . predicates . iter ( ) . map ( |( p, sp) | ( p. as_predicate ( ) , * sp) ) ,
683
- ) )
684
689
. filter_map ( |( pred, pred_span) | {
685
690
if let ty:: PredicateKind :: Clause ( clause) = pred. kind ( ) . skip_binder ( )
686
691
&& let ty:: ClauseKind :: TypeOutlives ( ty:: OutlivesPredicate ( pred_ty, r) ) = clause
@@ -690,7 +695,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
690
695
&& ( self . infcx . can_eq ( self . param_env , ty, pred_ty)
691
696
|| matches ! (
692
697
pred_ty. kind( ) ,
693
- ty:: Param ( name) if name. name. as_str ( ) == "Self" ) )
698
+ ty:: Param ( name) if name. name == kw :: SelfUpper ) )
694
699
{
695
700
Some ( pred_span)
696
701
} else {
0 commit comments