22
33use crate :: mir;
44use crate :: ty:: { self , CoroutineArgsExt , OpaqueHiddenType , Ty , TyCtxt } ;
5+ use derive_where:: derive_where;
56use rustc_data_structures:: fx:: FxIndexMap ;
67use rustc_errors:: ErrorGuaranteed ;
78use rustc_hir:: def_id:: LocalDefId ;
@@ -224,13 +225,7 @@ rustc_data_structures::static_assert_size!(ConstraintCategory<'_>, 16);
224225/// See also `rustc_const_eval::borrow_check::constraints`.
225226#[ derive( Copy , Clone , Debug , Eq , PartialEq , Hash ) ]
226227#[ 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 ) ]
234229pub enum ConstraintCategory < ' tcx > {
235230 Return ( ReturnConstraint ) ,
236231 Yield ,
@@ -240,7 +235,7 @@ pub enum ConstraintCategory<'tcx> {
240235 Cast {
241236 /// Whether this is an unsizing cast and if yes, this contains the target type.
242237 /// Region variables are erased to ReErased.
243- #[ derivative ( PartialOrd = "ignore" , Ord = "ignore" ) ]
238+ #[ derive_where ( skip ) ]
244239 unsize_to : Option < Ty < ' tcx > > ,
245240 } ,
246241
@@ -250,7 +245,7 @@ pub enum ConstraintCategory<'tcx> {
250245 ClosureBounds ,
251246
252247 /// Contains the function type if available.
253- CallArgument ( #[ derivative ( PartialOrd = "ignore" , Ord = "ignore" ) ] Option < Ty < ' tcx > > ) ,
248+ CallArgument ( #[ derive_where ( skip ) ] Option < Ty < ' tcx > > ) ,
254249 CopyBound ,
255250 SizedBound ,
256251 Assignment ,
0 commit comments