@@ -1070,16 +1070,6 @@ impl<'tcx> Predicate<'tcx> {
10701070 self . inner . binder . skip_binder ( )
10711071 }
10721072
1073- /// Returns the inner `PredicateAtom`.
1074- ///
1075- /// Note that this method does not check if the predicate has unbound variables.
1076- ///
1077- /// Rebinding the returned atom can causes the previously bound variables
1078- /// to end up at the wrong binding level.
1079- pub fn skip_binders_unchecked ( self ) -> PredicateAtom < ' tcx > {
1080- self . inner . binder . skip_binder ( )
1081- }
1082-
10831073 /// Converts this to a `Binder<PredicateAtom<'tcx>>`. If the value was an
10841074 /// `Atom`, then it is not allowed to contain escaping bound vars.
10851075 pub fn bound_atom ( self ) -> Binder < PredicateAtom < ' tcx > > {
@@ -1089,12 +1079,6 @@ impl<'tcx> Predicate<'tcx> {
10891079 pub fn bound_atom_ref ( self ) -> & ' tcx Binder < PredicateAtom < ' tcx > > {
10901080 & self . inner . binder
10911081 }
1092-
1093- /// Allows using a `Binder<PredicateAtom<'tcx>>` even if the given predicate previously
1094- /// contained unbound variables by shifting these variables outwards.
1095- pub fn bound_atom_with_opt_escaping ( self , _tcx : TyCtxt < ' tcx > ) -> Binder < PredicateAtom < ' tcx > > {
1096- self . inner . binder
1097- }
10981082}
10991083
11001084impl < ' a , ' tcx > HashStable < StableHashingContext < ' a > > for Predicate < ' tcx > {
@@ -1160,13 +1144,6 @@ pub enum PredicateAtom<'tcx> {
11601144 TypeWellFormedFromEnv ( Ty < ' tcx > ) ,
11611145}
11621146
1163- impl < ' tcx > Binder < PredicateAtom < ' tcx > > {
1164- /// Wraps `self` with the given qualifier if this predicate has any unbound variables.
1165- pub fn potentially_quantified ( self , tcx : TyCtxt < ' tcx > ) -> Predicate < ' tcx > {
1166- self . to_predicate ( tcx)
1167- }
1168- }
1169-
11701147/// The crate outlives map is computed during typeck and contains the
11711148/// outlives of every item in the local crate. You should not use it
11721149/// directly, because to do so will make your pass dependent on the
@@ -1254,7 +1231,7 @@ impl<'tcx> Predicate<'tcx> {
12541231 let substs = trait_ref. skip_binder ( ) . substs ;
12551232 let pred = self . skip_binders ( ) ;
12561233 let new = pred. subst ( tcx, substs) ;
1257- if new != pred { ty:: Binder :: bind ( new) . potentially_quantified ( tcx) } else { self }
1234+ if new != pred { ty:: Binder :: bind ( new) . to_predicate ( tcx) } else { self }
12581235 }
12591236}
12601237
@@ -1409,27 +1386,25 @@ impl<'tcx> ToPredicate<'tcx> for ConstnessAnd<PolyTraitRef<'tcx>> {
14091386
14101387impl < ' tcx > ToPredicate < ' tcx > for ConstnessAnd < PolyTraitPredicate < ' tcx > > {
14111388 fn to_predicate ( self , tcx : TyCtxt < ' tcx > ) -> Predicate < ' tcx > {
1412- self . value
1413- . map_bound ( |value| PredicateAtom :: Trait ( value, self . constness ) )
1414- . potentially_quantified ( tcx)
1389+ self . value . map_bound ( |value| PredicateAtom :: Trait ( value, self . constness ) ) . to_predicate ( tcx)
14151390 }
14161391}
14171392
14181393impl < ' tcx > ToPredicate < ' tcx > for PolyRegionOutlivesPredicate < ' tcx > {
14191394 fn to_predicate ( self , tcx : TyCtxt < ' tcx > ) -> Predicate < ' tcx > {
1420- self . map_bound ( PredicateAtom :: RegionOutlives ) . potentially_quantified ( tcx)
1395+ self . map_bound ( PredicateAtom :: RegionOutlives ) . to_predicate ( tcx)
14211396 }
14221397}
14231398
14241399impl < ' tcx > ToPredicate < ' tcx > for PolyTypeOutlivesPredicate < ' tcx > {
14251400 fn to_predicate ( self , tcx : TyCtxt < ' tcx > ) -> Predicate < ' tcx > {
1426- self . map_bound ( PredicateAtom :: TypeOutlives ) . potentially_quantified ( tcx)
1401+ self . map_bound ( PredicateAtom :: TypeOutlives ) . to_predicate ( tcx)
14271402 }
14281403}
14291404
14301405impl < ' tcx > ToPredicate < ' tcx > for PolyProjectionPredicate < ' tcx > {
14311406 fn to_predicate ( self , tcx : TyCtxt < ' tcx > ) -> Predicate < ' tcx > {
1432- self . map_bound ( PredicateAtom :: Projection ) . potentially_quantified ( tcx)
1407+ self . map_bound ( PredicateAtom :: Projection ) . to_predicate ( tcx)
14331408 }
14341409}
14351410
0 commit comments