@@ -360,9 +360,9 @@ pub struct TypeckTables<'tcx> {
360360 /// Records the type of each closure.
361361 closure_tys : ItemLocalMap < ty:: PolyFnSig < ' tcx > > ,
362362
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 ) > ,
366366
367367 generator_sigs : ItemLocalMap < Option < ty:: GenSig < ' tcx > > > ,
368368
@@ -415,7 +415,7 @@ impl<'tcx> TypeckTables<'tcx> {
415415 generator_sigs : ItemLocalMap ( ) ,
416416 generator_interiors : ItemLocalMap ( ) ,
417417 closure_tys : ItemLocalMap ( ) ,
418- closure_kinds : ItemLocalMap ( ) ,
418+ closure_kind_origins : ItemLocalMap ( ) ,
419419 liberated_fn_sigs : ItemLocalMap ( ) ,
420420 fru_field_types : ItemLocalMap ( ) ,
421421 cast_kinds : ItemLocalMap ( ) ,
@@ -625,19 +625,17 @@ impl<'tcx> TypeckTables<'tcx> {
625625 }
626626 }
627627
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 ) > {
630629 LocalTableInContext {
631630 local_id_root : self . local_id_root ,
632- data : & self . closure_kinds
631+ data : & self . closure_kind_origins
633632 }
634633 }
635634
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 ) > {
638636 LocalTableInContextMut {
639637 local_id_root : self . local_id_root ,
640- data : & mut self . closure_kinds
638+ data : & mut self . closure_kind_origins
641639 }
642640 }
643641
@@ -734,7 +732,7 @@ impl<'gcx> HashStable<StableHashingContext<'gcx>> for TypeckTables<'gcx> {
734732 ref pat_adjustments,
735733 ref upvar_capture_map,
736734 ref closure_tys,
737- ref closure_kinds ,
735+ ref closure_kind_origins ,
738736 ref liberated_fn_sigs,
739737 ref fru_field_types,
740738
@@ -777,7 +775,7 @@ impl<'gcx> HashStable<StableHashingContext<'gcx>> for TypeckTables<'gcx> {
777775 } ) ;
778776
779777 closure_tys. hash_stable ( hcx, hasher) ;
780- closure_kinds . hash_stable ( hcx, hasher) ;
778+ closure_kind_origins . hash_stable ( hcx, hasher) ;
781779 liberated_fn_sigs. hash_stable ( hcx, hasher) ;
782780 fru_field_types. hash_stable ( hcx, hasher) ;
783781 cast_kinds. hash_stable ( hcx, hasher) ;
0 commit comments