@@ -155,6 +155,7 @@ pub struct CtxtInterners<'tcx> {
155155 layout : InternedSet < ' tcx , LayoutS > ,
156156 adt_def : InternedSet < ' tcx , AdtDefData > ,
157157 external_constraints : InternedSet < ' tcx , ExternalConstraintsData < ' tcx > > ,
158+ fields : InternedSet < ' tcx , List < FieldIdx > > ,
158159}
159160
160161impl < ' tcx > CtxtInterners < ' tcx > {
@@ -178,6 +179,7 @@ impl<'tcx> CtxtInterners<'tcx> {
178179 layout : Default :: default ( ) ,
179180 adt_def : Default :: default ( ) ,
180181 external_constraints : Default :: default ( ) ,
182+ fields : Default :: default ( ) ,
181183 }
182184 }
183185
@@ -1585,6 +1587,7 @@ slice_interners!(
15851587 projs: pub mk_projs( ProjectionKind ) ,
15861588 place_elems: pub mk_place_elems( PlaceElem <' tcx>) ,
15871589 bound_variable_kinds: pub mk_bound_variable_kinds( ty:: BoundVariableKind ) ,
1590+ fields: pub mk_fields( FieldIdx ) ,
15881591) ;
15891592
15901593impl < ' tcx > TyCtxt < ' tcx > {
@@ -2253,6 +2256,14 @@ impl<'tcx> TyCtxt<'tcx> {
22532256 T :: collect_and_apply ( iter, |xs| self . mk_place_elems ( xs) )
22542257 }
22552258
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+
22562267 pub fn mk_substs_trait (
22572268 self ,
22582269 self_ty : Ty < ' tcx > ,
0 commit comments