@@ -34,7 +34,7 @@ use hir;
3434use self :: InferTy :: * ;
3535use self :: TypeVariants :: * ;
3636
37- #[ derive( Clone , Copy , PartialEq , Eq , Hash , Debug , RustcEncodable , RustcDecodable ) ]
37+ #[ derive( Clone , Copy , PartialEq , Eq , PartialOrd , Ord , Hash , Debug , RustcEncodable , RustcDecodable ) ]
3838pub struct TypeAndMut < ' tcx > {
3939 pub ty : Ty < ' tcx > ,
4040 pub mutbl : hir:: Mutability ,
@@ -80,7 +80,7 @@ impl BoundRegion {
8080
8181/// NB: If you change this, you'll probably want to change the corresponding
8282/// 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 ) ]
8484pub enum TypeVariants < ' tcx > {
8585 /// The primitive boolean type. Written as `bool`.
8686 TyBool ,
@@ -268,7 +268,7 @@ pub enum TypeVariants<'tcx> {
268268///
269269/// It'd be nice to split this struct into ClosureSubsts and
270270/// 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 ) ]
272272pub struct ClosureSubsts < ' tcx > {
273273 /// Lifetime and type parameters from the enclosing function,
274274 /// concatenated with the types of the upvars.
@@ -351,7 +351,7 @@ impl<'tcx> ClosureSubsts<'tcx> {
351351 }
352352}
353353
354- #[ derive( Copy , Clone , PartialEq , Eq , Hash , Debug , RustcEncodable , RustcDecodable ) ]
354+ #[ derive( Copy , Clone , PartialEq , Eq , PartialOrd , Ord , Hash , Debug , RustcEncodable , RustcDecodable ) ]
355355pub struct GeneratorSubsts < ' tcx > {
356356 pub substs : & ' tcx Substs < ' tcx > ,
357357}
@@ -484,7 +484,7 @@ impl<'tcx> UpvarSubsts<'tcx> {
484484 }
485485}
486486
487- #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash , RustcEncodable , RustcDecodable ) ]
487+ #[ derive( Debug , Copy , Clone , PartialEq , PartialOrd , Ord , Eq , Hash , RustcEncodable , RustcDecodable ) ]
488488pub enum ExistentialPredicate < ' tcx > {
489489 /// e.g. Iterator
490490 Trait ( ExistentialTraitRef < ' tcx > ) ,
@@ -660,7 +660,7 @@ impl<'tcx> PolyTraitRef<'tcx> {
660660///
661661/// The substitutions don't include the erased `Self`, only trait
662662/// 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 ) ]
664664pub struct ExistentialTraitRef < ' tcx > {
665665 pub def_id : DefId ,
666666 pub substs : & ' tcx Substs < ' tcx > ,
@@ -728,7 +728,7 @@ impl<'tcx> PolyExistentialTraitRef<'tcx> {
728728/// erase, or otherwise "discharge" these bound regions, we change the
729729/// type from `Binder<T>` to just `T` (see
730730/// 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 ) ]
732732pub struct Binder < T > ( T ) ;
733733
734734impl < T > Binder < T > {
@@ -834,7 +834,7 @@ impl<T> Binder<T> {
834834
835835/// Represents the projection of an associated type. In explicit UFCS
836836/// 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 ) ]
838838pub struct ProjectionTy < ' tcx > {
839839 /// The parameters of the associated item.
840840 pub substs : & ' tcx Substs < ' tcx > ,
@@ -902,7 +902,7 @@ impl<'tcx> PolyGenSig<'tcx> {
902902/// - `inputs` is the list of arguments and their modes.
903903/// - `output` is the return type.
904904/// - `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 ) ]
906906pub struct FnSig < ' tcx > {
907907 pub inputs_and_output : & ' tcx Slice < Ty < ' tcx > > ,
908908 pub variadic : bool ,
@@ -946,7 +946,7 @@ impl<'tcx> PolyFnSig<'tcx> {
946946 }
947947}
948948
949- #[ derive( Clone , Copy , PartialEq , Eq , Hash , RustcEncodable , RustcDecodable ) ]
949+ #[ derive( Clone , Copy , PartialEq , Eq , PartialOrd , Ord , Hash , RustcEncodable , RustcDecodable ) ]
950950pub struct ParamTy {
951951 pub idx : u32 ,
952952 pub name : InternedString ,
@@ -1148,17 +1148,17 @@ pub struct EarlyBoundRegion {
11481148 pub name : InternedString ,
11491149}
11501150
1151- #[ derive( Clone , Copy , PartialEq , Eq , Hash , RustcEncodable , RustcDecodable ) ]
1151+ #[ derive( Clone , Copy , PartialEq , Eq , PartialOrd , Ord , Hash , RustcEncodable , RustcDecodable ) ]
11521152pub struct TyVid {
11531153 pub index : u32 ,
11541154}
11551155
1156- #[ derive( Clone , Copy , PartialEq , Eq , Hash , RustcEncodable , RustcDecodable ) ]
1156+ #[ derive( Clone , Copy , PartialEq , Eq , PartialOrd , Ord , Hash , RustcEncodable , RustcDecodable ) ]
11571157pub struct IntVid {
11581158 pub index : u32 ,
11591159}
11601160
1161- #[ derive( Clone , Copy , PartialEq , Eq , Hash , RustcEncodable , RustcDecodable ) ]
1161+ #[ derive( Clone , Copy , PartialEq , Eq , PartialOrd , Ord , Hash , RustcEncodable , RustcDecodable ) ]
11621162pub struct FloatVid {
11631163 pub index : u32 ,
11641164}
@@ -1169,7 +1169,7 @@ newtype_index!(RegionVid
11691169 DEBUG_FORMAT = custom,
11701170 } ) ;
11711171
1172- #[ derive( Clone , Copy , PartialEq , Eq , Hash , RustcEncodable , RustcDecodable ) ]
1172+ #[ derive( Clone , Copy , PartialEq , Eq , PartialOrd , Ord , Hash , RustcEncodable , RustcDecodable ) ]
11731173pub enum InferTy {
11741174 TyVar ( TyVid ) ,
11751175 IntVar ( IntVid ) ,
@@ -1189,7 +1189,7 @@ pub enum InferTy {
11891189newtype_index ! ( CanonicalVar ) ;
11901190
11911191/// 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 ) ]
11931193pub struct ExistentialProjection < ' tcx > {
11941194 pub item_def_id : DefId ,
11951195 pub substs : & ' tcx Substs < ' tcx > ,
@@ -1758,7 +1758,7 @@ impl<'a, 'gcx, 'tcx> TyS<'tcx> {
17581758}
17591759
17601760/// 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 ) ]
17621762pub struct Const < ' tcx > {
17631763 pub ty : Ty < ' tcx > ,
17641764
0 commit comments