@@ -19,11 +19,12 @@ use crate::ty::query::{self, OnDiskCache, TyCtxtAt};
1919use crate :: ty:: subst:: { GenericArg , GenericArgKind , InternalSubsts , Subst , SubstsRef , UserSubsts } ;
2020use crate :: ty:: TyKind :: * ;
2121use crate :: ty:: {
22- self , AdtDef , AdtKind , Binder , BindingMode , BoundVar , CanonicalPolyFnSig , Const , ConstVid ,
23- DefIdTree , ExistentialPredicate , FloatTy , FloatVar , FloatVid , GenericParamDefKind , InferConst ,
24- InferTy , IntTy , IntVar , IntVid , List , MainDefinition , ParamConst , ParamTy , PolyFnSig ,
25- Predicate , PredicateInner , PredicateKind , ProjectionTy , Region , RegionKind , ReprOptions ,
26- TraitObjectVisitor , Ty , TyKind , TyS , TyVar , TyVid , TypeAndMut , UintTy , Visibility ,
22+ self , AdtDef , AdtKind , Binder , BindingMode , BoundVar , CanonicalPolyFnSig ,
23+ ClosureSizeProfileData , Const , ConstVid , DefIdTree , ExistentialPredicate , FloatTy , FloatVar ,
24+ FloatVid , GenericParamDefKind , InferConst , InferTy , IntTy , IntVar , IntVid , List ,
25+ MainDefinition , ParamConst , ParamTy , PolyFnSig , Predicate , PredicateInner , PredicateKind ,
26+ ProjectionTy , Region , RegionKind , ReprOptions , TraitObjectVisitor , Ty , TyKind , TyS , TyVar ,
27+ TyVid , TypeAndMut , UintTy , Visibility ,
2728} ;
2829use rustc_ast as ast;
2930use rustc_ast:: expand:: allocator:: AllocatorKind ;
@@ -484,6 +485,10 @@ pub struct TypeckResults<'tcx> {
484485 /// This hashset records all instances where we behave
485486 /// like this to allow `const_to_pat` to reliably handle this situation.
486487 pub treat_byte_string_as_slice : ItemLocalSet ,
488+
489+ /// Contains the data for evaluating the effect of feature `capture_disjoint_fields`
490+ /// on closure size.
491+ pub closure_size_eval : FxHashMap < DefId , ClosureSizeProfileData < ' tcx > > ,
487492}
488493
489494impl < ' tcx > TypeckResults < ' tcx > {
@@ -510,6 +515,7 @@ impl<'tcx> TypeckResults<'tcx> {
510515 closure_fake_reads : Default :: default ( ) ,
511516 generator_interior_types : ty:: Binder :: dummy ( Default :: default ( ) ) ,
512517 treat_byte_string_as_slice : Default :: default ( ) ,
518+ closure_size_eval : Default :: default ( ) ,
513519 }
514520 }
515521
@@ -754,6 +760,7 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for TypeckResults<'tcx> {
754760 ref closure_fake_reads,
755761 ref generator_interior_types,
756762 ref treat_byte_string_as_slice,
763+ ref closure_size_eval,
757764 } = * self ;
758765
759766 hcx. with_node_id_hashing_mode ( NodeIdHashingMode :: HashDefPath , |hcx| {
@@ -780,6 +787,7 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for TypeckResults<'tcx> {
780787 closure_fake_reads. hash_stable ( hcx, hasher) ;
781788 generator_interior_types. hash_stable ( hcx, hasher) ;
782789 treat_byte_string_as_slice. hash_stable ( hcx, hasher) ;
790+ closure_size_eval. hash_stable ( hcx, hasher) ;
783791 } )
784792 }
785793}
0 commit comments