@@ -11,36 +11,22 @@ pub fn anonymize_predicate<'tcx>(
1111 pred : ty:: Predicate < ' tcx > ,
1212) -> ty:: Predicate < ' tcx > {
1313 let kind = pred. kind ( ) ;
14- let new = match kind {
14+ match kind {
1515 ty:: PredicateKind :: ForAll ( binder) => {
16- ty:: PredicateKind :: ForAll ( tcx. anonymize_late_bound_regions ( binder) )
16+ let new = ty:: PredicateKind :: ForAll ( tcx. anonymize_late_bound_regions ( binder) ) ;
17+ if new != * kind { new. to_predicate ( tcx) } else { pred }
1718 }
18- & ty:: PredicateKind :: Trait ( data, constness) => ty:: PredicateKind :: Trait ( data, constness) ,
19-
20- & ty:: PredicateKind :: RegionOutlives ( data) => ty:: PredicateKind :: RegionOutlives ( data) ,
21-
22- & ty:: PredicateKind :: TypeOutlives ( data) => ty:: PredicateKind :: TypeOutlives ( data) ,
23-
24- & ty:: PredicateKind :: Projection ( data) => ty:: PredicateKind :: Projection ( data) ,
25-
26- & ty:: PredicateKind :: WellFormed ( data) => ty:: PredicateKind :: WellFormed ( data) ,
27-
28- & ty:: PredicateKind :: ObjectSafe ( data) => ty:: PredicateKind :: ObjectSafe ( data) ,
29-
30- & ty:: PredicateKind :: ClosureKind ( closure_def_id, closure_substs, kind) => {
31- ty:: PredicateKind :: ClosureKind ( closure_def_id, closure_substs, kind)
32- }
33-
34- & ty:: PredicateKind :: Subtype ( data) => ty:: PredicateKind :: Subtype ( data) ,
35-
36- & ty:: PredicateKind :: ConstEvaluatable ( def_id, substs) => {
37- ty:: PredicateKind :: ConstEvaluatable ( def_id, substs)
38- }
39-
40- & ty:: PredicateKind :: ConstEquate ( c1, c2) => ty:: PredicateKind :: ConstEquate ( c1, c2) ,
41- } ;
42-
43- if new != * kind { new. to_predicate ( tcx) } else { pred }
19+ ty:: PredicateKind :: Trait ( _, _)
20+ | ty:: PredicateKind :: RegionOutlives ( _)
21+ | ty:: PredicateKind :: TypeOutlives ( _)
22+ | ty:: PredicateKind :: Projection ( _)
23+ | ty:: PredicateKind :: WellFormed ( _)
24+ | ty:: PredicateKind :: ObjectSafe ( _)
25+ | ty:: PredicateKind :: ClosureKind ( _, _, _)
26+ | ty:: PredicateKind :: Subtype ( _)
27+ | ty:: PredicateKind :: ConstEvaluatable ( _, _)
28+ | ty:: PredicateKind :: ConstEquate ( _, _) => pred,
29+ }
4430}
4531
4632struct PredicateSet < ' tcx > {
0 commit comments