2
2
3
3
use crate :: mir;
4
4
use crate :: ty:: { self , CoroutineArgsExt , OpaqueHiddenType , Ty , TyCtxt } ;
5
+ use derive_where:: derive_where;
5
6
use rustc_data_structures:: fx:: FxIndexMap ;
6
7
use rustc_errors:: ErrorGuaranteed ;
7
8
use rustc_hir:: def_id:: LocalDefId ;
@@ -224,13 +225,7 @@ rustc_data_structures::static_assert_size!(ConstraintCategory<'_>, 16);
224
225
/// See also `rustc_const_eval::borrow_check::constraints`.
225
226
#[ derive( Copy , Clone , Debug , Eq , PartialEq , Hash ) ]
226
227
#[ derive( TyEncodable , TyDecodable , HashStable , TypeVisitable , TypeFoldable ) ]
227
- #[ derive( derivative:: Derivative ) ]
228
- #[ derivative(
229
- PartialOrd ,
230
- Ord ,
231
- PartialOrd = "feature_allow_slow_enum" ,
232
- Ord = "feature_allow_slow_enum"
233
- ) ]
228
+ #[ derive_where( PartialOrd , Ord ) ]
234
229
pub enum ConstraintCategory < ' tcx > {
235
230
Return ( ReturnConstraint ) ,
236
231
Yield ,
@@ -240,7 +235,7 @@ pub enum ConstraintCategory<'tcx> {
240
235
Cast {
241
236
/// Whether this is an unsizing cast and if yes, this contains the target type.
242
237
/// Region variables are erased to ReErased.
243
- #[ derivative ( PartialOrd = "ignore" , Ord = "ignore" ) ]
238
+ #[ derive_where ( skip ) ]
244
239
unsize_to : Option < Ty < ' tcx > > ,
245
240
} ,
246
241
@@ -250,7 +245,7 @@ pub enum ConstraintCategory<'tcx> {
250
245
ClosureBounds ,
251
246
252
247
/// Contains the function type if available.
253
- CallArgument ( #[ derivative ( PartialOrd = "ignore" , Ord = "ignore" ) ] Option < Ty < ' tcx > > ) ,
248
+ CallArgument ( #[ derive_where ( skip ) ] Option < Ty < ' tcx > > ) ,
254
249
CopyBound ,
255
250
SizedBound ,
256
251
Assignment ,
0 commit comments