@@ -245,8 +245,8 @@ pub enum ImplSubject<'tcx> {
245
245
Inherent ( Ty < ' tcx > ) ,
246
246
}
247
247
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 ) ]
250
250
pub enum ImplPolarity {
251
251
/// `impl Trait for Type`
252
252
Positive ,
@@ -561,7 +561,7 @@ impl rustc_errors::IntoDiagnosticArg for Clause<'_> {
561
561
/// A subset of predicates which can be assumed by the trait solver. They show up in
562
562
/// an item's where clauses, hence the name `Clause`, and may either be user-written
563
563
/// (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 ) ]
565
565
#[ rustc_pass_by_value]
566
566
pub struct Clause < ' tcx > ( Interned < ' tcx , WithCachedTypeInfo < ty:: Binder < ' tcx , PredicateKind < ' tcx > > > > ) ;
567
567
@@ -614,8 +614,8 @@ impl<'tcx> Clause<'tcx> {
614
614
}
615
615
}
616
616
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 ) ]
619
619
/// A clause is something that can appear in where bounds or be inferred
620
620
/// by implied bounds.
621
621
pub enum ClauseKind < ' tcx > {
@@ -645,8 +645,8 @@ pub enum ClauseKind<'tcx> {
645
645
ConstEvaluatable ( ty:: Const < ' tcx > ) ,
646
646
}
647
647
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 ) ]
650
650
pub enum PredicateKind < ' tcx > {
651
651
/// Prove a clause
652
652
Clause ( ClauseKind < ' tcx > ) ,
@@ -690,8 +690,8 @@ pub enum PredicateKind<'tcx> {
690
690
AliasRelate ( Term < ' tcx > , Term < ' tcx > , AliasRelationDirection ) ,
691
691
}
692
692
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 ) ]
695
695
pub enum AliasRelationDirection {
696
696
Equate ,
697
697
Subtype ,
@@ -826,8 +826,8 @@ impl<'tcx> Clause<'tcx> {
826
826
}
827
827
}
828
828
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 ) ]
831
831
pub struct TraitPredicate < ' tcx > {
832
832
pub trait_ref : TraitRef < ' tcx > ,
833
833
@@ -885,8 +885,8 @@ pub type PolyTypeOutlivesPredicate<'tcx> = ty::Binder<'tcx, TypeOutlivesPredicat
885
885
/// Encodes that `a` must be a subtype of `b`. The `a_is_expected` flag indicates
886
886
/// whether the `a` type is the type that we should label as "expected" when
887
887
/// 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 ) ]
890
890
pub struct SubtypePredicate < ' tcx > {
891
891
pub a_is_expected : bool ,
892
892
pub a : Ty < ' tcx > ,
@@ -895,8 +895,8 @@ pub struct SubtypePredicate<'tcx> {
895
895
pub type PolySubtypePredicate < ' tcx > = ty:: Binder < ' tcx , SubtypePredicate < ' tcx > > ;
896
896
897
897
/// 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 ) ]
900
900
pub struct CoercePredicate < ' tcx > {
901
901
pub a : Ty < ' tcx > ,
902
902
pub b : Ty < ' tcx > ,
@@ -1101,8 +1101,8 @@ impl<'tcx> From<ty::ConstVid<'tcx>> for TermVid<'tcx> {
1101
1101
/// equality between arbitrary types. Processing an instance of
1102
1102
/// Form #2 eventually yields one of these `ProjectionPredicate`
1103
1103
/// 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 ) ]
1106
1106
pub struct ProjectionPredicate < ' tcx > {
1107
1107
pub projection_ty : AliasTy < ' tcx > ,
1108
1108
pub term : Term < ' tcx > ,
0 commit comments