@@ -245,8 +245,8 @@ pub enum ImplSubject<'tcx> {
245245 Inherent ( Ty < ' tcx > ) ,
246246}
247247
248- #[ derive( Copy , Clone , PartialEq , Eq , Hash , TyEncodable , TyDecodable , HashStable , Debug ) ]
249- #[ derive( TypeFoldable , TypeVisitable ) ]
248+ #[ derive( Copy , Clone , PartialEq , Eq , Hash , Debug , PartialOrd , Ord ) ]
249+ #[ derive( HashStable , TypeFoldable , TypeVisitable , TyEncodable , TyDecodable ) ]
250250pub enum ImplPolarity {
251251 /// `impl Trait for Type`
252252 Positive ,
@@ -561,7 +561,7 @@ impl rustc_errors::IntoDiagnosticArg for Clause<'_> {
561561/// A subset of predicates which can be assumed by the trait solver. They show up in
562562/// an item's where clauses, hence the name `Clause`, and may either be user-written
563563/// (such as traits) or may be inserted during lowering.
564- #[ derive( Clone , Copy , PartialEq , Eq , Hash , HashStable ) ]
564+ #[ derive( Clone , Copy , PartialEq , Eq , Hash , HashStable , PartialOrd , Ord ) ]
565565#[ rustc_pass_by_value]
566566pub struct Clause < ' tcx > ( Interned < ' tcx , WithCachedTypeInfo < ty:: Binder < ' tcx , PredicateKind < ' tcx > > > > ) ;
567567
@@ -614,8 +614,8 @@ impl<'tcx> Clause<'tcx> {
614614 }
615615}
616616
617- #[ derive( Clone , Copy , PartialEq , Eq , Hash , TyEncodable , TyDecodable ) ]
618- #[ derive( HashStable , TypeFoldable , TypeVisitable , Lift ) ]
617+ #[ derive( Clone , Copy , PartialEq , Eq , Hash , PartialOrd , Ord ) ]
618+ #[ derive( HashStable , TypeFoldable , TypeVisitable , Lift , TyEncodable , TyDecodable ) ]
619619/// A clause is something that can appear in where bounds or be inferred
620620/// by implied bounds.
621621pub enum ClauseKind < ' tcx > {
@@ -645,8 +645,8 @@ pub enum ClauseKind<'tcx> {
645645 ConstEvaluatable ( ty:: Const < ' tcx > ) ,
646646}
647647
648- #[ derive( Clone , Copy , PartialEq , Eq , Hash , TyEncodable , TyDecodable ) ]
649- #[ derive( HashStable , TypeFoldable , TypeVisitable , Lift ) ]
648+ #[ derive( Clone , Copy , PartialEq , Eq , Hash , PartialOrd , Ord ) ]
649+ #[ derive( HashStable , TypeFoldable , TypeVisitable , Lift , TyEncodable , TyDecodable ) ]
650650pub enum PredicateKind < ' tcx > {
651651 /// Prove a clause
652652 Clause ( ClauseKind < ' tcx > ) ,
@@ -690,8 +690,8 @@ pub enum PredicateKind<'tcx> {
690690 AliasRelate ( Term < ' tcx > , Term < ' tcx > , AliasRelationDirection ) ,
691691}
692692
693- #[ derive( Clone , Copy , PartialEq , Eq , Hash , TyEncodable , TyDecodable ) ]
694- #[ derive( HashStable , Debug ) ]
693+ #[ derive( Clone , Copy , PartialEq , Eq , Hash , PartialOrd , Ord ) ]
694+ #[ derive( HashStable , Debug , TyEncodable , TyDecodable ) ]
695695pub enum AliasRelationDirection {
696696 Equate ,
697697 Subtype ,
@@ -826,8 +826,8 @@ impl<'tcx> Clause<'tcx> {
826826 }
827827}
828828
829- #[ derive( Clone , Copy , PartialEq , Eq , Hash , TyEncodable , TyDecodable ) ]
830- #[ derive( HashStable , TypeFoldable , TypeVisitable , Lift ) ]
829+ #[ derive( Clone , Copy , PartialEq , Eq , Hash , PartialOrd , Ord ) ]
830+ #[ derive( HashStable , TypeFoldable , TypeVisitable , Lift , TyEncodable , TyDecodable ) ]
831831pub struct TraitPredicate < ' tcx > {
832832 pub trait_ref : TraitRef < ' tcx > ,
833833
@@ -885,8 +885,8 @@ pub type PolyTypeOutlivesPredicate<'tcx> = ty::Binder<'tcx, TypeOutlivesPredicat
885885/// Encodes that `a` must be a subtype of `b`. The `a_is_expected` flag indicates
886886/// whether the `a` type is the type that we should label as "expected" when
887887/// presenting user diagnostics.
888- #[ derive( Clone , Copy , PartialEq , Eq , Hash , Debug , TyEncodable , TyDecodable ) ]
889- #[ derive( HashStable , TypeFoldable , TypeVisitable , Lift ) ]
888+ #[ derive( Clone , Copy , PartialEq , Eq , Hash , Debug , PartialOrd , Ord ) ]
889+ #[ derive( HashStable , TypeFoldable , TypeVisitable , Lift , TyEncodable , TyDecodable ) ]
890890pub struct SubtypePredicate < ' tcx > {
891891 pub a_is_expected : bool ,
892892 pub a : Ty < ' tcx > ,
@@ -895,8 +895,8 @@ pub struct SubtypePredicate<'tcx> {
895895pub type PolySubtypePredicate < ' tcx > = ty:: Binder < ' tcx , SubtypePredicate < ' tcx > > ;
896896
897897/// Encodes that we have to coerce *from* the `a` type to the `b` type.
898- #[ derive( Clone , Copy , PartialEq , Eq , Hash , Debug , TyEncodable , TyDecodable ) ]
899- #[ derive( HashStable , TypeFoldable , TypeVisitable , Lift ) ]
898+ #[ derive( Clone , Copy , PartialEq , Eq , Hash , Debug , PartialOrd , Ord ) ]
899+ #[ derive( HashStable , TypeFoldable , TypeVisitable , Lift , TyEncodable , TyDecodable ) ]
900900pub struct CoercePredicate < ' tcx > {
901901 pub a : Ty < ' tcx > ,
902902 pub b : Ty < ' tcx > ,
@@ -1101,8 +1101,8 @@ impl<'tcx> From<ty::ConstVid<'tcx>> for TermVid<'tcx> {
11011101/// equality between arbitrary types. Processing an instance of
11021102/// Form #2 eventually yields one of these `ProjectionPredicate`
11031103/// instances to normalize the LHS.
1104- #[ derive( Copy , Clone , PartialEq , Eq , Hash , TyEncodable , TyDecodable ) ]
1105- #[ derive( HashStable , TypeFoldable , TypeVisitable , Lift ) ]
1104+ #[ derive( Copy , Clone , PartialEq , Eq , Hash , PartialOrd , Ord ) ]
1105+ #[ derive( HashStable , TypeFoldable , TypeVisitable , Lift , TyEncodable , TyDecodable ) ]
11061106pub struct ProjectionPredicate < ' tcx > {
11071107 pub projection_ty : AliasTy < ' tcx > ,
11081108 pub term : Term < ' tcx > ,
0 commit comments