@@ -1214,7 +1214,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TrivialConstraints {
12141214 for & ( predicate, span) in predicates. predicates {
12151215 // We don't actually look inside of the predicate,
12161216 // so it is safe to skip this binder here.
1217- let predicate_kind_name = match predicate. ignore_qualifiers ( ) . skip_binder ( ) . kind ( ) {
1217+ let predicate_kind_name = match predicate. ignore_qualifiers ( cx . tcx ) . skip_binder ( ) . kind ( ) {
12181218 Trait ( ..) => "Trait" ,
12191219 TypeOutlives ( ..) |
12201220 RegionOutlives ( ..) => "Lifetime" ,
@@ -1499,12 +1499,13 @@ declare_lint_pass!(ExplicitOutlivesRequirements => [EXPLICIT_OUTLIVES_REQUIREMEN
14991499
15001500impl ExplicitOutlivesRequirements {
15011501 fn lifetimes_outliving_lifetime < ' tcx > (
1502+ tcx : TyCtxt < ' tcx > ,
15021503 inferred_outlives : & ' tcx [ ( ty:: Predicate < ' tcx > , Span ) ] ,
15031504 index : u32 ,
15041505 ) -> Vec < ty:: Region < ' tcx > > {
15051506 inferred_outlives
15061507 . iter ( )
1507- . filter_map ( |( pred, _) | match pred. ignore_qualifiers ( ) . skip_binder ( ) . kind ( ) {
1508+ . filter_map ( |( pred, _) | match pred. ignore_qualifiers ( tcx ) . skip_binder ( ) . kind ( ) {
15081509 & ty:: PredicateKind :: RegionOutlives ( ty:: OutlivesPredicate ( a, b) ) => match a {
15091510 ty:: ReEarlyBound ( ebr) if ebr. index == index => Some ( b) ,
15101511 _ => None ,
@@ -1515,12 +1516,13 @@ impl ExplicitOutlivesRequirements {
15151516 }
15161517
15171518 fn lifetimes_outliving_type < ' tcx > (
1519+ tcx : TyCtxt < ' tcx > ,
15181520 inferred_outlives : & ' tcx [ ( ty:: Predicate < ' tcx > , Span ) ] ,
15191521 index : u32 ,
15201522 ) -> Vec < ty:: Region < ' tcx > > {
15211523 inferred_outlives
15221524 . iter ( )
1523- . filter_map ( |( pred, _) | match pred. ignore_qualifiers ( ) . skip_binder ( ) . kind ( ) {
1525+ . filter_map ( |( pred, _) | match pred. ignore_qualifiers ( tcx ) . skip_binder ( ) . kind ( ) {
15241526 & ty:: PredicateKind :: TypeOutlives ( ty:: OutlivesPredicate ( a, b) ) => {
15251527 a. is_param ( index) . then_some ( b)
15261528 }
@@ -1541,10 +1543,10 @@ impl ExplicitOutlivesRequirements {
15411543
15421544 match param. kind {
15431545 hir:: GenericParamKind :: Lifetime { .. } => {
1544- Self :: lifetimes_outliving_lifetime ( inferred_outlives, index)
1546+ Self :: lifetimes_outliving_lifetime ( tcx , inferred_outlives, index)
15451547 }
15461548 hir:: GenericParamKind :: Type { .. } => {
1547- Self :: lifetimes_outliving_type ( inferred_outlives, index)
1549+ Self :: lifetimes_outliving_type ( tcx , inferred_outlives, index)
15481550 }
15491551 hir:: GenericParamKind :: Const { .. } => Vec :: new ( ) ,
15501552 }
@@ -1696,7 +1698,11 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ExplicitOutlivesRequirements {
16961698 cx. tcx . named_region ( predicate. lifetime . hir_id )
16971699 {
16981700 (
1699- Self :: lifetimes_outliving_lifetime ( inferred_outlives, index) ,
1701+ Self :: lifetimes_outliving_lifetime (
1702+ cx. tcx ,
1703+ inferred_outlives,
1704+ index,
1705+ ) ,
17001706 & predicate. bounds ,
17011707 predicate. span ,
17021708 )
@@ -1712,7 +1718,11 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ExplicitOutlivesRequirements {
17121718 if let Res :: Def ( DefKind :: TyParam , def_id) = path. res {
17131719 let index = ty_generics. param_def_id_to_index [ & def_id] ;
17141720 (
1715- Self :: lifetimes_outliving_type ( inferred_outlives, index) ,
1721+ Self :: lifetimes_outliving_type (
1722+ cx. tcx ,
1723+ inferred_outlives,
1724+ index,
1725+ ) ,
17161726 & predicate. bounds ,
17171727 predicate. span ,
17181728 )
0 commit comments