7
7
use std:: marker:: PhantomData ;
8
8
use std:: mem;
9
9
10
+ use derive_where:: derive_where;
10
11
use rustc_type_ir:: inherent:: * ;
11
12
use rustc_type_ir:: { self as ty, search_graph, Interner } ;
12
13
51
52
/// in the code, only one or two variants are actually possible.
52
53
///
53
54
/// We simply ICE in case that assumption is broken.
54
- #[ derive( derivative:: Derivative ) ]
55
- #[ derivative( Debug ( bound = "" ) ) ]
55
+ #[ derive_where( Debug ; I : Interner ) ]
56
56
enum DebugSolver < I : Interner > {
57
57
Root ,
58
58
GoalEvaluation ( WipGoalEvaluation < I > ) ,
@@ -78,8 +78,7 @@ impl<I: Interner> From<WipCanonicalGoalEvaluationStep<I>> for DebugSolver<I> {
78
78
}
79
79
}
80
80
81
- #[ derive( derivative:: Derivative ) ]
82
- #[ derivative( PartialEq ( bound = "" ) , Eq ( bound = "" ) , Debug ( bound = "" ) ) ]
81
+ #[ derive_where( PartialEq , Eq , Debug ; I : Interner ) ]
83
82
struct WipGoalEvaluation < I : Interner > {
84
83
pub uncanonicalized_goal : Goal < I , I :: Predicate > ,
85
84
pub orig_values : Vec < I :: GenericArg > ,
@@ -96,8 +95,7 @@ impl<I: Interner> WipGoalEvaluation<I> {
96
95
}
97
96
}
98
97
99
- #[ derive( derivative:: Derivative ) ]
100
- #[ derivative( PartialEq ( bound = "" ) , Eq ( bound = "" ) ) ]
98
+ #[ derive_where( PartialEq , Eq ; I : Interner ) ]
101
99
pub ( in crate :: solve) enum WipCanonicalGoalEvaluationKind < I : Interner > {
102
100
Overflow ,
103
101
CycleInStack ,
@@ -118,8 +116,7 @@ impl<I: Interner> std::fmt::Debug for WipCanonicalGoalEvaluationKind<I> {
118
116
}
119
117
}
120
118
121
- #[ derive( derivative:: Derivative ) ]
122
- #[ derivative( PartialEq ( bound = "" ) , Eq ( bound = "" ) , Debug ( bound = "" ) ) ]
119
+ #[ derive_where( PartialEq , Eq , Debug ; I : Interner ) ]
123
120
struct WipCanonicalGoalEvaluation < I : Interner > {
124
121
goal : CanonicalInput < I > ,
125
122
kind : Option < WipCanonicalGoalEvaluationKind < I > > ,
@@ -153,8 +150,7 @@ impl<I: Interner> WipCanonicalGoalEvaluation<I> {
153
150
}
154
151
}
155
152
156
- #[ derive( derivative:: Derivative ) ]
157
- #[ derivative( PartialEq ( bound = "" ) , Eq ( bound = "" ) , Debug ( bound = "" ) ) ]
153
+ #[ derive_where( PartialEq , Eq , Debug ; I : Interner ) ]
158
154
struct WipCanonicalGoalEvaluationStep < I : Interner > {
159
155
/// Unlike `EvalCtxt::var_values`, we append a new
160
156
/// generic arg here whenever we create a new inference
@@ -193,8 +189,7 @@ impl<I: Interner> WipCanonicalGoalEvaluationStep<I> {
193
189
}
194
190
}
195
191
196
- #[ derive( derivative:: Derivative ) ]
197
- #[ derivative( PartialEq ( bound = "" ) , Eq ( bound = "" ) , Debug ( bound = "" ) ) ]
192
+ #[ derive_where( PartialEq , Eq , Debug ; I : Interner ) ]
198
193
struct WipProbe < I : Interner > {
199
194
initial_num_var_values : usize ,
200
195
steps : Vec < WipProbeStep < I > > ,
@@ -212,8 +207,7 @@ impl<I: Interner> WipProbe<I> {
212
207
}
213
208
}
214
209
215
- #[ derive( derivative:: Derivative ) ]
216
- #[ derivative( PartialEq ( bound = "" ) , Eq ( bound = "" ) , Debug ( bound = "" ) ) ]
210
+ #[ derive_where( PartialEq , Eq , Debug ; I : Interner ) ]
217
211
enum WipProbeStep < I : Interner > {
218
212
AddGoal ( GoalSource , inspect:: CanonicalState < I , Goal < I , I :: Predicate > > ) ,
219
213
NestedProbe ( WipProbe < I > ) ,
0 commit comments