@@ -3,7 +3,6 @@ use rustc_data_structures::fx::{FxHashMap, FxHashSet};
3
3
use rustc_data_structures:: profiling:: { QueryInvocationId , SelfProfilerRef } ;
4
4
use rustc_data_structures:: sharded:: { self , Sharded } ;
5
5
use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher } ;
6
- use rustc_data_structures:: steal:: Steal ;
7
6
use rustc_data_structures:: sync:: { AtomicU32 , AtomicU64 , Lock , Lrc } ;
8
7
use rustc_data_structures:: unord:: UnordMap ;
9
8
use rustc_index:: IndexVec ;
@@ -194,7 +193,7 @@ impl<D: Deps> DepGraph<D> {
194
193
195
194
pub fn with_query ( & self , f : impl Fn ( & DepGraphQuery ) ) {
196
195
if let Some ( data) = & self . data {
197
- data. current . encoder . borrow ( ) . with_query ( f)
196
+ data. current . encoder . with_query ( f)
198
197
}
199
198
}
200
199
@@ -954,15 +953,15 @@ impl<D: Deps> DepGraph<D> {
954
953
955
954
pub fn print_incremental_info ( & self ) {
956
955
if let Some ( data) = & self . data {
957
- data. current . encoder . borrow ( ) . print_incremental_info (
956
+ data. current . encoder . print_incremental_info (
958
957
data. current . total_read_count . load ( Ordering :: Relaxed ) ,
959
958
data. current . total_duplicate_read_count . load ( Ordering :: Relaxed ) ,
960
959
)
961
960
}
962
961
}
963
962
964
963
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 ) }
966
965
}
967
966
968
967
pub ( crate ) fn next_virtual_depnode_index ( & self ) -> DepNodeIndex {
@@ -1045,7 +1044,7 @@ rustc_index::newtype_index! {
1045
1044
/// manipulating both, we acquire `new_node_to_index` or `prev_index_to_index`
1046
1045
/// first, and `data` second.
1047
1046
pub ( super ) struct CurrentDepGraph < D : Deps > {
1048
- encoder : Steal < GraphEncoder < D > > ,
1047
+ encoder : GraphEncoder < D > ,
1049
1048
new_node_to_index : Sharded < FxHashMap < DepNode , DepNodeIndex > > ,
1050
1049
prev_index_to_index : Lock < IndexVec < SerializedDepNodeIndex , Option < DepNodeIndex > > > ,
1051
1050
@@ -1111,13 +1110,13 @@ impl<D: Deps> CurrentDepGraph<D> {
1111
1110
let new_node_count_estimate = 102 * prev_graph_node_count / 100 + 200 ;
1112
1111
1113
1112
CurrentDepGraph {
1114
- encoder : Steal :: new ( GraphEncoder :: new (
1113
+ encoder : GraphEncoder :: new (
1115
1114
encoder,
1116
1115
prev_graph_node_count,
1117
1116
record_graph,
1118
1117
record_stats,
1119
1118
profiler,
1120
- ) ) ,
1119
+ ) ,
1121
1120
new_node_to_index : Sharded :: new ( || {
1122
1121
FxHashMap :: with_capacity_and_hasher (
1123
1122
new_node_count_estimate / sharded:: shards ( ) ,
@@ -1156,7 +1155,7 @@ impl<D: Deps> CurrentDepGraph<D> {
1156
1155
let dep_node_index = match self . new_node_to_index . lock_shard_by_value ( & key) . entry ( key) {
1157
1156
Entry :: Occupied ( entry) => * entry. get ( ) ,
1158
1157
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) ;
1160
1159
entry. insert ( dep_node_index) ;
1161
1160
dep_node_index
1162
1161
}
@@ -1182,7 +1181,7 @@ impl<D: Deps> CurrentDepGraph<D> {
1182
1181
let dep_node_index = match prev_index_to_index[ prev_index] {
1183
1182
Some ( dep_node_index) => dep_node_index,
1184
1183
None => {
1185
- let dep_node_index = self . encoder . borrow ( ) . send ( key, fingerprint, edges) ;
1184
+ let dep_node_index = self . encoder . send ( key, fingerprint, edges) ;
1186
1185
prev_index_to_index[ prev_index] = Some ( dep_node_index) ;
1187
1186
dep_node_index
1188
1187
}
@@ -1243,7 +1242,7 @@ impl<D: Deps> CurrentDepGraph<D> {
1243
1242
. map ( |i| prev_index_to_index[ i] . unwrap ( ) )
1244
1243
. collect ( ) ;
1245
1244
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) ;
1247
1246
prev_index_to_index[ prev_index] = Some ( dep_node_index) ;
1248
1247
#[ cfg( debug_assertions) ]
1249
1248
self . record_edge ( dep_node_index, key, fingerprint) ;
0 commit comments