@@ -19,11 +19,12 @@ use crate::ty::query::{self, OnDiskCache, TyCtxtAt};
19
19
use crate :: ty:: subst:: { GenericArg , GenericArgKind , InternalSubsts , Subst , SubstsRef , UserSubsts } ;
20
20
use crate :: ty:: TyKind :: * ;
21
21
use 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 ,
27
28
} ;
28
29
use rustc_ast as ast;
29
30
use rustc_ast:: expand:: allocator:: AllocatorKind ;
@@ -484,6 +485,10 @@ pub struct TypeckResults<'tcx> {
484
485
/// This hashset records all instances where we behave
485
486
/// like this to allow `const_to_pat` to reliably handle this situation.
486
487
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 > > ,
487
492
}
488
493
489
494
impl < ' tcx > TypeckResults < ' tcx > {
@@ -510,6 +515,7 @@ impl<'tcx> TypeckResults<'tcx> {
510
515
closure_fake_reads : Default :: default ( ) ,
511
516
generator_interior_types : ty:: Binder :: dummy ( Default :: default ( ) ) ,
512
517
treat_byte_string_as_slice : Default :: default ( ) ,
518
+ closure_size_eval : Default :: default ( ) ,
513
519
}
514
520
}
515
521
@@ -754,6 +760,7 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for TypeckResults<'tcx> {
754
760
ref closure_fake_reads,
755
761
ref generator_interior_types,
756
762
ref treat_byte_string_as_slice,
763
+ ref closure_size_eval,
757
764
} = * self ;
758
765
759
766
hcx. with_node_id_hashing_mode ( NodeIdHashingMode :: HashDefPath , |hcx| {
@@ -780,6 +787,7 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for TypeckResults<'tcx> {
780
787
closure_fake_reads. hash_stable ( hcx, hasher) ;
781
788
generator_interior_types. hash_stable ( hcx, hasher) ;
782
789
treat_byte_string_as_slice. hash_stable ( hcx, hasher) ;
790
+ closure_size_eval. hash_stable ( hcx, hasher) ;
783
791
} )
784
792
}
785
793
}
0 commit comments