@@ -268,14 +268,12 @@ impl<'tcx> InferCtxt<'tcx> {
268268 ( GenericArgKind :: Lifetime ( v_o) , GenericArgKind :: Lifetime ( v_r) ) => {
269269 // To make `v_o = v_r`, we emit `v_o: v_r` and `v_r: v_o`.
270270 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) ) ;
279277 }
280278 }
281279
@@ -318,10 +316,8 @@ impl<'tcx> InferCtxt<'tcx> {
318316 query_response. value . region_constraints . outlives . iter ( ) . filter_map ( |& r_c| {
319317 let r_c = substitute_value ( self . tcx , & result_subst, r_c) ;
320318
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 ;
325321 if k1 != r2. into ( ) { Some ( r_c) } else { None }
326322 } ) ,
327323 ) ;
@@ -559,11 +555,11 @@ impl<'tcx> InferCtxt<'tcx> {
559555
560556 pub fn query_outlives_constraint_to_obligation (
561557 & self ,
562- predicate : QueryOutlivesConstraint < ' tcx > ,
558+ ( predicate, _ ) : QueryOutlivesConstraint < ' tcx > ,
563559 cause : ObligationCause < ' tcx > ,
564560 param_env : ty:: ParamEnv < ' tcx > ,
565561 ) -> Obligation < ' tcx , ty:: Predicate < ' tcx > > {
566- let ty:: OutlivesPredicate ( k1, r2) = predicate. 0 . skip_binder ( ) ;
562+ let ty:: OutlivesPredicate ( k1, r2) = predicate;
567563
568564 let atom = match k1. unpack ( ) {
569565 GenericArgKind :: Lifetime ( r1) => {
@@ -578,7 +574,7 @@ impl<'tcx> InferCtxt<'tcx> {
578574 span_bug ! ( cause. span, "unexpected const outlives {:?}" , predicate) ;
579575 }
580576 } ;
581- let predicate = predicate . 0 . rebind ( atom) ;
577+ let predicate = ty :: Binder :: dummy ( atom) ;
582578
583579 Obligation :: new ( self . tcx , cause, param_env, predicate)
584580 }
@@ -643,8 +639,7 @@ pub fn make_query_region_constraints<'tcx>(
643639 let outlives: Vec < _ > = constraints
644640 . iter ( )
645641 . map ( |( k, origin) | {
646- // no bound vars in the code above
647- let constraint = ty:: Binder :: dummy ( match * k {
642+ let constraint = match * k {
648643 // Swap regions because we are going from sub (<=) to outlives
649644 // (>=).
650645 Constraint :: VarSubVar ( v1, v2) => ty:: OutlivesPredicate (
@@ -658,16 +653,12 @@ pub fn make_query_region_constraints<'tcx>(
658653 ty:: OutlivesPredicate ( tcx. mk_region ( ty:: ReVar ( v2) ) . into ( ) , r1)
659654 }
660655 Constraint :: RegSubReg ( r1, r2) => ty:: OutlivesPredicate ( r2. into ( ) , r1) ,
661- } ) ;
656+ } ;
662657 ( constraint, origin. to_constraint_category ( ) )
663658 } )
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+ } ) )
671662 . collect ( ) ;
672663
673664 QueryRegionConstraints { outlives, member_constraints : member_constraints. clone ( ) }
0 commit comments