@@ -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_with_unbound_vars ( cx . tcx ) . skip_binder ( ) . kind ( ) {
1217+ let predicate_kind_name = match predicate. ignore_qualifiers ( ) . skip_binder ( ) . kind ( ) {
12181218 Trait ( ..) => "Trait" ,
12191219 TypeOutlives ( ..) |
12201220 RegionOutlives ( ..) => "Lifetime" ,
@@ -1499,38 +1499,32 @@ declare_lint_pass!(ExplicitOutlivesRequirements => [EXPLICIT_OUTLIVES_REQUIREMEN
14991499
15001500impl ExplicitOutlivesRequirements {
15011501 fn lifetimes_outliving_lifetime < ' tcx > (
1502- tcx : TyCtxt < ' tcx > ,
15031502 inferred_outlives : & ' tcx [ ( ty:: Predicate < ' tcx > , Span ) ] ,
15041503 index : u32 ,
15051504 ) -> Vec < ty:: Region < ' tcx > > {
15061505 inferred_outlives
15071506 . iter ( )
1508- . filter_map ( |( pred, _) | {
1509- match pred. ignore_qualifiers_with_unbound_vars ( tcx) . skip_binder ( ) . kind ( ) {
1510- & ty:: PredicateKind :: RegionOutlives ( ty:: OutlivesPredicate ( a, b) ) => match a {
1511- ty:: ReEarlyBound ( ebr) if ebr. index == index => Some ( b) ,
1512- _ => None ,
1513- } ,
1507+ . filter_map ( |( pred, _) | match pred. ignore_qualifiers ( ) . skip_binder ( ) . kind ( ) {
1508+ & ty:: PredicateKind :: RegionOutlives ( ty:: OutlivesPredicate ( a, b) ) => match a {
1509+ ty:: ReEarlyBound ( ebr) if ebr. index == index => Some ( b) ,
15141510 _ => None ,
1515- }
1511+ } ,
1512+ _ => None ,
15161513 } )
15171514 . collect ( )
15181515 }
15191516
15201517 fn lifetimes_outliving_type < ' tcx > (
1521- tcx : TyCtxt < ' tcx > ,
15221518 inferred_outlives : & ' tcx [ ( ty:: Predicate < ' tcx > , Span ) ] ,
15231519 index : u32 ,
15241520 ) -> Vec < ty:: Region < ' tcx > > {
15251521 inferred_outlives
15261522 . iter ( )
1527- . filter_map ( |( pred, _) | {
1528- match pred. ignore_qualifiers_with_unbound_vars ( tcx) . skip_binder ( ) . kind ( ) {
1529- & ty:: PredicateKind :: TypeOutlives ( ty:: OutlivesPredicate ( a, b) ) => {
1530- a. is_param ( index) . then_some ( b)
1531- }
1532- _ => None ,
1523+ . filter_map ( |( pred, _) | match pred. ignore_qualifiers ( ) . skip_binder ( ) . kind ( ) {
1524+ & ty:: PredicateKind :: TypeOutlives ( ty:: OutlivesPredicate ( a, b) ) => {
1525+ a. is_param ( index) . then_some ( b)
15331526 }
1527+ _ => None ,
15341528 } )
15351529 . collect ( )
15361530 }
@@ -1547,10 +1541,10 @@ impl ExplicitOutlivesRequirements {
15471541
15481542 match param. kind {
15491543 hir:: GenericParamKind :: Lifetime { .. } => {
1550- Self :: lifetimes_outliving_lifetime ( tcx , inferred_outlives, index)
1544+ Self :: lifetimes_outliving_lifetime ( inferred_outlives, index)
15511545 }
15521546 hir:: GenericParamKind :: Type { .. } => {
1553- Self :: lifetimes_outliving_type ( tcx , inferred_outlives, index)
1547+ Self :: lifetimes_outliving_type ( inferred_outlives, index)
15541548 }
15551549 hir:: GenericParamKind :: Const { .. } => Vec :: new ( ) ,
15561550 }
@@ -1702,11 +1696,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ExplicitOutlivesRequirements {
17021696 cx. tcx . named_region ( predicate. lifetime . hir_id )
17031697 {
17041698 (
1705- Self :: lifetimes_outliving_lifetime (
1706- cx. tcx ,
1707- inferred_outlives,
1708- index,
1709- ) ,
1699+ Self :: lifetimes_outliving_lifetime ( inferred_outlives, index) ,
17101700 & predicate. bounds ,
17111701 predicate. span ,
17121702 )
@@ -1722,11 +1712,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ExplicitOutlivesRequirements {
17221712 if let Res :: Def ( DefKind :: TyParam , def_id) = path. res {
17231713 let index = ty_generics. param_def_id_to_index [ & def_id] ;
17241714 (
1725- Self :: lifetimes_outliving_type (
1726- cx. tcx ,
1727- inferred_outlives,
1728- index,
1729- ) ,
1715+ Self :: lifetimes_outliving_type ( inferred_outlives, index) ,
17301716 & predicate. bounds ,
17311717 predicate. span ,
17321718 )
0 commit comments