@@ -284,8 +284,15 @@ rustc_data_structures::static_assert_size!(ConstraintCategory<'_>, 16);
284
284
/// order of the category, thereby influencing diagnostic output.
285
285
///
286
286
/// See also `rustc_const_eval::borrow_check::constraints`.
287
- #[ derive( Copy , Clone , Debug , Eq , PartialEq , PartialOrd , Ord , Hash ) ]
287
+ #[ derive( Copy , Clone , Debug , Eq , PartialEq , Hash ) ]
288
288
#[ derive( TyEncodable , TyDecodable , HashStable , TypeVisitable , TypeFoldable ) ]
289
+ #[ derive( derivative:: Derivative ) ]
290
+ #[ derivative(
291
+ PartialOrd ,
292
+ Ord ,
293
+ PartialOrd = "feature_allow_slow_enum" ,
294
+ Ord = "feature_allow_slow_enum"
295
+ ) ]
289
296
pub enum ConstraintCategory < ' tcx > {
290
297
Return ( ReturnConstraint ) ,
291
298
Yield ,
@@ -295,6 +302,7 @@ pub enum ConstraintCategory<'tcx> {
295
302
Cast {
296
303
/// Whether this is an unsizing cast and if yes, this contains the target type.
297
304
/// Region variables are erased to ReErased.
305
+ #[ derivative( PartialOrd = "ignore" , Ord = "ignore" ) ]
298
306
unsize_to : Option < Ty < ' tcx > > ,
299
307
} ,
300
308
@@ -304,7 +312,7 @@ pub enum ConstraintCategory<'tcx> {
304
312
ClosureBounds ,
305
313
306
314
/// Contains the function type if available.
307
- CallArgument ( Option < Ty < ' tcx > > ) ,
315
+ CallArgument ( # [ derivative ( PartialOrd = "ignore" , Ord = "ignore" ) ] Option < Ty < ' tcx > > ) ,
308
316
CopyBound ,
309
317
SizedBound ,
310
318
Assignment ,
0 commit comments