@@ -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
@@ -1731,9 +1733,9 @@ impl<'a, 'tcx> Lift<'tcx> for Region<'a> {
17311733 }
17321734}
17331735
1734- impl < ' a , ' tcx > Lift < ' tcx > for & ' a Goal < ' a > {
1735- type Lifted = & ' tcx Goal < ' tcx > ;
1736- fn lift_to_tcx < ' b , ' gcx > ( & self , tcx : TyCtxt < ' b , ' gcx , ' tcx > ) -> Option < & ' tcx Goal < ' tcx > > {
1736+ impl < ' a , ' tcx > Lift < ' tcx > for Goal < ' a > {
1737+ type Lifted = Goal < ' tcx > ;
1738+ fn lift_to_tcx < ' b , ' gcx > ( & self , tcx : TyCtxt < ' b , ' gcx , ' tcx > ) -> Option < Goal < ' tcx > > {
17371739 if tcx. interners . arena . in_arena ( * self as * const _ ) {
17381740 return Some ( unsafe { mem:: transmute ( * self ) } ) ;
17391741 }
@@ -2304,6 +2306,12 @@ impl<'tcx> Borrow<RegionKind> for Interned<'tcx, RegionKind> {
23042306 }
23052307}
23062308
2309+ impl < ' tcx : ' lcx , ' lcx > Borrow < GoalKind < ' lcx > > for Interned < ' tcx , GoalKind < ' tcx > > {
2310+ fn borrow < ' a > ( & ' a self ) -> & ' a GoalKind < ' lcx > {
2311+ & self . 0
2312+ }
2313+ }
2314+
23072315impl < ' tcx : ' lcx , ' lcx > Borrow < [ ExistentialPredicate < ' lcx > ] >
23082316 for Interned < ' tcx , List < ExistentialPredicate < ' tcx > > > {
23092317 fn borrow < ' a > ( & ' a self ) -> & ' a [ ExistentialPredicate < ' lcx > ] {
@@ -2419,7 +2427,8 @@ pub fn keep_local<'tcx, T: ty::TypeFoldable<'tcx>>(x: &T) -> bool {
24192427
24202428direct_interners ! ( ' tcx,
24212429 region: mk_region( |r: & RegionKind | r. keep_in_local_tcx( ) ) -> RegionKind ,
2422- const_: mk_const( |c: & Const <' _>| keep_local( & c. ty) || keep_local( & c. val) ) -> Const <' tcx>
2430+ const_: mk_const( |c: & Const <' _>| keep_local( & c. ty) || keep_local( & c. val) ) -> Const <' tcx>,
2431+ goal: mk_goal( |c: & GoalKind <' _>| keep_local( c) ) -> GoalKind <' tcx>
24232432) ;
24242433
24252434macro_rules! slice_interners {
@@ -2438,7 +2447,7 @@ slice_interners!(
24382447 type_list: _intern_type_list( Ty ) ,
24392448 substs: _intern_substs( Kind ) ,
24402449 clauses: _intern_clauses( Clause ) ,
2441- goals : _intern_goals( Goal )
2450+ goal_list : _intern_goals( Goal )
24422451) ;
24432452
24442453// This isn't a perfect fit: CanonicalVarInfo slices are always
@@ -2818,10 +2827,6 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
28182827 iter. intern_with ( |xs| self . intern_goals ( xs) )
28192828 }
28202829
2821- pub fn mk_goal ( self , goal : Goal < ' tcx > ) -> & ' tcx Goal < ' _ > {
2822- & self . intern_goals ( & [ goal] ) [ 0 ]
2823- }
2824-
28252830 pub fn lint_hir < S : Into < MultiSpan > > ( self ,
28262831 lint : & ' static Lint ,
28272832 hir_id : HirId ,
0 commit comments