@@ -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 }
@@ -722,7 +705,7 @@ impl<'tcx> TypeckResults<'tcx> {
722705impl < ' a , ' tcx > HashStable < StableHashingContext < ' a > > for TypeckResults < ' tcx > {
723706 fn hash_stable ( & self , hcx : & mut StableHashingContext < ' a > , hasher : & mut StableHasher ) {
724707 let ty:: TypeckResults {
725- hir_owner,
708+ hir_owner : _ ,
726709 ref type_dependent_defs,
727710 ref field_indices,
728711 ref user_provided_types,
@@ -732,17 +715,13 @@ 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,
@@ -759,17 +738,6 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for TypeckResults<'tcx> {
759738 adjustments. hash_stable ( hcx, hasher) ;
760739 pat_binding_modes. hash_stable ( hcx, hasher) ;
761740 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- } ) ;
773741
774742 closure_kind_origins. hash_stable ( hcx, hasher) ;
775743 liberated_fn_sigs. hash_stable ( hcx, hasher) ;
@@ -778,7 +746,6 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for TypeckResults<'tcx> {
778746 used_trait_imports. hash_stable ( hcx, hasher) ;
779747 tainted_by_errors. hash_stable ( hcx, hasher) ;
780748 concrete_opaque_types. hash_stable ( hcx, hasher) ;
781- closure_captures. hash_stable ( hcx, hasher) ;
782749 closure_min_captures. hash_stable ( hcx, hasher) ;
783750 closure_fake_reads. hash_stable ( hcx, hasher) ;
784751 generator_interior_types. hash_stable ( hcx, hasher) ;
0 commit comments