@@ -155,6 +155,7 @@ pub struct CtxtInterners<'tcx> {
155
155
layout : InternedSet < ' tcx , LayoutS > ,
156
156
adt_def : InternedSet < ' tcx , AdtDefData > ,
157
157
external_constraints : InternedSet < ' tcx , ExternalConstraintsData < ' tcx > > ,
158
+ fields : InternedSet < ' tcx , List < FieldIdx > > ,
158
159
}
159
160
160
161
impl < ' tcx > CtxtInterners < ' tcx > {
@@ -178,6 +179,7 @@ impl<'tcx> CtxtInterners<'tcx> {
178
179
layout : Default :: default ( ) ,
179
180
adt_def : Default :: default ( ) ,
180
181
external_constraints : Default :: default ( ) ,
182
+ fields : Default :: default ( ) ,
181
183
}
182
184
}
183
185
@@ -1585,6 +1587,7 @@ slice_interners!(
1585
1587
projs: pub mk_projs( ProjectionKind ) ,
1586
1588
place_elems: pub mk_place_elems( PlaceElem <' tcx>) ,
1587
1589
bound_variable_kinds: pub mk_bound_variable_kinds( ty:: BoundVariableKind ) ,
1590
+ fields: pub mk_fields( FieldIdx ) ,
1588
1591
) ;
1589
1592
1590
1593
impl < ' tcx > TyCtxt < ' tcx > {
@@ -2253,6 +2256,14 @@ impl<'tcx> TyCtxt<'tcx> {
2253
2256
T :: collect_and_apply ( iter, |xs| self . mk_place_elems ( xs) )
2254
2257
}
2255
2258
2259
+ pub fn mk_fields_from_iter < I , T > ( self , iter : I ) -> T :: Output
2260
+ where
2261
+ I : Iterator < Item = T > ,
2262
+ T : CollectAndApply < FieldIdx , & ' tcx List < FieldIdx > > ,
2263
+ {
2264
+ T :: collect_and_apply ( iter, |xs| self . mk_fields ( xs) )
2265
+ }
2266
+
2256
2267
pub fn mk_substs_trait (
2257
2268
self ,
2258
2269
self_ty : Ty < ' tcx > ,
0 commit comments