@@ -482,12 +482,12 @@ impl<'a> Clean<Option<WherePredicate>> for ty::Predicate<'a> {
482
482
fn clean ( & self , cx : & DocContext < ' _ > ) -> Option < WherePredicate > {
483
483
match self . skip_binders ( ) {
484
484
ty:: PredicateAtom :: Trait ( pred, _) => Some ( ty:: Binder :: bind ( pred) . clean ( cx) ) ,
485
- ty:: PredicateAtom :: Subtype ( pred) => Some ( ty:: Binder :: bind ( pred) . clean ( cx) ) ,
486
- ty:: PredicateAtom :: RegionOutlives ( pred) => ty:: Binder :: bind ( pred) . clean ( cx) ,
487
- ty:: PredicateAtom :: TypeOutlives ( pred) => ty:: Binder :: bind ( pred) . clean ( cx) ,
488
- ty:: PredicateAtom :: Projection ( pred) => Some ( ty:: Binder :: bind ( pred) . clean ( cx) ) ,
485
+ ty:: PredicateAtom :: RegionOutlives ( pred) => pred. clean ( cx) ,
486
+ ty:: PredicateAtom :: TypeOutlives ( pred) => pred. clean ( cx) ,
487
+ ty:: PredicateAtom :: Projection ( pred) => Some ( pred. clean ( cx) ) ,
489
488
490
- ty:: PredicateAtom :: WellFormed ( ..)
489
+ ty:: PredicateAtom :: Subtype ( ..)
490
+ | ty:: PredicateAtom :: WellFormed ( ..)
491
491
| ty:: PredicateAtom :: ObjectSafe ( ..)
492
492
| ty:: PredicateAtom :: ClosureKind ( ..)
493
493
| ty:: PredicateAtom :: ConstEvaluatable ( ..)
@@ -506,20 +506,11 @@ impl<'a> Clean<WherePredicate> for ty::PolyTraitPredicate<'a> {
506
506
}
507
507
}
508
508
509
- impl < ' tcx > Clean < WherePredicate > for ty:: PolySubtypePredicate < ' tcx > {
510
- fn clean ( & self , _cx : & DocContext < ' _ > ) -> WherePredicate {
511
- panic ! (
512
- "subtype predicates are an internal rustc artifact \
513
- and should not be seen by rustdoc"
514
- )
515
- }
516
- }
517
-
518
509
impl < ' tcx > Clean < Option < WherePredicate > >
519
- for ty:: PolyOutlivesPredicate < ty:: Region < ' tcx > , ty:: Region < ' tcx > >
510
+ for ty:: OutlivesPredicate < ty:: Region < ' tcx > , ty:: Region < ' tcx > >
520
511
{
521
512
fn clean ( & self , cx : & DocContext < ' _ > ) -> Option < WherePredicate > {
522
- let ty:: OutlivesPredicate ( a, b) = self . skip_binder ( ) ;
513
+ let ty:: OutlivesPredicate ( a, b) = self ;
523
514
524
515
if let ( ty:: ReEmpty ( _) , ty:: ReEmpty ( _) ) = ( a, b) {
525
516
return None ;
@@ -532,9 +523,9 @@ impl<'tcx> Clean<Option<WherePredicate>>
532
523
}
533
524
}
534
525
535
- impl < ' tcx > Clean < Option < WherePredicate > > for ty:: PolyOutlivesPredicate < Ty < ' tcx > , ty:: Region < ' tcx > > {
526
+ impl < ' tcx > Clean < Option < WherePredicate > > for ty:: OutlivesPredicate < Ty < ' tcx > , ty:: Region < ' tcx > > {
536
527
fn clean ( & self , cx : & DocContext < ' _ > ) -> Option < WherePredicate > {
537
- let ty:: OutlivesPredicate ( ty, lt) = self . skip_binder ( ) ;
528
+ let ty:: OutlivesPredicate ( ty, lt) = self ;
538
529
539
530
if let ty:: ReEmpty ( _) = lt {
540
531
return None ;
@@ -547,9 +538,9 @@ impl<'tcx> Clean<Option<WherePredicate>> for ty::PolyOutlivesPredicate<Ty<'tcx>,
547
538
}
548
539
}
549
540
550
- impl < ' tcx > Clean < WherePredicate > for ty:: PolyProjectionPredicate < ' tcx > {
541
+ impl < ' tcx > Clean < WherePredicate > for ty:: ProjectionPredicate < ' tcx > {
551
542
fn clean ( & self , cx : & DocContext < ' _ > ) -> WherePredicate {
552
- let ty:: ProjectionPredicate { projection_ty, ty } = self . skip_binder ( ) ;
543
+ let ty:: ProjectionPredicate { projection_ty, ty } = self ;
553
544
WherePredicate :: EqPredicate { lhs : projection_ty. clean ( cx) , rhs : ty. clean ( cx) }
554
545
}
555
546
}
@@ -1666,8 +1657,8 @@ impl<'tcx> Clean<Type> for Ty<'tcx> {
1666
1657
ty:: PredicateAtom :: Trait ( tr, _constness) => {
1667
1658
ty:: Binder :: bind ( tr. trait_ref )
1668
1659
}
1669
- ty:: PredicateAtom :: TypeOutlives ( pred ) => {
1670
- if let Some ( r) = pred . 1 . clean ( cx) {
1660
+ ty:: PredicateAtom :: TypeOutlives ( ty :: OutlivesPredicate ( _ty , reg ) ) => {
1661
+ if let Some ( r) = reg . clean ( cx) {
1671
1662
regions. push ( GenericBound :: Outlives ( r) ) ;
1672
1663
}
1673
1664
return None ;
@@ -1686,9 +1677,8 @@ impl<'tcx> Clean<Type> for Ty<'tcx> {
1686
1677
. predicates
1687
1678
. iter ( )
1688
1679
. filter_map ( |pred| {
1689
- // We never rebind `proj`, so `skip_binders_unchecked` is safe here.
1690
1680
if let ty:: PredicateAtom :: Projection ( proj) =
1691
- pred. skip_binders_unchecked ( )
1681
+ pred. bound_atom ( cx . tcx ) . skip_binder ( )
1692
1682
{
1693
1683
if proj. projection_ty . trait_ref ( cx. tcx )
1694
1684
== trait_ref. skip_binder ( )
0 commit comments