@@ -36,7 +36,7 @@ use mir::interpret::Allocation;
3636use ty:: subst:: { CanonicalSubsts , Kind , Substs , Subst } ;
3737use ty:: ReprOptions ;
3838use traits;
39- use traits:: { Clause , Clauses , Goal , Goals } ;
39+ use traits:: { Clause , Clauses , GoalKind , Goal , Goals } ;
4040use ty:: { self , Ty , TypeAndMut } ;
4141use ty:: { TyS , TyKind , List } ;
4242use ty:: { AdtKind , AdtDef , ClosureSubsts , GeneratorSubsts , Region , Const } ;
@@ -143,7 +143,8 @@ pub struct CtxtInterners<'tcx> {
143143 predicates : InternedSet < ' tcx , List < Predicate < ' tcx > > > ,
144144 const_ : InternedSet < ' tcx , Const < ' tcx > > ,
145145 clauses : InternedSet < ' tcx , List < Clause < ' tcx > > > ,
146- goals : InternedSet < ' tcx , List < Goal < ' tcx > > > ,
146+ goal : InternedSet < ' tcx , GoalKind < ' tcx > > ,
147+ goal_list : InternedSet < ' tcx , List < Goal < ' tcx > > > ,
147148}
148149
149150impl < ' gcx : ' tcx , ' tcx > CtxtInterners < ' tcx > {
@@ -159,7 +160,8 @@ impl<'gcx: 'tcx, 'tcx> CtxtInterners<'tcx> {
159160 predicates : Default :: default ( ) ,
160161 const_ : Default :: default ( ) ,
161162 clauses : Default :: default ( ) ,
162- goals : Default :: default ( ) ,
163+ goal : Default :: default ( ) ,
164+ goal_list : Default :: default ( ) ,
163165 }
164166 }
165167
@@ -1766,9 +1768,9 @@ impl<'a, 'tcx> Lift<'tcx> for Region<'a> {
17661768 }
17671769}
17681770
1769- impl < ' a , ' tcx > Lift < ' tcx > for & ' a Goal < ' a > {
1770- type Lifted = & ' tcx Goal < ' tcx > ;
1771- fn lift_to_tcx < ' b , ' gcx > ( & self , tcx : TyCtxt < ' b , ' gcx , ' tcx > ) -> Option < & ' tcx Goal < ' tcx > > {
1771+ impl < ' a , ' tcx > Lift < ' tcx > for Goal < ' a > {
1772+ type Lifted = Goal < ' tcx > ;
1773+ fn lift_to_tcx < ' b , ' gcx > ( & self , tcx : TyCtxt < ' b , ' gcx , ' tcx > ) -> Option < Goal < ' tcx > > {
17721774 if tcx. interners . arena . in_arena ( * self as * const _ ) {
17731775 return Some ( unsafe { mem:: transmute ( * self ) } ) ;
17741776 }
@@ -2340,6 +2342,12 @@ impl<'tcx> Borrow<RegionKind> for Interned<'tcx, RegionKind> {
23402342 }
23412343}
23422344
2345+ impl < ' tcx : ' lcx , ' lcx > Borrow < GoalKind < ' lcx > > for Interned < ' tcx , GoalKind < ' tcx > > {
2346+ fn borrow < ' a > ( & ' a self ) -> & ' a GoalKind < ' lcx > {
2347+ & self . 0
2348+ }
2349+ }
2350+
23432351impl < ' tcx : ' lcx , ' lcx > Borrow < [ ExistentialPredicate < ' lcx > ] >
23442352 for Interned < ' tcx , List < ExistentialPredicate < ' tcx > > > {
23452353 fn borrow < ' a > ( & ' a self ) -> & ' a [ ExistentialPredicate < ' lcx > ] {
@@ -2455,7 +2463,8 @@ pub fn keep_local<'tcx, T: ty::TypeFoldable<'tcx>>(x: &T) -> bool {
24552463
24562464direct_interners ! ( ' tcx,
24572465 region: mk_region( |r: & RegionKind | r. keep_in_local_tcx( ) ) -> RegionKind ,
2458- const_: mk_const( |c: & Const <' _>| keep_local( & c. ty) || keep_local( & c. val) ) -> Const <' tcx>
2466+ const_: mk_const( |c: & Const <' _>| keep_local( & c. ty) || keep_local( & c. val) ) -> Const <' tcx>,
2467+ goal: mk_goal( |c: & GoalKind <' _>| keep_local( c) ) -> GoalKind <' tcx>
24592468) ;
24602469
24612470macro_rules! slice_interners {
@@ -2474,7 +2483,7 @@ slice_interners!(
24742483 type_list: _intern_type_list( Ty ) ,
24752484 substs: _intern_substs( Kind ) ,
24762485 clauses: _intern_clauses( Clause ) ,
2477- goals : _intern_goals( Goal )
2486+ goal_list : _intern_goals( Goal )
24782487) ;
24792488
24802489// This isn't a perfect fit: CanonicalVarInfo slices are always
@@ -2854,10 +2863,6 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
28542863 iter. intern_with ( |xs| self . intern_goals ( xs) )
28552864 }
28562865
2857- pub fn mk_goal ( self , goal : Goal < ' tcx > ) -> & ' tcx Goal < ' _ > {
2858- & self . intern_goals ( & [ goal] ) [ 0 ]
2859- }
2860-
28612866 pub fn lint_hir < S : Into < MultiSpan > > ( self ,
28622867 lint : & ' static Lint ,
28632868 hir_id : HirId ,
0 commit comments