@@ -1214,7 +1214,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TrivialConstraints {
1214
1214
for & ( predicate, span) in predicates. predicates {
1215
1215
// We don't actually look inside of the predicate,
1216
1216
// 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 ( ) {
1218
1218
Trait ( ..) => "Trait" ,
1219
1219
TypeOutlives ( ..) |
1220
1220
RegionOutlives ( ..) => "Lifetime" ,
@@ -1499,38 +1499,32 @@ declare_lint_pass!(ExplicitOutlivesRequirements => [EXPLICIT_OUTLIVES_REQUIREMEN
1499
1499
1500
1500
impl ExplicitOutlivesRequirements {
1501
1501
fn lifetimes_outliving_lifetime < ' tcx > (
1502
- tcx : TyCtxt < ' tcx > ,
1503
1502
inferred_outlives : & ' tcx [ ( ty:: Predicate < ' tcx > , Span ) ] ,
1504
1503
index : u32 ,
1505
1504
) -> Vec < ty:: Region < ' tcx > > {
1506
1505
inferred_outlives
1507
1506
. 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) ,
1514
1510
_ => None ,
1515
- }
1511
+ } ,
1512
+ _ => None ,
1516
1513
} )
1517
1514
. collect ( )
1518
1515
}
1519
1516
1520
1517
fn lifetimes_outliving_type < ' tcx > (
1521
- tcx : TyCtxt < ' tcx > ,
1522
1518
inferred_outlives : & ' tcx [ ( ty:: Predicate < ' tcx > , Span ) ] ,
1523
1519
index : u32 ,
1524
1520
) -> Vec < ty:: Region < ' tcx > > {
1525
1521
inferred_outlives
1526
1522
. 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)
1533
1526
}
1527
+ _ => None ,
1534
1528
} )
1535
1529
. collect ( )
1536
1530
}
@@ -1547,10 +1541,10 @@ impl ExplicitOutlivesRequirements {
1547
1541
1548
1542
match param. kind {
1549
1543
hir:: GenericParamKind :: Lifetime { .. } => {
1550
- Self :: lifetimes_outliving_lifetime ( tcx , inferred_outlives, index)
1544
+ Self :: lifetimes_outliving_lifetime ( inferred_outlives, index)
1551
1545
}
1552
1546
hir:: GenericParamKind :: Type { .. } => {
1553
- Self :: lifetimes_outliving_type ( tcx , inferred_outlives, index)
1547
+ Self :: lifetimes_outliving_type ( inferred_outlives, index)
1554
1548
}
1555
1549
hir:: GenericParamKind :: Const { .. } => Vec :: new ( ) ,
1556
1550
}
@@ -1702,11 +1696,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ExplicitOutlivesRequirements {
1702
1696
cx. tcx . named_region ( predicate. lifetime . hir_id )
1703
1697
{
1704
1698
(
1705
- Self :: lifetimes_outliving_lifetime (
1706
- cx. tcx ,
1707
- inferred_outlives,
1708
- index,
1709
- ) ,
1699
+ Self :: lifetimes_outliving_lifetime ( inferred_outlives, index) ,
1710
1700
& predicate. bounds ,
1711
1701
predicate. span ,
1712
1702
)
@@ -1722,11 +1712,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ExplicitOutlivesRequirements {
1722
1712
if let Res :: Def ( DefKind :: TyParam , def_id) = path. res {
1723
1713
let index = ty_generics. param_def_id_to_index [ & def_id] ;
1724
1714
(
1725
- Self :: lifetimes_outliving_type (
1726
- cx. tcx ,
1727
- inferred_outlives,
1728
- index,
1729
- ) ,
1715
+ Self :: lifetimes_outliving_type ( inferred_outlives, index) ,
1730
1716
& predicate. bounds ,
1731
1717
predicate. span ,
1732
1718
)
0 commit comments