Skip to content

Commit fd16a0e

Browse files
committed
rustc_middle: derivative -> derive-where
1 parent 5d76a13 commit fd16a0e

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

Cargo.lock

+12-1
Original file line numberDiff line numberDiff line change
@@ -1057,6 +1057,17 @@ dependencies = [
10571057
"syn 1.0.109",
10581058
]
10591059

1060+
[[package]]
1061+
name = "derive-where"
1062+
version = "1.2.7"
1063+
source = "registry+https://github.com/rust-lang/crates.io-index"
1064+
checksum = "62d671cc41a825ebabc75757b62d3d168c577f9149b2d49ece1dad1f72119d25"
1065+
dependencies = [
1066+
"proc-macro2",
1067+
"quote",
1068+
"syn 2.0.67",
1069+
]
1070+
10601071
[[package]]
10611072
name = "derive_builder"
10621073
version = "0.20.0"
@@ -4348,7 +4359,7 @@ name = "rustc_middle"
43484359
version = "0.0.0"
43494360
dependencies = [
43504361
"bitflags 2.5.0",
4351-
"derivative",
4362+
"derive-where",
43524363
"either",
43534364
"field-offset",
43544365
"gsgdt",

compiler/rustc_middle/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ edition = "2021"
66
[dependencies]
77
# tidy-alphabetical-start
88
bitflags = "2.4.1"
9-
derivative = "2.2.0"
9+
derive-where = "1.2.7"
1010
either = "1.5.0"
1111
field-offset = "0.3.5"
1212
gsgdt = "0.1.2"

compiler/rustc_middle/src/mir/query.rs

+4-9
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
33
use crate::mir;
44
use crate::ty::{self, CoroutineArgsExt, OpaqueHiddenType, Ty, TyCtxt};
5+
use derive_where::derive_where;
56
use rustc_data_structures::fx::FxIndexMap;
67
use rustc_errors::ErrorGuaranteed;
78
use 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)]
234229
pub 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

Comments
 (0)