@@ -544,8 +544,8 @@ impl<'tcx> ToPolyTraitRef<'tcx> for PolyTraitPredicate<'tcx> {
544
544
}
545
545
}
546
546
547
- pub trait Upcast < ' tcx , P = Predicate < ' tcx > > {
548
- fn upcast ( self , tcx : TyCtxt < ' tcx > ) -> P ;
547
+ pub trait Upcast < ' tcx , T > {
548
+ fn upcast ( self , tcx : TyCtxt < ' tcx > ) -> T ;
549
549
}
550
550
551
551
impl < ' tcx , T > Upcast < ' tcx , T > for T {
@@ -554,35 +554,35 @@ impl<'tcx, T> Upcast<'tcx, T> for T {
554
554
}
555
555
}
556
556
557
- impl < ' tcx > Upcast < ' tcx > for PredicateKind < ' tcx > {
557
+ impl < ' tcx > Upcast < ' tcx , ty :: Predicate < ' tcx > > for PredicateKind < ' tcx > {
558
558
#[ inline( always) ]
559
559
fn upcast ( self , tcx : TyCtxt < ' tcx > ) -> Predicate < ' tcx > {
560
560
ty:: Binder :: dummy ( self ) . upcast ( tcx)
561
561
}
562
562
}
563
563
564
- impl < ' tcx > Upcast < ' tcx > for Binder < ' tcx , PredicateKind < ' tcx > > {
564
+ impl < ' tcx > Upcast < ' tcx , ty :: Predicate < ' tcx > > for Binder < ' tcx , PredicateKind < ' tcx > > {
565
565
#[ inline( always) ]
566
566
fn upcast ( self , tcx : TyCtxt < ' tcx > ) -> Predicate < ' tcx > {
567
567
tcx. mk_predicate ( self )
568
568
}
569
569
}
570
570
571
- impl < ' tcx > Upcast < ' tcx > for ClauseKind < ' tcx > {
571
+ impl < ' tcx > Upcast < ' tcx , ty :: Predicate < ' tcx > > for ClauseKind < ' tcx > {
572
572
#[ inline( always) ]
573
573
fn upcast ( self , tcx : TyCtxt < ' tcx > ) -> Predicate < ' tcx > {
574
574
tcx. mk_predicate ( ty:: Binder :: dummy ( ty:: PredicateKind :: Clause ( self ) ) )
575
575
}
576
576
}
577
577
578
- impl < ' tcx > Upcast < ' tcx > for Binder < ' tcx , ClauseKind < ' tcx > > {
578
+ impl < ' tcx > Upcast < ' tcx , ty :: Predicate < ' tcx > > for Binder < ' tcx , ClauseKind < ' tcx > > {
579
579
#[ inline( always) ]
580
580
fn upcast ( self , tcx : TyCtxt < ' tcx > ) -> Predicate < ' tcx > {
581
581
tcx. mk_predicate ( self . map_bound ( ty:: PredicateKind :: Clause ) )
582
582
}
583
583
}
584
584
585
- impl < ' tcx > Upcast < ' tcx > for Clause < ' tcx > {
585
+ impl < ' tcx > Upcast < ' tcx , ty :: Predicate < ' tcx > > for Clause < ' tcx > {
586
586
#[ inline( always) ]
587
587
fn upcast ( self , _tcx : TyCtxt < ' tcx > ) -> Predicate < ' tcx > {
588
588
self . as_predicate ( )
@@ -603,7 +603,7 @@ impl<'tcx> Upcast<'tcx, Clause<'tcx>> for Binder<'tcx, ClauseKind<'tcx>> {
603
603
}
604
604
}
605
605
606
- impl < ' tcx > Upcast < ' tcx > for TraitRef < ' tcx > {
606
+ impl < ' tcx > Upcast < ' tcx , ty :: Predicate < ' tcx > > for TraitRef < ' tcx > {
607
607
#[ inline( always) ]
608
608
fn upcast ( self , tcx : TyCtxt < ' tcx > ) -> Predicate < ' tcx > {
609
609
ty:: Binder :: dummy ( self ) . upcast ( tcx)
@@ -625,7 +625,7 @@ impl<'tcx> Upcast<'tcx, Clause<'tcx>> for TraitRef<'tcx> {
625
625
}
626
626
}
627
627
628
- impl < ' tcx > Upcast < ' tcx > for Binder < ' tcx , TraitRef < ' tcx > > {
628
+ impl < ' tcx > Upcast < ' tcx , ty :: Predicate < ' tcx > > for Binder < ' tcx , TraitRef < ' tcx > > {
629
629
#[ inline( always) ]
630
630
fn upcast ( self , tcx : TyCtxt < ' tcx > ) -> Predicate < ' tcx > {
631
631
let pred: PolyTraitPredicate < ' tcx > = self . upcast ( tcx) ;
@@ -651,13 +651,13 @@ impl<'tcx> Upcast<'tcx, PolyTraitPredicate<'tcx>> for Binder<'tcx, TraitRef<'tcx
651
651
}
652
652
}
653
653
654
- impl < ' tcx > Upcast < ' tcx > for TraitPredicate < ' tcx > {
654
+ impl < ' tcx > Upcast < ' tcx , ty :: Predicate < ' tcx > > for TraitPredicate < ' tcx > {
655
655
fn upcast ( self , tcx : TyCtxt < ' tcx > ) -> Predicate < ' tcx > {
656
656
PredicateKind :: Clause ( ClauseKind :: Trait ( self ) ) . upcast ( tcx)
657
657
}
658
658
}
659
659
660
- impl < ' tcx > Upcast < ' tcx > for PolyTraitPredicate < ' tcx > {
660
+ impl < ' tcx > Upcast < ' tcx , ty :: Predicate < ' tcx > > for PolyTraitPredicate < ' tcx > {
661
661
fn upcast ( self , tcx : TyCtxt < ' tcx > ) -> Predicate < ' tcx > {
662
662
self . map_bound ( |p| PredicateKind :: Clause ( ClauseKind :: Trait ( p) ) ) . upcast ( tcx)
663
663
}
@@ -677,25 +677,25 @@ impl<'tcx> Upcast<'tcx, Clause<'tcx>> for PolyTraitPredicate<'tcx> {
677
677
}
678
678
}
679
679
680
- impl < ' tcx > Upcast < ' tcx > for PolyRegionOutlivesPredicate < ' tcx > {
680
+ impl < ' tcx > Upcast < ' tcx , ty :: Predicate < ' tcx > > for PolyRegionOutlivesPredicate < ' tcx > {
681
681
fn upcast ( self , tcx : TyCtxt < ' tcx > ) -> Predicate < ' tcx > {
682
682
self . map_bound ( |p| PredicateKind :: Clause ( ClauseKind :: RegionOutlives ( p) ) ) . upcast ( tcx)
683
683
}
684
684
}
685
685
686
- impl < ' tcx > Upcast < ' tcx > for OutlivesPredicate < Ty < ' tcx > , ty:: Region < ' tcx > > {
686
+ impl < ' tcx > Upcast < ' tcx , ty :: Predicate < ' tcx > > for OutlivesPredicate < Ty < ' tcx > , ty:: Region < ' tcx > > {
687
687
fn upcast ( self , tcx : TyCtxt < ' tcx > ) -> Predicate < ' tcx > {
688
688
ty:: Binder :: dummy ( PredicateKind :: Clause ( ClauseKind :: TypeOutlives ( self ) ) ) . upcast ( tcx)
689
689
}
690
690
}
691
691
692
- impl < ' tcx > Upcast < ' tcx > for ProjectionPredicate < ' tcx > {
692
+ impl < ' tcx > Upcast < ' tcx , ty :: Predicate < ' tcx > > for ProjectionPredicate < ' tcx > {
693
693
fn upcast ( self , tcx : TyCtxt < ' tcx > ) -> Predicate < ' tcx > {
694
694
ty:: Binder :: dummy ( PredicateKind :: Clause ( ClauseKind :: Projection ( self ) ) ) . upcast ( tcx)
695
695
}
696
696
}
697
697
698
- impl < ' tcx > Upcast < ' tcx > for PolyProjectionPredicate < ' tcx > {
698
+ impl < ' tcx > Upcast < ' tcx , ty :: Predicate < ' tcx > > for PolyProjectionPredicate < ' tcx > {
699
699
fn upcast ( self , tcx : TyCtxt < ' tcx > ) -> Predicate < ' tcx > {
700
700
self . map_bound ( |p| PredicateKind :: Clause ( ClauseKind :: Projection ( p) ) ) . upcast ( tcx)
701
701
}
@@ -715,7 +715,7 @@ impl<'tcx> Upcast<'tcx, Clause<'tcx>> for PolyProjectionPredicate<'tcx> {
715
715
}
716
716
}
717
717
718
- impl < ' tcx > Upcast < ' tcx > for NormalizesTo < ' tcx > {
718
+ impl < ' tcx > Upcast < ' tcx , ty :: Predicate < ' tcx > > for NormalizesTo < ' tcx > {
719
719
fn upcast ( self , tcx : TyCtxt < ' tcx > ) -> Predicate < ' tcx > {
720
720
PredicateKind :: NormalizesTo ( self ) . upcast ( tcx)
721
721
}
0 commit comments