@@ -30,9 +30,7 @@ use rustc_attr as attr;
3030use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
3131use rustc_data_structures:: profiling:: SelfProfilerRef ;
3232use rustc_data_structures:: sharded:: { IntoPointer , ShardedHashMap } ;
33- use rustc_data_structures:: stable_hasher:: {
34- hash_stable_hashmap, HashStable , StableHasher , StableVec ,
35- } ;
33+ use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher , StableVec } ;
3634use rustc_data_structures:: steal:: Steal ;
3735use rustc_data_structures:: sync:: { self , Lock , Lrc , WorkerLocal } ;
3836use rustc_errors:: ErrorReported ;
@@ -386,9 +384,6 @@ pub struct TypeckResults<'tcx> {
386384 /// <https://github.com/rust-lang/rfcs/blob/master/text/2005-match-ergonomics.md#definitions>
387385 pat_adjustments : ItemLocalMap < Vec < Ty < ' tcx > > > ,
388386
389- /// Borrows
390- pub upvar_capture_map : ty:: UpvarCaptureMap < ' tcx > ,
391-
392387 /// Records the reasons that we picked the kind of each closure;
393388 /// not all closures are present in the map.
394389 closure_kind_origins : ItemLocalMap < ( Span , HirPlace < ' tcx > ) > ,
@@ -424,12 +419,6 @@ pub struct TypeckResults<'tcx> {
424419 /// by this function.
425420 pub concrete_opaque_types : FxHashMap < DefId , ResolvedOpaqueTy < ' tcx > > ,
426421
427- /// Given the closure ID this map provides the list of UpvarIDs used by it.
428- /// The upvarID contains the HIR node ID and it also contains the full path
429- /// leading to the member of the struct or tuple that is used instead of the
430- /// entire variable.
431- pub closure_captures : ty:: UpvarListMap ,
432-
433422 /// Tracks the minimum captures required for a closure;
434423 /// see `MinCaptureInformationMap` for more details.
435424 pub closure_min_captures : ty:: MinCaptureInformationMap < ' tcx > ,
@@ -482,15 +471,13 @@ impl<'tcx> TypeckResults<'tcx> {
482471 adjustments : Default :: default ( ) ,
483472 pat_binding_modes : Default :: default ( ) ,
484473 pat_adjustments : Default :: default ( ) ,
485- upvar_capture_map : Default :: default ( ) ,
486474 closure_kind_origins : Default :: default ( ) ,
487475 liberated_fn_sigs : Default :: default ( ) ,
488476 fru_field_types : Default :: default ( ) ,
489477 coercion_casts : Default :: default ( ) ,
490478 used_trait_imports : Lrc :: new ( Default :: default ( ) ) ,
491479 tainted_by_errors : None ,
492480 concrete_opaque_types : Default :: default ( ) ,
493- closure_captures : Default :: default ( ) ,
494481 closure_min_captures : Default :: default ( ) ,
495482 closure_fake_reads : Default :: default ( ) ,
496483 generator_interior_types : ty:: Binder :: dummy ( Default :: default ( ) ) ,
@@ -675,10 +662,6 @@ impl<'tcx> TypeckResults<'tcx> {
675662 . flatten ( )
676663 }
677664
678- pub fn upvar_capture ( & self , upvar_id : ty:: UpvarId ) -> ty:: UpvarCapture < ' tcx > {
679- self . upvar_capture_map [ & upvar_id]
680- }
681-
682665 pub fn closure_kind_origins ( & self ) -> LocalTableInContext < ' _ , ( Span , HirPlace < ' tcx > ) > {
683666 LocalTableInContext { hir_owner : self . hir_owner , data : & self . closure_kind_origins }
684667 }
@@ -732,24 +715,22 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for TypeckResults<'tcx> {
732715 ref adjustments,
733716 ref pat_binding_modes,
734717 ref pat_adjustments,
735- ref upvar_capture_map,
736718 ref closure_kind_origins,
737719 ref liberated_fn_sigs,
738720 ref fru_field_types,
739-
740721 ref coercion_casts,
741-
742722 ref used_trait_imports,
743723 tainted_by_errors,
744724 ref concrete_opaque_types,
745- ref closure_captures,
746725 ref closure_min_captures,
747726 ref closure_fake_reads,
748727 ref generator_interior_types,
749728 ref treat_byte_string_as_slice,
750729 } = * self ;
751730
752731 hcx. with_node_id_hashing_mode ( NodeIdHashingMode :: HashDefPath , |hcx| {
732+ hcx. local_def_path_hash ( hir_owner) ;
733+
753734 type_dependent_defs. hash_stable ( hcx, hasher) ;
754735 field_indices. hash_stable ( hcx, hasher) ;
755736 user_provided_types. hash_stable ( hcx, hasher) ;
@@ -759,17 +740,6 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for TypeckResults<'tcx> {
759740 adjustments. hash_stable ( hcx, hasher) ;
760741 pat_binding_modes. hash_stable ( hcx, hasher) ;
761742 pat_adjustments. hash_stable ( hcx, hasher) ;
762- hash_stable_hashmap ( hcx, hasher, upvar_capture_map, |up_var_id, hcx| {
763- let ty:: UpvarId { var_path, closure_expr_id } = * up_var_id;
764-
765- assert_eq ! ( var_path. hir_id. owner, hir_owner) ;
766-
767- (
768- hcx. local_def_path_hash ( var_path. hir_id . owner ) ,
769- var_path. hir_id . local_id ,
770- hcx. local_def_path_hash ( closure_expr_id) ,
771- )
772- } ) ;
773743
774744 closure_kind_origins. hash_stable ( hcx, hasher) ;
775745 liberated_fn_sigs. hash_stable ( hcx, hasher) ;
@@ -778,7 +748,6 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for TypeckResults<'tcx> {
778748 used_trait_imports. hash_stable ( hcx, hasher) ;
779749 tainted_by_errors. hash_stable ( hcx, hasher) ;
780750 concrete_opaque_types. hash_stable ( hcx, hasher) ;
781- closure_captures. hash_stable ( hcx, hasher) ;
782751 closure_min_captures. hash_stable ( hcx, hasher) ;
783752 closure_fake_reads. hash_stable ( hcx, hasher) ;
784753 generator_interior_types. hash_stable ( hcx, hasher) ;
0 commit comments