@@ -9,13 +9,8 @@ pub fn anonymize_predicate<'tcx>(
99 tcx : TyCtxt < ' tcx > ,
1010 pred : ty:: Predicate < ' tcx > ,
1111) -> 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)
1914}
2015
2116struct PredicateSet < ' tcx > {
@@ -126,9 +121,9 @@ impl Elaborator<'tcx> {
126121 fn elaborate ( & mut self , obligation : & PredicateObligation < ' tcx > ) {
127122 let tcx = self . visited . tcx ;
128123
129- let bound_predicate = obligation. predicate . bound_atom ( ) ;
124+ let bound_predicate = obligation. predicate . kind ( ) ;
130125 match bound_predicate. skip_binder ( ) {
131- ty:: PredicateAtom :: Trait ( data, _) => {
126+ ty:: PredicateKind :: Trait ( data, _) => {
132127 // Get predicates declared on the trait.
133128 let predicates = tcx. super_predicates_of ( data. def_id ( ) ) ;
134129
@@ -150,36 +145,36 @@ impl Elaborator<'tcx> {
150145
151146 self . stack . extend ( obligations) ;
152147 }
153- ty:: PredicateAtom :: WellFormed ( ..) => {
148+ ty:: PredicateKind :: WellFormed ( ..) => {
154149 // Currently, we do not elaborate WF predicates,
155150 // although we easily could.
156151 }
157- ty:: PredicateAtom :: ObjectSafe ( ..) => {
152+ ty:: PredicateKind :: ObjectSafe ( ..) => {
158153 // Currently, we do not elaborate object-safe
159154 // predicates.
160155 }
161- ty:: PredicateAtom :: Subtype ( ..) => {
156+ ty:: PredicateKind :: Subtype ( ..) => {
162157 // Currently, we do not "elaborate" predicates like `X <: Y`,
163158 // though conceivably we might.
164159 }
165- ty:: PredicateAtom :: Projection ( ..) => {
160+ ty:: PredicateKind :: Projection ( ..) => {
166161 // Nothing to elaborate in a projection predicate.
167162 }
168- ty:: PredicateAtom :: ClosureKind ( ..) => {
163+ ty:: PredicateKind :: ClosureKind ( ..) => {
169164 // Nothing to elaborate when waiting for a closure's kind to be inferred.
170165 }
171- ty:: PredicateAtom :: ConstEvaluatable ( ..) => {
166+ ty:: PredicateKind :: ConstEvaluatable ( ..) => {
172167 // Currently, we do not elaborate const-evaluatable
173168 // predicates.
174169 }
175- ty:: PredicateAtom :: ConstEquate ( ..) => {
170+ ty:: PredicateKind :: ConstEquate ( ..) => {
176171 // Currently, we do not elaborate const-equate
177172 // predicates.
178173 }
179- ty:: PredicateAtom :: RegionOutlives ( ..) => {
174+ ty:: PredicateKind :: RegionOutlives ( ..) => {
180175 // Nothing to elaborate from `'a: 'b`.
181176 }
182- ty:: PredicateAtom :: TypeOutlives ( ty:: OutlivesPredicate ( ty_max, r_min) ) => {
177+ ty:: PredicateKind :: TypeOutlives ( ty:: OutlivesPredicate ( ty_max, r_min) ) => {
183178 // We know that `T: 'a` for some type `T`. We can
184179 // often elaborate this. For example, if we know that
185180 // `[U]: 'a`, that implies that `U: 'a`. Similarly, if
@@ -209,15 +204,15 @@ impl Elaborator<'tcx> {
209204 if r. is_late_bound ( ) {
210205 None
211206 } else {
212- Some ( ty:: PredicateAtom :: RegionOutlives ( ty:: OutlivesPredicate (
207+ Some ( ty:: PredicateKind :: RegionOutlives ( ty:: OutlivesPredicate (
213208 r, r_min,
214209 ) ) )
215210 }
216211 }
217212
218213 Component :: Param ( p) => {
219214 let ty = tcx. mk_ty_param ( p. index , p. name ) ;
220- Some ( ty:: PredicateAtom :: TypeOutlives ( ty:: OutlivesPredicate (
215+ Some ( ty:: PredicateKind :: TypeOutlives ( ty:: OutlivesPredicate (
221216 ty, r_min,
222217 ) ) )
223218 }
@@ -242,7 +237,7 @@ impl Elaborator<'tcx> {
242237 } ) ,
243238 ) ;
244239 }
245- ty:: PredicateAtom :: TypeWellFormedFromEnv ( ..) => {
240+ ty:: PredicateKind :: TypeWellFormedFromEnv ( ..) => {
246241 // Nothing to elaborate
247242 }
248243 }
0 commit comments