@@ -17,9 +17,9 @@ use crate::ty::query::{self, TyCtxtAt};
1717use crate :: ty:: subst:: { GenericArg , GenericArgKind , InternalSubsts , Subst , SubstsRef , UserSubsts } ;
1818use crate :: ty:: TyKind :: * ;
1919use crate :: ty:: {
20- self , AdtDef , AdtKind , BindingMode , BoundVar , CanonicalPolyFnSig , Const , ConstVid , DefIdTree ,
21- ExistentialPredicate , FloatVar , FloatVid , GenericParamDefKind , InferConst , InferTy , IntVar ,
22- IntVid , List , ParamConst , ParamTy , PolyFnSig , Predicate , PredicateInner , PredicateKind ,
20+ self , AdtDef , AdtKind , Binder , BindingMode , BoundVar , CanonicalPolyFnSig , Const , ConstVid ,
21+ DefIdTree , ExistentialPredicate , FloatVar , FloatVid , GenericParamDefKind , InferConst , InferTy ,
22+ IntVar , IntVid , List , ParamConst , ParamTy , PolyFnSig , Predicate , PredicateAtom , PredicateInner ,
2323 ProjectionTy , Region , RegionKind , ReprOptions , TraitObjectVisitor , Ty , TyKind , TyS , TyVar ,
2424 TyVid , TypeAndMut , Visibility ,
2525} ;
@@ -133,7 +133,7 @@ impl<'tcx> CtxtInterners<'tcx> {
133133 }
134134
135135 #[ inline( never) ]
136- fn intern_predicate ( & self , kind : PredicateKind < ' tcx > ) -> & ' tcx PredicateInner < ' tcx > {
136+ fn intern_predicate ( & self , kind : Binder < PredicateAtom < ' tcx > > ) -> & ' tcx PredicateInner < ' tcx > {
137137 self . predicate
138138 . intern ( kind, |kind| {
139139 let flags = super :: flags:: FlagComputation :: for_predicate ( kind) ;
@@ -1948,8 +1948,8 @@ impl<'tcx> Hash for Interned<'tcx, PredicateInner<'tcx>> {
19481948 }
19491949}
19501950
1951- impl < ' tcx > Borrow < PredicateKind < ' tcx > > for Interned < ' tcx , PredicateInner < ' tcx > > {
1952- fn borrow < ' a > ( & ' a self ) -> & ' a PredicateKind < ' tcx > {
1951+ impl < ' tcx > Borrow < Binder < PredicateAtom < ' tcx > > > for Interned < ' tcx , PredicateInner < ' tcx > > {
1952+ fn borrow < ' a > ( & ' a self ) -> & ' a Binder < PredicateAtom < ' tcx > > {
19531953 & self . 0 . kind
19541954 }
19551955}
@@ -1987,12 +1987,6 @@ impl<'tcx> Borrow<Const<'tcx>> for Interned<'tcx, Const<'tcx>> {
19871987 }
19881988}
19891989
1990- impl < ' tcx > Borrow < PredicateKind < ' tcx > > for Interned < ' tcx , PredicateKind < ' tcx > > {
1991- fn borrow < ' a > ( & ' a self ) -> & ' a PredicateKind < ' tcx > {
1992- & self . 0
1993- }
1994- }
1995-
19961990macro_rules! direct_interners {
19971991 ( $( $name: ident: $method: ident( $ty: ty) , ) +) => {
19981992 $( impl <' tcx> PartialEq for Interned <' tcx, $ty> {
@@ -2091,7 +2085,7 @@ impl<'tcx> TyCtxt<'tcx> {
20912085 }
20922086
20932087 #[ inline]
2094- pub fn mk_predicate ( self , kind : PredicateKind < ' tcx > ) -> Predicate < ' tcx > {
2088+ pub fn mk_predicate ( self , kind : Binder < PredicateAtom < ' tcx > > ) -> Predicate < ' tcx > {
20952089 let inner = self . interners . intern_predicate ( kind) ;
20962090 Predicate { inner }
20972091 }
@@ -2100,9 +2094,9 @@ impl<'tcx> TyCtxt<'tcx> {
21002094 pub fn reuse_or_mk_predicate (
21012095 self ,
21022096 pred : Predicate < ' tcx > ,
2103- kind : PredicateKind < ' tcx > ,
2097+ kind : Binder < PredicateAtom < ' tcx > > ,
21042098 ) -> Predicate < ' tcx > {
2105- if * pred. kind ( ) != kind { self . mk_predicate ( kind) } else { pred }
2099+ if pred. kind ( ) != kind { self . mk_predicate ( kind) } else { pred }
21062100 }
21072101
21082102 pub fn mk_mach_int ( self , tm : ast:: IntTy ) -> Ty < ' tcx > {
0 commit comments