@@ -9,13 +9,8 @@ pub fn anonymize_predicate<'tcx>(
9
9
tcx : TyCtxt < ' tcx > ,
10
10
pred : ty:: Predicate < ' tcx > ,
11
11
) -> ty:: Predicate < ' tcx > {
12
- match * pred. kind ( ) {
13
- ty:: PredicateKind :: ForAll ( binder) => {
14
- let new = ty:: PredicateKind :: ForAll ( tcx. anonymize_late_bound_regions ( binder) ) ;
15
- tcx. reuse_or_mk_predicate ( pred, new)
16
- }
17
- ty:: PredicateKind :: Atom ( _) => pred,
18
- }
12
+ let new = tcx. anonymize_late_bound_regions ( pred. kind ( ) ) ;
13
+ tcx. reuse_or_mk_predicate ( pred, new)
19
14
}
20
15
21
16
struct PredicateSet < ' tcx > {
@@ -126,9 +121,9 @@ impl Elaborator<'tcx> {
126
121
fn elaborate ( & mut self , obligation : & PredicateObligation < ' tcx > ) {
127
122
let tcx = self . visited . tcx ;
128
123
129
- let bound_predicate = obligation. predicate . bound_atom ( ) ;
124
+ let bound_predicate = obligation. predicate . kind ( ) ;
130
125
match bound_predicate. skip_binder ( ) {
131
- ty:: PredicateAtom :: Trait ( data, _) => {
126
+ ty:: PredicateKind :: Trait ( data, _) => {
132
127
// Get predicates declared on the trait.
133
128
let predicates = tcx. super_predicates_of ( data. def_id ( ) ) ;
134
129
@@ -150,36 +145,36 @@ impl Elaborator<'tcx> {
150
145
151
146
self . stack . extend ( obligations) ;
152
147
}
153
- ty:: PredicateAtom :: WellFormed ( ..) => {
148
+ ty:: PredicateKind :: WellFormed ( ..) => {
154
149
// Currently, we do not elaborate WF predicates,
155
150
// although we easily could.
156
151
}
157
- ty:: PredicateAtom :: ObjectSafe ( ..) => {
152
+ ty:: PredicateKind :: ObjectSafe ( ..) => {
158
153
// Currently, we do not elaborate object-safe
159
154
// predicates.
160
155
}
161
- ty:: PredicateAtom :: Subtype ( ..) => {
156
+ ty:: PredicateKind :: Subtype ( ..) => {
162
157
// Currently, we do not "elaborate" predicates like `X <: Y`,
163
158
// though conceivably we might.
164
159
}
165
- ty:: PredicateAtom :: Projection ( ..) => {
160
+ ty:: PredicateKind :: Projection ( ..) => {
166
161
// Nothing to elaborate in a projection predicate.
167
162
}
168
- ty:: PredicateAtom :: ClosureKind ( ..) => {
163
+ ty:: PredicateKind :: ClosureKind ( ..) => {
169
164
// Nothing to elaborate when waiting for a closure's kind to be inferred.
170
165
}
171
- ty:: PredicateAtom :: ConstEvaluatable ( ..) => {
166
+ ty:: PredicateKind :: ConstEvaluatable ( ..) => {
172
167
// Currently, we do not elaborate const-evaluatable
173
168
// predicates.
174
169
}
175
- ty:: PredicateAtom :: ConstEquate ( ..) => {
170
+ ty:: PredicateKind :: ConstEquate ( ..) => {
176
171
// Currently, we do not elaborate const-equate
177
172
// predicates.
178
173
}
179
- ty:: PredicateAtom :: RegionOutlives ( ..) => {
174
+ ty:: PredicateKind :: RegionOutlives ( ..) => {
180
175
// Nothing to elaborate from `'a: 'b`.
181
176
}
182
- ty:: PredicateAtom :: TypeOutlives ( ty:: OutlivesPredicate ( ty_max, r_min) ) => {
177
+ ty:: PredicateKind :: TypeOutlives ( ty:: OutlivesPredicate ( ty_max, r_min) ) => {
183
178
// We know that `T: 'a` for some type `T`. We can
184
179
// often elaborate this. For example, if we know that
185
180
// `[U]: 'a`, that implies that `U: 'a`. Similarly, if
@@ -209,15 +204,15 @@ impl Elaborator<'tcx> {
209
204
if r. is_late_bound ( ) {
210
205
None
211
206
} else {
212
- Some ( ty:: PredicateAtom :: RegionOutlives ( ty:: OutlivesPredicate (
207
+ Some ( ty:: PredicateKind :: RegionOutlives ( ty:: OutlivesPredicate (
213
208
r, r_min,
214
209
) ) )
215
210
}
216
211
}
217
212
218
213
Component :: Param ( p) => {
219
214
let ty = tcx. mk_ty_param ( p. index , p. name ) ;
220
- Some ( ty:: PredicateAtom :: TypeOutlives ( ty:: OutlivesPredicate (
215
+ Some ( ty:: PredicateKind :: TypeOutlives ( ty:: OutlivesPredicate (
221
216
ty, r_min,
222
217
) ) )
223
218
}
@@ -242,7 +237,7 @@ impl Elaborator<'tcx> {
242
237
} ) ,
243
238
) ;
244
239
}
245
- ty:: PredicateAtom :: TypeWellFormedFromEnv ( ..) => {
240
+ ty:: PredicateKind :: TypeWellFormedFromEnv ( ..) => {
246
241
// Nothing to elaborate
247
242
}
248
243
}
0 commit comments