@@ -34,7 +34,7 @@ use hir;
34
34
use self :: InferTy :: * ;
35
35
use self :: TypeVariants :: * ;
36
36
37
- #[ derive( Clone , Copy , PartialEq , Eq , Hash , Debug , RustcEncodable , RustcDecodable ) ]
37
+ #[ derive( Clone , Copy , PartialEq , Eq , PartialOrd , Ord , Hash , Debug , RustcEncodable , RustcDecodable ) ]
38
38
pub struct TypeAndMut < ' tcx > {
39
39
pub ty : Ty < ' tcx > ,
40
40
pub mutbl : hir:: Mutability ,
@@ -80,7 +80,7 @@ impl BoundRegion {
80
80
81
81
/// NB: If you change this, you'll probably want to change the corresponding
82
82
/// AST structure in libsyntax/ast.rs as well.
83
- #[ derive( Clone , PartialEq , Eq , Hash , Debug , RustcEncodable , RustcDecodable ) ]
83
+ #[ derive( Clone , PartialEq , Eq , PartialOrd , Ord , Hash , Debug , RustcEncodable , RustcDecodable ) ]
84
84
pub enum TypeVariants < ' tcx > {
85
85
/// The primitive boolean type. Written as `bool`.
86
86
TyBool ,
@@ -268,7 +268,7 @@ pub enum TypeVariants<'tcx> {
268
268
///
269
269
/// It'd be nice to split this struct into ClosureSubsts and
270
270
/// GeneratorSubsts, I believe. -nmatsakis
271
- #[ derive( Copy , Clone , PartialEq , Eq , Hash , Debug , RustcEncodable , RustcDecodable ) ]
271
+ #[ derive( Copy , Clone , PartialEq , Eq , PartialOrd , Ord , Hash , Debug , RustcEncodable , RustcDecodable ) ]
272
272
pub struct ClosureSubsts < ' tcx > {
273
273
/// Lifetime and type parameters from the enclosing function,
274
274
/// concatenated with the types of the upvars.
@@ -351,7 +351,7 @@ impl<'tcx> ClosureSubsts<'tcx> {
351
351
}
352
352
}
353
353
354
- #[ derive( Copy , Clone , PartialEq , Eq , Hash , Debug , RustcEncodable , RustcDecodable ) ]
354
+ #[ derive( Copy , Clone , PartialEq , Eq , PartialOrd , Ord , Hash , Debug , RustcEncodable , RustcDecodable ) ]
355
355
pub struct GeneratorSubsts < ' tcx > {
356
356
pub substs : & ' tcx Substs < ' tcx > ,
357
357
}
@@ -484,7 +484,7 @@ impl<'tcx> UpvarSubsts<'tcx> {
484
484
}
485
485
}
486
486
487
- #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash , RustcEncodable , RustcDecodable ) ]
487
+ #[ derive( Debug , Copy , Clone , PartialEq , PartialOrd , Ord , Eq , Hash , RustcEncodable , RustcDecodable ) ]
488
488
pub enum ExistentialPredicate < ' tcx > {
489
489
/// e.g. Iterator
490
490
Trait ( ExistentialTraitRef < ' tcx > ) ,
@@ -660,7 +660,7 @@ impl<'tcx> PolyTraitRef<'tcx> {
660
660
///
661
661
/// The substitutions don't include the erased `Self`, only trait
662
662
/// type and lifetime parameters (`[X, Y]` and `['a, 'b]` above).
663
- #[ derive( Copy , Clone , PartialEq , Eq , Hash , RustcEncodable , RustcDecodable ) ]
663
+ #[ derive( Copy , Clone , PartialEq , Eq , PartialOrd , Ord , Hash , RustcEncodable , RustcDecodable ) ]
664
664
pub struct ExistentialTraitRef < ' tcx > {
665
665
pub def_id : DefId ,
666
666
pub substs : & ' tcx Substs < ' tcx > ,
@@ -728,7 +728,7 @@ impl<'tcx> PolyExistentialTraitRef<'tcx> {
728
728
/// erase, or otherwise "discharge" these bound regions, we change the
729
729
/// type from `Binder<T>` to just `T` (see
730
730
/// e.g. `liberate_late_bound_regions`).
731
- #[ derive( Copy , Clone , PartialEq , Eq , Hash , Debug , RustcEncodable , RustcDecodable ) ]
731
+ #[ derive( Copy , Clone , PartialEq , Eq , PartialOrd , Ord , Hash , Debug , RustcEncodable , RustcDecodable ) ]
732
732
pub struct Binder < T > ( T ) ;
733
733
734
734
impl < T > Binder < T > {
@@ -834,7 +834,7 @@ impl<T> Binder<T> {
834
834
835
835
/// Represents the projection of an associated type. In explicit UFCS
836
836
/// form this would be written `<T as Trait<..>>::N`.
837
- #[ derive( Copy , Clone , PartialEq , Eq , Hash , Debug , RustcEncodable , RustcDecodable ) ]
837
+ #[ derive( Copy , Clone , PartialEq , Eq , PartialOrd , Ord , Hash , Debug , RustcEncodable , RustcDecodable ) ]
838
838
pub struct ProjectionTy < ' tcx > {
839
839
/// The parameters of the associated item.
840
840
pub substs : & ' tcx Substs < ' tcx > ,
@@ -902,7 +902,7 @@ impl<'tcx> PolyGenSig<'tcx> {
902
902
/// - `inputs` is the list of arguments and their modes.
903
903
/// - `output` is the return type.
904
904
/// - `variadic` indicates whether this is a variadic function. (only true for foreign fns)
905
- #[ derive( Copy , Clone , PartialEq , Eq , Hash , RustcEncodable , RustcDecodable ) ]
905
+ #[ derive( Copy , Clone , PartialEq , Eq , PartialOrd , Ord , Hash , RustcEncodable , RustcDecodable ) ]
906
906
pub struct FnSig < ' tcx > {
907
907
pub inputs_and_output : & ' tcx Slice < Ty < ' tcx > > ,
908
908
pub variadic : bool ,
@@ -946,7 +946,7 @@ impl<'tcx> PolyFnSig<'tcx> {
946
946
}
947
947
}
948
948
949
- #[ derive( Clone , Copy , PartialEq , Eq , Hash , RustcEncodable , RustcDecodable ) ]
949
+ #[ derive( Clone , Copy , PartialEq , Eq , PartialOrd , Ord , Hash , RustcEncodable , RustcDecodable ) ]
950
950
pub struct ParamTy {
951
951
pub idx : u32 ,
952
952
pub name : InternedString ,
@@ -1148,17 +1148,17 @@ pub struct EarlyBoundRegion {
1148
1148
pub name : InternedString ,
1149
1149
}
1150
1150
1151
- #[ derive( Clone , Copy , PartialEq , Eq , Hash , RustcEncodable , RustcDecodable ) ]
1151
+ #[ derive( Clone , Copy , PartialEq , Eq , PartialOrd , Ord , Hash , RustcEncodable , RustcDecodable ) ]
1152
1152
pub struct TyVid {
1153
1153
pub index : u32 ,
1154
1154
}
1155
1155
1156
- #[ derive( Clone , Copy , PartialEq , Eq , Hash , RustcEncodable , RustcDecodable ) ]
1156
+ #[ derive( Clone , Copy , PartialEq , Eq , PartialOrd , Ord , Hash , RustcEncodable , RustcDecodable ) ]
1157
1157
pub struct IntVid {
1158
1158
pub index : u32 ,
1159
1159
}
1160
1160
1161
- #[ derive( Clone , Copy , PartialEq , Eq , Hash , RustcEncodable , RustcDecodable ) ]
1161
+ #[ derive( Clone , Copy , PartialEq , Eq , PartialOrd , Ord , Hash , RustcEncodable , RustcDecodable ) ]
1162
1162
pub struct FloatVid {
1163
1163
pub index : u32 ,
1164
1164
}
@@ -1169,7 +1169,7 @@ newtype_index!(RegionVid
1169
1169
DEBUG_FORMAT = custom,
1170
1170
} ) ;
1171
1171
1172
- #[ derive( Clone , Copy , PartialEq , Eq , Hash , RustcEncodable , RustcDecodable ) ]
1172
+ #[ derive( Clone , Copy , PartialEq , Eq , PartialOrd , Ord , Hash , RustcEncodable , RustcDecodable ) ]
1173
1173
pub enum InferTy {
1174
1174
TyVar ( TyVid ) ,
1175
1175
IntVar ( IntVid ) ,
@@ -1189,7 +1189,7 @@ pub enum InferTy {
1189
1189
newtype_index ! ( CanonicalVar ) ;
1190
1190
1191
1191
/// A `ProjectionPredicate` for an `ExistentialTraitRef`.
1192
- #[ derive( Clone , Copy , PartialEq , Eq , Hash , Debug , RustcEncodable , RustcDecodable ) ]
1192
+ #[ derive( Clone , Copy , PartialEq , Eq , PartialOrd , Ord , Hash , Debug , RustcEncodable , RustcDecodable ) ]
1193
1193
pub struct ExistentialProjection < ' tcx > {
1194
1194
pub item_def_id : DefId ,
1195
1195
pub substs : & ' tcx Substs < ' tcx > ,
@@ -1758,7 +1758,7 @@ impl<'a, 'gcx, 'tcx> TyS<'tcx> {
1758
1758
}
1759
1759
1760
1760
/// Typed constant value.
1761
- #[ derive( Copy , Clone , Debug , Hash , RustcEncodable , RustcDecodable , Eq , PartialEq ) ]
1761
+ #[ derive( Copy , Clone , Debug , Hash , RustcEncodable , RustcDecodable , Eq , PartialEq , Ord , PartialOrd ) ]
1762
1762
pub struct Const < ' tcx > {
1763
1763
pub ty : Ty < ' tcx > ,
1764
1764
0 commit comments