11use rustc_data_structures:: captures:: Captures ;
22use rustc_data_structures:: intern:: Interned ;
33use rustc_hir:: def_id:: DefId ;
4- use rustc_macros:: {
5- extension, HashStable , Lift , TyDecodable , TyEncodable , TypeFoldable , TypeVisitable ,
6- } ;
4+ use rustc_macros:: { extension, HashStable } ;
75use rustc_type_ir as ir;
86use std:: cmp:: Ordering ;
97
@@ -24,6 +22,15 @@ pub type PredicateKind<'tcx> = ir::PredicateKind<TyCtxt<'tcx>>;
2422pub type NormalizesTo < ' tcx > = ir:: NormalizesTo < TyCtxt < ' tcx > > ;
2523pub type CoercePredicate < ' tcx > = ir:: CoercePredicate < TyCtxt < ' tcx > > ;
2624pub type SubtypePredicate < ' tcx > = ir:: SubtypePredicate < TyCtxt < ' tcx > > ;
25+ pub type OutlivesPredicate < ' tcx , T > = ir:: OutlivesPredicate < TyCtxt < ' tcx > , T > ;
26+ pub type RegionOutlivesPredicate < ' tcx > = OutlivesPredicate < ' tcx , ty:: Region < ' tcx > > ;
27+ pub type TypeOutlivesPredicate < ' tcx > = OutlivesPredicate < ' tcx , Ty < ' tcx > > ;
28+ pub type PolyTraitPredicate < ' tcx > = ty:: Binder < ' tcx , TraitPredicate < ' tcx > > ;
29+ pub type PolyRegionOutlivesPredicate < ' tcx > = ty:: Binder < ' tcx , RegionOutlivesPredicate < ' tcx > > ;
30+ pub type PolyTypeOutlivesPredicate < ' tcx > = ty:: Binder < ' tcx , TypeOutlivesPredicate < ' tcx > > ;
31+ pub type PolySubtypePredicate < ' tcx > = ty:: Binder < ' tcx , SubtypePredicate < ' tcx > > ;
32+ pub type PolyCoercePredicate < ' tcx > = ty:: Binder < ' tcx , CoercePredicate < ' tcx > > ;
33+ pub type PolyProjectionPredicate < ' tcx > = ty:: Binder < ' tcx , ProjectionPredicate < ' tcx > > ;
2734
2835/// A statement that can be proven by a trait solver. This includes things that may
2936/// show up in where clauses, such as trait predicates and projection predicates,
@@ -405,20 +412,6 @@ impl<'tcx> Clause<'tcx> {
405412 }
406413}
407414
408- pub type PolyTraitPredicate < ' tcx > = ty:: Binder < ' tcx , TraitPredicate < ' tcx > > ;
409-
410- /// `A: B`
411- #[ derive( Clone , Copy , PartialEq , Eq , PartialOrd , Ord , Hash , Debug , TyEncodable , TyDecodable ) ]
412- #[ derive( HashStable , TypeFoldable , TypeVisitable , Lift ) ]
413- pub struct OutlivesPredicate < A , B > ( pub A , pub B ) ;
414- pub type RegionOutlivesPredicate < ' tcx > = OutlivesPredicate < ty:: Region < ' tcx > , ty:: Region < ' tcx > > ;
415- pub type TypeOutlivesPredicate < ' tcx > = OutlivesPredicate < Ty < ' tcx > , ty:: Region < ' tcx > > ;
416- pub type PolyRegionOutlivesPredicate < ' tcx > = ty:: Binder < ' tcx , RegionOutlivesPredicate < ' tcx > > ;
417- pub type PolyTypeOutlivesPredicate < ' tcx > = ty:: Binder < ' tcx , TypeOutlivesPredicate < ' tcx > > ;
418- pub type PolySubtypePredicate < ' tcx > = ty:: Binder < ' tcx , SubtypePredicate < ' tcx > > ;
419- pub type PolyCoercePredicate < ' tcx > = ty:: Binder < ' tcx , CoercePredicate < ' tcx > > ;
420- pub type PolyProjectionPredicate < ' tcx > = Binder < ' tcx , ProjectionPredicate < ' tcx > > ;
421-
422415pub trait ToPolyTraitRef < ' tcx > {
423416 fn to_poly_trait_ref ( & self ) -> PolyTraitRef < ' tcx > ;
424417}
@@ -545,10 +538,8 @@ impl<'tcx> UpcastFrom<TyCtxt<'tcx>, PolyRegionOutlivesPredicate<'tcx>> for Predi
545538 }
546539}
547540
548- impl < ' tcx > UpcastFrom < TyCtxt < ' tcx > , OutlivesPredicate < Ty < ' tcx > , ty:: Region < ' tcx > > >
549- for Predicate < ' tcx >
550- {
551- fn upcast_from ( from : OutlivesPredicate < Ty < ' tcx > , ty:: Region < ' tcx > > , tcx : TyCtxt < ' tcx > ) -> Self {
541+ impl < ' tcx > UpcastFrom < TyCtxt < ' tcx > , TypeOutlivesPredicate < ' tcx > > for Predicate < ' tcx > {
542+ fn upcast_from ( from : TypeOutlivesPredicate < ' tcx > , tcx : TyCtxt < ' tcx > ) -> Self {
552543 ty:: Binder :: dummy ( PredicateKind :: Clause ( ClauseKind :: TypeOutlives ( from) ) ) . upcast ( tcx)
553544 }
554545}
0 commit comments