@@ -3,7 +3,6 @@ use rustc_data_structures::fx::{FxHashMap, FxHashSet};
33use rustc_data_structures:: profiling:: { QueryInvocationId , SelfProfilerRef } ;
44use rustc_data_structures:: sharded:: { self , Sharded } ;
55use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher } ;
6- use rustc_data_structures:: steal:: Steal ;
76use rustc_data_structures:: sync:: { AtomicU32 , AtomicU64 , Lock , Lrc } ;
87use rustc_data_structures:: unord:: UnordMap ;
98use rustc_index:: IndexVec ;
@@ -194,7 +193,7 @@ impl<D: Deps> DepGraph<D> {
194193
195194 pub fn with_query ( & self , f : impl Fn ( & DepGraphQuery ) ) {
196195 if let Some ( data) = & self . data {
197- data. current . encoder . borrow ( ) . with_query ( f)
196+ data. current . encoder . with_query ( f)
198197 }
199198 }
200199
@@ -954,15 +953,15 @@ impl<D: Deps> DepGraph<D> {
954953
955954 pub fn print_incremental_info ( & self ) {
956955 if let Some ( data) = & self . data {
957- data. current . encoder . borrow ( ) . print_incremental_info (
956+ data. current . encoder . print_incremental_info (
958957 data. current . total_read_count . load ( Ordering :: Relaxed ) ,
959958 data. current . total_duplicate_read_count . load ( Ordering :: Relaxed ) ,
960959 )
961960 }
962961 }
963962
964963 pub fn finish_encoding ( & self ) -> FileEncodeResult {
965- if let Some ( data) = & self . data { data. current . encoder . steal ( ) . finish ( ) } else { Ok ( 0 ) }
964+ if let Some ( data) = & self . data { data. current . encoder . finish ( ) } else { Ok ( 0 ) }
966965 }
967966
968967 pub ( crate ) fn next_virtual_depnode_index ( & self ) -> DepNodeIndex {
@@ -1045,7 +1044,7 @@ rustc_index::newtype_index! {
10451044/// manipulating both, we acquire `new_node_to_index` or `prev_index_to_index`
10461045/// first, and `data` second.
10471046pub ( super ) struct CurrentDepGraph < D : Deps > {
1048- encoder : Steal < GraphEncoder < D > > ,
1047+ encoder : GraphEncoder < D > ,
10491048 new_node_to_index : Sharded < FxHashMap < DepNode , DepNodeIndex > > ,
10501049 prev_index_to_index : Lock < IndexVec < SerializedDepNodeIndex , Option < DepNodeIndex > > > ,
10511050
@@ -1111,13 +1110,13 @@ impl<D: Deps> CurrentDepGraph<D> {
11111110 let new_node_count_estimate = 102 * prev_graph_node_count / 100 + 200 ;
11121111
11131112 CurrentDepGraph {
1114- encoder : Steal :: new ( GraphEncoder :: new (
1113+ encoder : GraphEncoder :: new (
11151114 encoder,
11161115 prev_graph_node_count,
11171116 record_graph,
11181117 record_stats,
11191118 profiler,
1120- ) ) ,
1119+ ) ,
11211120 new_node_to_index : Sharded :: new ( || {
11221121 FxHashMap :: with_capacity_and_hasher (
11231122 new_node_count_estimate / sharded:: shards ( ) ,
@@ -1156,7 +1155,7 @@ impl<D: Deps> CurrentDepGraph<D> {
11561155 let dep_node_index = match self . new_node_to_index . lock_shard_by_value ( & key) . entry ( key) {
11571156 Entry :: Occupied ( entry) => * entry. get ( ) ,
11581157 Entry :: Vacant ( entry) => {
1159- let dep_node_index = self . encoder . borrow ( ) . send ( key, current_fingerprint, edges) ;
1158+ let dep_node_index = self . encoder . send ( key, current_fingerprint, edges) ;
11601159 entry. insert ( dep_node_index) ;
11611160 dep_node_index
11621161 }
@@ -1182,7 +1181,7 @@ impl<D: Deps> CurrentDepGraph<D> {
11821181 let dep_node_index = match prev_index_to_index[ prev_index] {
11831182 Some ( dep_node_index) => dep_node_index,
11841183 None => {
1185- let dep_node_index = self . encoder . borrow ( ) . send ( key, fingerprint, edges) ;
1184+ let dep_node_index = self . encoder . send ( key, fingerprint, edges) ;
11861185 prev_index_to_index[ prev_index] = Some ( dep_node_index) ;
11871186 dep_node_index
11881187 }
@@ -1243,7 +1242,7 @@ impl<D: Deps> CurrentDepGraph<D> {
12431242 . map ( |i| prev_index_to_index[ i] . unwrap ( ) )
12441243 . collect ( ) ;
12451244 let fingerprint = prev_graph. fingerprint_by_index ( prev_index) ;
1246- let dep_node_index = self . encoder . borrow ( ) . send ( key, fingerprint, edges) ;
1245+ let dep_node_index = self . encoder . send ( key, fingerprint, edges) ;
12471246 prev_index_to_index[ prev_index] = Some ( dep_node_index) ;
12481247 #[ cfg( debug_assertions) ]
12491248 self . record_edge ( dep_node_index, key, fingerprint) ;
0 commit comments