@@ -268,14 +268,12 @@ impl<'tcx> InferCtxt<'tcx> {
268
268
( GenericArgKind :: Lifetime ( v_o) , GenericArgKind :: Lifetime ( v_r) ) => {
269
269
// To make `v_o = v_r`, we emit `v_o: v_r` and `v_r: v_o`.
270
270
if v_o != v_r {
271
- output_query_region_constraints. outlives . push ( (
272
- ty:: Binder :: dummy ( ty:: OutlivesPredicate ( v_o. into ( ) , v_r) ) ,
273
- constraint_category,
274
- ) ) ;
275
- output_query_region_constraints. outlives . push ( (
276
- ty:: Binder :: dummy ( ty:: OutlivesPredicate ( v_r. into ( ) , v_o) ) ,
277
- constraint_category,
278
- ) ) ;
271
+ output_query_region_constraints
272
+ . outlives
273
+ . push ( ( ty:: OutlivesPredicate ( v_o. into ( ) , v_r) , constraint_category) ) ;
274
+ output_query_region_constraints
275
+ . outlives
276
+ . push ( ( ty:: OutlivesPredicate ( v_r. into ( ) , v_o) , constraint_category) ) ;
279
277
}
280
278
}
281
279
@@ -318,10 +316,8 @@ impl<'tcx> InferCtxt<'tcx> {
318
316
query_response. value . region_constraints . outlives . iter ( ) . filter_map ( |& r_c| {
319
317
let r_c = substitute_value ( self . tcx , & result_subst, r_c) ;
320
318
321
- // Screen out `'a: 'a` cases -- we skip the binder here but
322
- // only compare the inner values to one another, so they are still at
323
- // consistent binding levels.
324
- let ty:: OutlivesPredicate ( k1, r2) = r_c. 0 . skip_binder ( ) ;
319
+ // Screen out `'a: 'a` cases.
320
+ let ty:: OutlivesPredicate ( k1, r2) = r_c. 0 ;
325
321
if k1 != r2. into ( ) { Some ( r_c) } else { None }
326
322
} ) ,
327
323
) ;
@@ -559,11 +555,11 @@ impl<'tcx> InferCtxt<'tcx> {
559
555
560
556
pub fn query_outlives_constraint_to_obligation (
561
557
& self ,
562
- predicate : QueryOutlivesConstraint < ' tcx > ,
558
+ ( predicate, _ ) : QueryOutlivesConstraint < ' tcx > ,
563
559
cause : ObligationCause < ' tcx > ,
564
560
param_env : ty:: ParamEnv < ' tcx > ,
565
561
) -> Obligation < ' tcx , ty:: Predicate < ' tcx > > {
566
- let ty:: OutlivesPredicate ( k1, r2) = predicate. 0 . skip_binder ( ) ;
562
+ let ty:: OutlivesPredicate ( k1, r2) = predicate;
567
563
568
564
let atom = match k1. unpack ( ) {
569
565
GenericArgKind :: Lifetime ( r1) => {
@@ -578,7 +574,7 @@ impl<'tcx> InferCtxt<'tcx> {
578
574
span_bug ! ( cause. span, "unexpected const outlives {:?}" , predicate) ;
579
575
}
580
576
} ;
581
- let predicate = predicate . 0 . rebind ( atom) ;
577
+ let predicate = ty :: Binder :: dummy ( atom) ;
582
578
583
579
Obligation :: new ( self . tcx , cause, param_env, predicate)
584
580
}
@@ -643,8 +639,7 @@ pub fn make_query_region_constraints<'tcx>(
643
639
let outlives: Vec < _ > = constraints
644
640
. iter ( )
645
641
. map ( |( k, origin) | {
646
- // no bound vars in the code above
647
- let constraint = ty:: Binder :: dummy ( match * k {
642
+ let constraint = match * k {
648
643
// Swap regions because we are going from sub (<=) to outlives
649
644
// (>=).
650
645
Constraint :: VarSubVar ( v1, v2) => ty:: OutlivesPredicate (
@@ -658,16 +653,12 @@ pub fn make_query_region_constraints<'tcx>(
658
653
ty:: OutlivesPredicate ( tcx. mk_region ( ty:: ReVar ( v2) ) . into ( ) , r1)
659
654
}
660
655
Constraint :: RegSubReg ( r1, r2) => ty:: OutlivesPredicate ( r2. into ( ) , r1) ,
661
- } ) ;
656
+ } ;
662
657
( constraint, origin. to_constraint_category ( ) )
663
658
} )
664
- . chain (
665
- outlives_obligations
666
- // no bound vars in the code above
667
- . map ( |( ty, r, constraint_category) | {
668
- ( ty:: Binder :: dummy ( ty:: OutlivesPredicate ( ty. into ( ) , r) ) , constraint_category)
669
- } ) ,
670
- )
659
+ . chain ( outlives_obligations. map ( |( ty, r, constraint_category) | {
660
+ ( ty:: OutlivesPredicate ( ty. into ( ) , r) , constraint_category)
661
+ } ) )
671
662
. collect ( ) ;
672
663
673
664
QueryRegionConstraints { outlives, member_constraints : member_constraints. clone ( ) }
0 commit comments