@@ -31,7 +31,7 @@ use middle::cstore::EncodedMetadata;
31
31
use middle:: lang_items;
32
32
use middle:: resolve_lifetime:: { self , ObjectLifetimeDefault } ;
33
33
use middle:: stability;
34
- use mir:: { self , Mir , interpret} ;
34
+ use mir:: { self , Mir , interpret, ProjectionKind } ;
35
35
use mir:: interpret:: Allocation ;
36
36
use ty:: subst:: { CanonicalUserSubsts , Kind , Substs , Subst } ;
37
37
use ty:: ReprOptions ;
@@ -132,6 +132,7 @@ pub struct CtxtInterners<'tcx> {
132
132
clauses : InternedSet < ' tcx , List < Clause < ' tcx > > > ,
133
133
goal : InternedSet < ' tcx , GoalKind < ' tcx > > ,
134
134
goal_list : InternedSet < ' tcx , List < Goal < ' tcx > > > ,
135
+ projs : InternedSet < ' tcx , List < ProjectionKind < ' tcx > > > ,
135
136
}
136
137
137
138
impl < ' gcx : ' tcx , ' tcx > CtxtInterners < ' tcx > {
@@ -149,6 +150,7 @@ impl<'gcx: 'tcx, 'tcx> CtxtInterners<'tcx> {
149
150
clauses : Default :: default ( ) ,
150
151
goal : Default :: default ( ) ,
151
152
goal_list : Default :: default ( ) ,
153
+ projs : Default :: default ( ) ,
152
154
}
153
155
}
154
156
@@ -2294,6 +2296,13 @@ impl<'tcx: 'lcx, 'lcx> Borrow<[Kind<'lcx>]> for Interned<'tcx, Substs<'tcx>> {
2294
2296
}
2295
2297
}
2296
2298
2299
+ impl < ' tcx : ' lcx , ' lcx > Borrow < [ ProjectionKind < ' lcx > ] >
2300
+ for Interned < ' tcx , List < ProjectionKind < ' tcx > > > {
2301
+ fn borrow < ' a > ( & ' a self ) -> & ' a [ ProjectionKind < ' lcx > ] {
2302
+ & self . 0 [ ..]
2303
+ }
2304
+ }
2305
+
2297
2306
impl < ' tcx > Borrow < RegionKind > for Interned < ' tcx , RegionKind > {
2298
2307
fn borrow < ' a > ( & ' a self ) -> & ' a RegionKind {
2299
2308
& self . 0
@@ -2441,7 +2450,8 @@ slice_interners!(
2441
2450
type_list: _intern_type_list( Ty ) ,
2442
2451
substs: _intern_substs( Kind ) ,
2443
2452
clauses: _intern_clauses( Clause ) ,
2444
- goal_list: _intern_goals( Goal )
2453
+ goal_list: _intern_goals( Goal ) ,
2454
+ projs: _intern_projs( ProjectionKind )
2445
2455
) ;
2446
2456
2447
2457
// This isn't a perfect fit: CanonicalVarInfo slices are always
@@ -2743,6 +2753,14 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
2743
2753
}
2744
2754
}
2745
2755
2756
+ pub fn intern_projs ( self , ps : & [ ProjectionKind < ' tcx > ] ) -> & ' tcx List < ProjectionKind < ' tcx > > {
2757
+ if ps. len ( ) == 0 {
2758
+ List :: empty ( )
2759
+ } else {
2760
+ self . _intern_projs ( ps)
2761
+ }
2762
+ }
2763
+
2746
2764
pub fn intern_canonical_var_infos ( self , ts : & [ CanonicalVarInfo ] ) -> CanonicalVarInfos < ' gcx > {
2747
2765
if ts. len ( ) == 0 {
2748
2766
List :: empty ( )
0 commit comments