@@ -244,8 +244,8 @@ pub enum ImplSubject<'tcx> {
244244 Inherent ( Ty < ' tcx > ) ,
245245}
246246
247- #[ derive( Copy , Clone , PartialEq , Eq , Hash , TyEncodable , TyDecodable , HashStable , Debug ) ]
248- #[ derive( TypeFoldable , TypeVisitable ) ]
247+ #[ derive( Copy , Clone , PartialEq , Eq , Hash , Debug , PartialOrd , Ord ) ]
248+ #[ derive( HashStable , TypeFoldable , TypeVisitable , TyEncodable , TyDecodable ) ]
249249pub enum ImplPolarity {
250250 /// `impl Trait for Type`
251251 Positive ,
@@ -573,7 +573,7 @@ impl rustc_errors::IntoDiagnosticArg for Clause<'_> {
573573/// A subset of predicates which can be assumed by the trait solver. They show up in
574574/// an item's where clauses, hence the name `Clause`, and may either be user-written
575575/// (such as traits) or may be inserted during lowering.
576- #[ derive( Clone , Copy , PartialEq , Eq , Hash , HashStable ) ]
576+ #[ derive( Clone , Copy , PartialEq , Eq , Hash , HashStable , PartialOrd , Ord ) ]
577577#[ rustc_pass_by_value]
578578pub struct Clause < ' tcx > ( Interned < ' tcx , WithCachedTypeInfo < ty:: Binder < ' tcx , PredicateKind < ' tcx > > > > ) ;
579579
@@ -626,8 +626,8 @@ impl<'tcx> Clause<'tcx> {
626626 }
627627}
628628
629- #[ derive( Clone , Copy , PartialEq , Eq , Hash , TyEncodable , TyDecodable ) ]
630- #[ derive( HashStable , TypeFoldable , TypeVisitable , Lift ) ]
629+ #[ derive( Clone , Copy , PartialEq , Eq , Hash , PartialOrd , Ord ) ]
630+ #[ derive( HashStable , TypeFoldable , TypeVisitable , Lift , TyEncodable , TyDecodable ) ]
631631/// A clause is something that can appear in where bounds or be inferred
632632/// by implied bounds.
633633pub enum ClauseKind < ' tcx > {
@@ -657,8 +657,8 @@ pub enum ClauseKind<'tcx> {
657657 ConstEvaluatable ( ty:: Const < ' tcx > ) ,
658658}
659659
660- #[ derive( Clone , Copy , PartialEq , Eq , Hash , TyEncodable , TyDecodable ) ]
661- #[ derive( HashStable , TypeFoldable , TypeVisitable , Lift ) ]
660+ #[ derive( Clone , Copy , PartialEq , Eq , Hash , PartialOrd , Ord ) ]
661+ #[ derive( HashStable , TypeFoldable , TypeVisitable , Lift , TyEncodable , TyDecodable ) ]
662662pub enum PredicateKind < ' tcx > {
663663 /// Prove a clause
664664 Clause ( ClauseKind < ' tcx > ) ,
@@ -702,8 +702,8 @@ pub enum PredicateKind<'tcx> {
702702 AliasRelate ( Term < ' tcx > , Term < ' tcx > , AliasRelationDirection ) ,
703703}
704704
705- #[ derive( Clone , Copy , PartialEq , Eq , Hash , TyEncodable , TyDecodable ) ]
706- #[ derive( HashStable , Debug ) ]
705+ #[ derive( Clone , Copy , PartialEq , Eq , Hash , PartialOrd , Ord ) ]
706+ #[ derive( HashStable , Debug , TyEncodable , TyDecodable ) ]
707707pub enum AliasRelationDirection {
708708 Equate ,
709709 Subtype ,
@@ -838,8 +838,8 @@ impl<'tcx> Clause<'tcx> {
838838 }
839839}
840840
841- #[ derive( Clone , Copy , PartialEq , Eq , Hash , TyEncodable , TyDecodable ) ]
842- #[ derive( HashStable , TypeFoldable , TypeVisitable , Lift ) ]
841+ #[ derive( Clone , Copy , PartialEq , Eq , Hash , PartialOrd , Ord ) ]
842+ #[ derive( HashStable , TypeFoldable , TypeVisitable , Lift , TyEncodable , TyDecodable ) ]
843843pub struct TraitPredicate < ' tcx > {
844844 pub trait_ref : TraitRef < ' tcx > ,
845845
@@ -897,8 +897,8 @@ pub type PolyTypeOutlivesPredicate<'tcx> = ty::Binder<'tcx, TypeOutlivesPredicat
897897/// Encodes that `a` must be a subtype of `b`. The `a_is_expected` flag indicates
898898/// whether the `a` type is the type that we should label as "expected" when
899899/// presenting user diagnostics.
900- #[ derive( Clone , Copy , PartialEq , Eq , Hash , Debug , TyEncodable , TyDecodable ) ]
901- #[ derive( HashStable , TypeFoldable , TypeVisitable , Lift ) ]
900+ #[ derive( Clone , Copy , PartialEq , Eq , Hash , Debug , PartialOrd , Ord ) ]
901+ #[ derive( HashStable , TypeFoldable , TypeVisitable , Lift , TyEncodable , TyDecodable ) ]
902902pub struct SubtypePredicate < ' tcx > {
903903 pub a_is_expected : bool ,
904904 pub a : Ty < ' tcx > ,
@@ -907,8 +907,8 @@ pub struct SubtypePredicate<'tcx> {
907907pub type PolySubtypePredicate < ' tcx > = ty:: Binder < ' tcx , SubtypePredicate < ' tcx > > ;
908908
909909/// Encodes that we have to coerce *from* the `a` type to the `b` type.
910- #[ derive( Clone , Copy , PartialEq , Eq , Hash , Debug , TyEncodable , TyDecodable ) ]
911- #[ derive( HashStable , TypeFoldable , TypeVisitable , Lift ) ]
910+ #[ derive( Clone , Copy , PartialEq , Eq , Hash , Debug , PartialOrd , Ord ) ]
911+ #[ derive( HashStable , TypeFoldable , TypeVisitable , Lift , TyEncodable , TyDecodable ) ]
912912pub struct CoercePredicate < ' tcx > {
913913 pub a : Ty < ' tcx > ,
914914 pub b : Ty < ' tcx > ,
@@ -1113,8 +1113,8 @@ impl<'tcx> From<ty::ConstVid<'tcx>> for TermVid<'tcx> {
11131113/// equality between arbitrary types. Processing an instance of
11141114/// Form #2 eventually yields one of these `ProjectionPredicate`
11151115/// instances to normalize the LHS.
1116- #[ derive( Copy , Clone , PartialEq , Eq , Hash , TyEncodable , TyDecodable ) ]
1117- #[ derive( HashStable , TypeFoldable , TypeVisitable , Lift ) ]
1116+ #[ derive( Copy , Clone , PartialEq , Eq , Hash , PartialOrd , Ord ) ]
1117+ #[ derive( HashStable , TypeFoldable , TypeVisitable , Lift , TyEncodable , TyDecodable ) ]
11181118pub struct ProjectionPredicate < ' tcx > {
11191119 pub projection_ty : AliasTy < ' tcx > ,
11201120 pub term : Term < ' tcx > ,
0 commit comments