1
Fork 0

rustc_middle: derivative -> derive-where

This commit is contained in:
Pavel Grigorenko 2024-06-27 01:29:49 +03:00
parent 5d76a13bbe
commit fd16a0efeb
3 changed files with 17 additions and 11 deletions

View file

@ -2,6 +2,7 @@
use crate::mir;
use crate::ty::{self, CoroutineArgsExt, OpaqueHiddenType, Ty, TyCtxt};
use derive_where::derive_where;
use rustc_data_structures::fx::FxIndexMap;
use rustc_errors::ErrorGuaranteed;
use rustc_hir::def_id::LocalDefId;
@ -224,13 +225,7 @@ rustc_data_structures::static_assert_size!(ConstraintCategory<'_>, 16);
/// See also `rustc_const_eval::borrow_check::constraints`.
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
#[derive(TyEncodable, TyDecodable, HashStable, TypeVisitable, TypeFoldable)]
#[derive(derivative::Derivative)]
#[derivative(
PartialOrd,
Ord,
PartialOrd = "feature_allow_slow_enum",
Ord = "feature_allow_slow_enum"
)]
#[derive_where(PartialOrd, Ord)]
pub enum ConstraintCategory<'tcx> {
Return(ReturnConstraint),
Yield,
@ -240,7 +235,7 @@ pub enum ConstraintCategory<'tcx> {
Cast {
/// Whether this is an unsizing cast and if yes, this contains the target type.
/// Region variables are erased to ReErased.
#[derivative(PartialOrd = "ignore", Ord = "ignore")]
#[derive_where(skip)]
unsize_to: Option<Ty<'tcx>>,
},
@ -250,7 +245,7 @@ pub enum ConstraintCategory<'tcx> {
ClosureBounds,
/// Contains the function type if available.
CallArgument(#[derivative(PartialOrd = "ignore", Ord = "ignore")] Option<Ty<'tcx>>),
CallArgument(#[derive_where(skip)] Option<Ty<'tcx>>),
CopyBound,
SizedBound,
Assignment,