@@ -30,9 +30,7 @@ use rustc_attr as attr;
30
30
use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
31
31
use rustc_data_structures:: profiling:: SelfProfilerRef ;
32
32
use 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 } ;
36
34
use rustc_data_structures:: steal:: Steal ;
37
35
use rustc_data_structures:: sync:: { self , Lock , Lrc , WorkerLocal } ;
38
36
use rustc_errors:: ErrorReported ;
@@ -386,9 +384,6 @@ pub struct TypeckResults<'tcx> {
386
384
/// <https://github.com/rust-lang/rfcs/blob/master/text/2005-match-ergonomics.md#definitions>
387
385
pat_adjustments : ItemLocalMap < Vec < Ty < ' tcx > > > ,
388
386
389
- /// Borrows
390
- pub upvar_capture_map : ty:: UpvarCaptureMap < ' tcx > ,
391
-
392
387
/// Records the reasons that we picked the kind of each closure;
393
388
/// not all closures are present in the map.
394
389
closure_kind_origins : ItemLocalMap < ( Span , HirPlace < ' tcx > ) > ,
@@ -424,12 +419,6 @@ pub struct TypeckResults<'tcx> {
424
419
/// by this function.
425
420
pub concrete_opaque_types : FxHashMap < DefId , ResolvedOpaqueTy < ' tcx > > ,
426
421
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
-
433
422
/// Tracks the minimum captures required for a closure;
434
423
/// see `MinCaptureInformationMap` for more details.
435
424
pub closure_min_captures : ty:: MinCaptureInformationMap < ' tcx > ,
@@ -482,15 +471,13 @@ impl<'tcx> TypeckResults<'tcx> {
482
471
adjustments : Default :: default ( ) ,
483
472
pat_binding_modes : Default :: default ( ) ,
484
473
pat_adjustments : Default :: default ( ) ,
485
- upvar_capture_map : Default :: default ( ) ,
486
474
closure_kind_origins : Default :: default ( ) ,
487
475
liberated_fn_sigs : Default :: default ( ) ,
488
476
fru_field_types : Default :: default ( ) ,
489
477
coercion_casts : Default :: default ( ) ,
490
478
used_trait_imports : Lrc :: new ( Default :: default ( ) ) ,
491
479
tainted_by_errors : None ,
492
480
concrete_opaque_types : Default :: default ( ) ,
493
- closure_captures : Default :: default ( ) ,
494
481
closure_min_captures : Default :: default ( ) ,
495
482
closure_fake_reads : Default :: default ( ) ,
496
483
generator_interior_types : ty:: Binder :: dummy ( Default :: default ( ) ) ,
@@ -675,10 +662,6 @@ impl<'tcx> TypeckResults<'tcx> {
675
662
. flatten ( )
676
663
}
677
664
678
- pub fn upvar_capture ( & self , upvar_id : ty:: UpvarId ) -> ty:: UpvarCapture < ' tcx > {
679
- self . upvar_capture_map [ & upvar_id]
680
- }
681
-
682
665
pub fn closure_kind_origins ( & self ) -> LocalTableInContext < ' _ , ( Span , HirPlace < ' tcx > ) > {
683
666
LocalTableInContext { hir_owner : self . hir_owner , data : & self . closure_kind_origins }
684
667
}
@@ -732,24 +715,22 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for TypeckResults<'tcx> {
732
715
ref adjustments,
733
716
ref pat_binding_modes,
734
717
ref pat_adjustments,
735
- ref upvar_capture_map,
736
718
ref closure_kind_origins,
737
719
ref liberated_fn_sigs,
738
720
ref fru_field_types,
739
-
740
721
ref coercion_casts,
741
-
742
722
ref used_trait_imports,
743
723
tainted_by_errors,
744
724
ref concrete_opaque_types,
745
- ref closure_captures,
746
725
ref closure_min_captures,
747
726
ref closure_fake_reads,
748
727
ref generator_interior_types,
749
728
ref treat_byte_string_as_slice,
750
729
} = * self ;
751
730
752
731
hcx. with_node_id_hashing_mode ( NodeIdHashingMode :: HashDefPath , |hcx| {
732
+ hcx. local_def_path_hash ( hir_owner) ;
733
+
753
734
type_dependent_defs. hash_stable ( hcx, hasher) ;
754
735
field_indices. hash_stable ( hcx, hasher) ;
755
736
user_provided_types. hash_stable ( hcx, hasher) ;
@@ -759,17 +740,6 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for TypeckResults<'tcx> {
759
740
adjustments. hash_stable ( hcx, hasher) ;
760
741
pat_binding_modes. hash_stable ( hcx, hasher) ;
761
742
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
- } ) ;
773
743
774
744
closure_kind_origins. hash_stable ( hcx, hasher) ;
775
745
liberated_fn_sigs. hash_stable ( hcx, hasher) ;
@@ -778,7 +748,6 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for TypeckResults<'tcx> {
778
748
used_trait_imports. hash_stable ( hcx, hasher) ;
779
749
tainted_by_errors. hash_stable ( hcx, hasher) ;
780
750
concrete_opaque_types. hash_stable ( hcx, hasher) ;
781
- closure_captures. hash_stable ( hcx, hasher) ;
782
751
closure_min_captures. hash_stable ( hcx, hasher) ;
783
752
closure_fake_reads. hash_stable ( hcx, hasher) ;
784
753
generator_interior_types. hash_stable ( hcx, hasher) ;
0 commit comments