File tree 1 file changed +5
-1
lines changed
compiler/rustc_query_system/src/dep_graph
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -204,6 +204,8 @@ impl SerializedDepGraph {
204
204
. map ( |& n| UnhashMap :: with_capacity_and_hasher ( n, Default :: default ( ) ) )
205
205
. collect ( ) ;
206
206
207
+ // Use a single loop to build indices for all kinds, unlike `setup_index` which builds
208
+ // a single index for each loop over the nodes.
207
209
for ( idx, node) in self . nodes . iter_enumerated ( ) {
208
210
index[ node. kind . as_usize ( ) ] . insert ( node. hash , idx) ;
209
211
}
@@ -220,7 +222,9 @@ impl SerializedDepGraph {
220
222
let client = jobserver:: client ( ) ;
221
223
// This should ideally use `try_acquire` to avoid races on the tokens,
222
224
// but the jobserver crate doesn't support that operation.
223
- if let Ok ( true ) = client. available ( ) . map ( |tokens| tokens > 0 ) {
225
+ if let Ok ( tokens) = client. available ( )
226
+ && tokens > 0
227
+ {
224
228
let this = self . clone ( ) ;
225
229
thread:: spawn ( move || {
226
230
let _token = client. acquire ( ) ;
You can’t perform that action at this time.
0 commit comments