@@ -234,8 +234,8 @@ pub enum ImplSubject<'tcx> {
234234 Inherent ( Ty < ' tcx > ) ,
235235}
236236
237- #[ derive( Copy , Clone , PartialEq , Eq , Hash , TyEncodable , TyDecodable , HashStable , Debug ) ]
238- #[ derive( TypeFoldable , TypeVisitable ) ]
237+ #[ derive( Copy , Clone , PartialEq , Eq , Hash , Debug , PartialOrd , Ord ) ]
238+ #[ derive( HashStable , TypeFoldable , TypeVisitable , TyEncodable , TyDecodable ) ]
239239pub enum ImplPolarity {
240240 /// `impl Trait for Type`
241241 Positive ,
@@ -491,7 +491,7 @@ impl EarlyParamRegion {
491491/// predicate which is emitted when a type is coerced to a trait object.
492492///
493493/// Use this rather than `PredicateKind`, whenever possible.
494- #[ derive( Clone , Copy , PartialEq , Eq , Hash , HashStable ) ]
494+ #[ derive( Clone , Copy , PartialEq , Eq , PartialOrd , Ord , Hash , HashStable ) ]
495495#[ rustc_pass_by_value]
496496pub struct Predicate < ' tcx > (
497497 Interned < ' tcx , WithCachedTypeInfo < ty:: Binder < ' tcx , PredicateKind < ' tcx > > > > ,
@@ -591,7 +591,7 @@ impl rustc_errors::IntoDiagnosticArg for Clause<'_> {
591591/// A subset of predicates which can be assumed by the trait solver. They show up in
592592/// an item's where clauses, hence the name `Clause`, and may either be user-written
593593/// (such as traits) or may be inserted during lowering.
594- #[ derive( Clone , Copy , PartialEq , Eq , Hash , HashStable ) ]
594+ #[ derive( Clone , Copy , PartialEq , Eq , Hash , HashStable , PartialOrd , Ord ) ]
595595#[ rustc_pass_by_value]
596596pub struct Clause < ' tcx > ( Interned < ' tcx , WithCachedTypeInfo < ty:: Binder < ' tcx , PredicateKind < ' tcx > > > > ) ;
597597
@@ -764,8 +764,8 @@ impl<'tcx> Clause<'tcx> {
764764 }
765765}
766766
767- #[ derive( Clone , Copy , PartialEq , Eq , Hash , TyEncodable , TyDecodable ) ]
768- #[ derive( HashStable , TypeFoldable , TypeVisitable , Lift ) ]
767+ #[ derive( Clone , Copy , PartialEq , Eq , Hash , PartialOrd , Ord ) ]
768+ #[ derive( HashStable , TypeFoldable , TypeVisitable , Lift , TyEncodable , TyDecodable ) ]
769769pub struct TraitPredicate < ' tcx > {
770770 pub trait_ref : TraitRef < ' tcx > ,
771771
@@ -823,8 +823,8 @@ pub type PolyTypeOutlivesPredicate<'tcx> = ty::Binder<'tcx, TypeOutlivesPredicat
823823/// Encodes that `a` must be a subtype of `b`. The `a_is_expected` flag indicates
824824/// whether the `a` type is the type that we should label as "expected" when
825825/// presenting user diagnostics.
826- #[ derive( Clone , Copy , PartialEq , Eq , Hash , Debug , TyEncodable , TyDecodable ) ]
827- #[ derive( HashStable , TypeFoldable , TypeVisitable , Lift ) ]
826+ #[ derive( Clone , Copy , PartialEq , Eq , Hash , Debug , PartialOrd , Ord ) ]
827+ #[ derive( HashStable , TypeFoldable , TypeVisitable , Lift , TyEncodable , TyDecodable ) ]
828828pub struct SubtypePredicate < ' tcx > {
829829 pub a_is_expected : bool ,
830830 pub a : Ty < ' tcx > ,
@@ -833,8 +833,8 @@ pub struct SubtypePredicate<'tcx> {
833833pub type PolySubtypePredicate < ' tcx > = ty:: Binder < ' tcx , SubtypePredicate < ' tcx > > ;
834834
835835/// Encodes that we have to coerce *from* the `a` type to the `b` type.
836- #[ derive( Clone , Copy , PartialEq , Eq , Hash , Debug , TyEncodable , TyDecodable ) ]
837- #[ derive( HashStable , TypeFoldable , TypeVisitable , Lift ) ]
836+ #[ derive( Clone , Copy , PartialEq , Eq , Hash , Debug , PartialOrd , Ord ) ]
837+ #[ derive( HashStable , TypeFoldable , TypeVisitable , Lift , TyEncodable , TyDecodable ) ]
838838pub struct CoercePredicate < ' tcx > {
839839 pub a : Ty < ' tcx > ,
840840 pub b : Ty < ' tcx > ,
@@ -1039,8 +1039,8 @@ impl From<ty::ConstVid> for TermVid {
10391039/// equality between arbitrary types. Processing an instance of
10401040/// Form #2 eventually yields one of these `ProjectionPredicate`
10411041/// instances to normalize the LHS.
1042- #[ derive( Copy , Clone , PartialEq , Eq , Hash , TyEncodable , TyDecodable ) ]
1043- #[ derive( HashStable , TypeFoldable , TypeVisitable , Lift ) ]
1042+ #[ derive( Copy , Clone , PartialEq , Eq , Hash , PartialOrd , Ord ) ]
1043+ #[ derive( HashStable , TypeFoldable , TypeVisitable , Lift , TyEncodable , TyDecodable ) ]
10441044pub struct ProjectionPredicate < ' tcx > {
10451045 pub projection_ty : AliasTy < ' tcx > ,
10461046 pub term : Term < ' tcx > ,
@@ -1102,8 +1102,8 @@ impl<'tcx> PolyProjectionPredicate<'tcx> {
11021102
11031103/// Used by the new solver. Unlike a `ProjectionPredicate` this can only be
11041104/// proven by actually normalizing `alias`.
1105- #[ derive( Copy , Clone , PartialEq , Eq , Hash , TyEncodable , TyDecodable ) ]
1106- #[ derive( HashStable , TypeFoldable , TypeVisitable , Lift ) ]
1105+ #[ derive( Copy , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
1106+ #[ derive( TyEncodable , TyDecodable , HashStable , TypeFoldable , TypeVisitable , Lift ) ]
11071107pub struct NormalizesTo < ' tcx > {
11081108 pub alias : AliasTy < ' tcx > ,
11091109 pub term : Term < ' tcx > ,
0 commit comments