@@ -13,7 +13,6 @@ use rustc_data_structures::indexed_vec::{Idx, IndexVec};
1313use borrow_check:: nll:: type_check:: Locations ;
1414
1515use std:: fmt;
16- use std:: cmp:: Ordering ;
1716use std:: ops:: Deref ;
1817
1918#[ derive( Clone , Default ) ]
@@ -112,37 +111,12 @@ impl fmt::Debug for OutlivesConstraint {
112111
113112/// Constraints that are considered interesting can be categorized to
114113/// determine why they are interesting.
115- #[ derive( Debug , Eq , PartialEq ) ]
114+ #[ derive( Debug , Eq , PartialEq , Ord , PartialOrd ) ]
116115crate enum ConstraintCategory {
117116 Assignment ,
118117 CallArgument ,
119118 Cast ,
120119 Other ,
121120}
122121
123- impl Ord for ConstraintCategory {
124- fn cmp ( & self , other : & Self ) -> Ordering {
125- if self == other {
126- return Ordering :: Equal ;
127- }
128-
129- match ( self , other) {
130- ( ConstraintCategory :: Assignment , _) => Ordering :: Greater ,
131- ( _, ConstraintCategory :: Assignment ) => Ordering :: Less ,
132- ( ConstraintCategory :: CallArgument , _) => Ordering :: Greater ,
133- ( _, ConstraintCategory :: CallArgument ) => Ordering :: Less ,
134- ( ConstraintCategory :: Cast , _) => Ordering :: Greater ,
135- ( _, ConstraintCategory :: Cast ) => Ordering :: Less ,
136- ( ConstraintCategory :: Other , _) => Ordering :: Greater ,
137- }
138- }
139- }
140-
141- impl PartialOrd for ConstraintCategory {
142- fn partial_cmp ( & self , other : & Self ) -> Option < Ordering > {
143- Some ( self . cmp ( other) )
144- }
145- }
146-
147-
148122newtype_index ! ( ConstraintIndex { DEBUG_FORMAT = "ConstraintIndex({})" } ) ;
0 commit comments