@@ -10,41 +10,34 @@ pub fn anonymize_predicate<'tcx>(
10
10
tcx : TyCtxt < ' tcx > ,
11
11
pred : ty:: Predicate < ' tcx > ,
12
12
) -> ty:: Predicate < ' tcx > {
13
- let kind = pred. kind ( ) ;
13
+ let kind = pred. kint ( tcx ) ;
14
14
let new = match kind {
15
- & ty:: PredicateKind :: Trait ( ref data , constness ) => {
16
- ty:: PredicateKind :: Trait ( tcx. anonymize_late_bound_regions ( data ) , constness )
15
+ ty:: PredicateKint :: ForAll ( binder ) => {
16
+ ty:: PredicateKint :: ForAll ( tcx. anonymize_late_bound_regions ( binder ) )
17
17
}
18
+ & ty:: PredicateKint :: Trait ( data, constness) => ty:: PredicateKint :: Trait ( data, constness) ,
18
19
19
- ty:: PredicateKind :: RegionOutlives ( data) => {
20
- ty:: PredicateKind :: RegionOutlives ( tcx. anonymize_late_bound_regions ( data) )
21
- }
20
+ & ty:: PredicateKint :: RegionOutlives ( data) => ty:: PredicateKint :: RegionOutlives ( data) ,
22
21
23
- ty:: PredicateKind :: TypeOutlives ( data) => {
24
- ty:: PredicateKind :: TypeOutlives ( tcx. anonymize_late_bound_regions ( data) )
25
- }
22
+ & ty:: PredicateKint :: TypeOutlives ( data) => ty:: PredicateKint :: TypeOutlives ( data) ,
26
23
27
- ty:: PredicateKind :: Projection ( data) => {
28
- ty:: PredicateKind :: Projection ( tcx. anonymize_late_bound_regions ( data) )
29
- }
24
+ & ty:: PredicateKint :: Projection ( data) => ty:: PredicateKint :: Projection ( data) ,
30
25
31
- & ty:: PredicateKind :: WellFormed ( data) => ty:: PredicateKind :: WellFormed ( data) ,
26
+ & ty:: PredicateKint :: WellFormed ( data) => ty:: PredicateKint :: WellFormed ( data) ,
32
27
33
- & ty:: PredicateKind :: ObjectSafe ( data) => ty:: PredicateKind :: ObjectSafe ( data) ,
28
+ & ty:: PredicateKint :: ObjectSafe ( data) => ty:: PredicateKint :: ObjectSafe ( data) ,
34
29
35
- & ty:: PredicateKind :: ClosureKind ( closure_def_id, closure_substs, kind) => {
36
- ty:: PredicateKind :: ClosureKind ( closure_def_id, closure_substs, kind)
30
+ & ty:: PredicateKint :: ClosureKind ( closure_def_id, closure_substs, kind) => {
31
+ ty:: PredicateKint :: ClosureKind ( closure_def_id, closure_substs, kind)
37
32
}
38
33
39
- ty:: PredicateKind :: Subtype ( data) => {
40
- ty:: PredicateKind :: Subtype ( tcx. anonymize_late_bound_regions ( data) )
41
- }
34
+ & ty:: PredicateKint :: Subtype ( data) => ty:: PredicateKint :: Subtype ( data) ,
42
35
43
- & ty:: PredicateKind :: ConstEvaluatable ( def_id, substs) => {
44
- ty:: PredicateKind :: ConstEvaluatable ( def_id, substs)
36
+ & ty:: PredicateKint :: ConstEvaluatable ( def_id, substs) => {
37
+ ty:: PredicateKint :: ConstEvaluatable ( def_id, substs)
45
38
}
46
39
47
- ty:: PredicateKind :: ConstEquate ( c1, c2) => ty:: PredicateKind :: ConstEquate ( c1, c2) ,
40
+ & ty:: PredicateKint :: ConstEquate ( c1, c2) => ty:: PredicateKint :: ConstEquate ( c1, c2) ,
48
41
} ;
49
42
50
43
if new != * kind { new. to_predicate ( tcx) } else { pred }
0 commit comments