@@ -360,9 +360,9 @@ pub struct TypeckTables<'tcx> {
360
360
/// Records the type of each closure.
361
361
closure_tys : ItemLocalMap < ty:: PolyFnSig < ' tcx > > ,
362
362
363
- /// Records the kind of each closure and the span and name of the variable
364
- /// that caused the closure to be this kind .
365
- closure_kinds : ItemLocalMap < ( ty :: ClosureKind , Option < ( Span , ast:: Name ) > ) > ,
363
+ /// Records the reasons that we picked the kind of each closure;
364
+ /// not all closures are present in the map .
365
+ closure_kind_origins : ItemLocalMap < ( Span , ast:: Name ) > ,
366
366
367
367
generator_sigs : ItemLocalMap < Option < ty:: GenSig < ' tcx > > > ,
368
368
@@ -415,7 +415,7 @@ impl<'tcx> TypeckTables<'tcx> {
415
415
generator_sigs : ItemLocalMap ( ) ,
416
416
generator_interiors : ItemLocalMap ( ) ,
417
417
closure_tys : ItemLocalMap ( ) ,
418
- closure_kinds : ItemLocalMap ( ) ,
418
+ closure_kind_origins : ItemLocalMap ( ) ,
419
419
liberated_fn_sigs : ItemLocalMap ( ) ,
420
420
fru_field_types : ItemLocalMap ( ) ,
421
421
cast_kinds : ItemLocalMap ( ) ,
@@ -625,19 +625,17 @@ impl<'tcx> TypeckTables<'tcx> {
625
625
}
626
626
}
627
627
628
- pub fn closure_kinds ( & self ) -> LocalTableInContext < ( ty:: ClosureKind ,
629
- Option < ( Span , ast:: Name ) > ) > {
628
+ pub fn closure_kind_origins ( & self ) -> LocalTableInContext < ( Span , ast:: Name ) > {
630
629
LocalTableInContext {
631
630
local_id_root : self . local_id_root ,
632
- data : & self . closure_kinds
631
+ data : & self . closure_kind_origins
633
632
}
634
633
}
635
634
636
- pub fn closure_kinds_mut ( & mut self )
637
- -> LocalTableInContextMut < ( ty:: ClosureKind , Option < ( Span , ast:: Name ) > ) > {
635
+ pub fn closure_kind_origins_mut ( & mut self ) -> LocalTableInContextMut < ( Span , ast:: Name ) > {
638
636
LocalTableInContextMut {
639
637
local_id_root : self . local_id_root ,
640
- data : & mut self . closure_kinds
638
+ data : & mut self . closure_kind_origins
641
639
}
642
640
}
643
641
@@ -734,7 +732,7 @@ impl<'gcx> HashStable<StableHashingContext<'gcx>> for TypeckTables<'gcx> {
734
732
ref pat_adjustments,
735
733
ref upvar_capture_map,
736
734
ref closure_tys,
737
- ref closure_kinds ,
735
+ ref closure_kind_origins ,
738
736
ref liberated_fn_sigs,
739
737
ref fru_field_types,
740
738
@@ -777,7 +775,7 @@ impl<'gcx> HashStable<StableHashingContext<'gcx>> for TypeckTables<'gcx> {
777
775
} ) ;
778
776
779
777
closure_tys. hash_stable ( hcx, hasher) ;
780
- closure_kinds . hash_stable ( hcx, hasher) ;
778
+ closure_kind_origins . hash_stable ( hcx, hasher) ;
781
779
liberated_fn_sigs. hash_stable ( hcx, hasher) ;
782
780
fru_field_types. hash_stable ( hcx, hasher) ;
783
781
cast_kinds. hash_stable ( hcx, hasher) ;
0 commit comments