File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
compiler/rustc_query_system/src/dep_graph Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -204,6 +204,8 @@ impl SerializedDepGraph {
204204 . map ( |& n| UnhashMap :: with_capacity_and_hasher ( n, Default :: default ( ) ) )
205205 . collect ( ) ;
206206
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.
207209 for ( idx, node) in self . nodes . iter_enumerated ( ) {
208210 index[ node. kind . as_usize ( ) ] . insert ( node. hash , idx) ;
209211 }
@@ -220,7 +222,9 @@ impl SerializedDepGraph {
220222 let client = jobserver:: client ( ) ;
221223 // This should ideally use `try_acquire` to avoid races on the tokens,
222224 // 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+ {
224228 let this = self . clone ( ) ;
225229 thread:: spawn ( move || {
226230 let _token = client. acquire ( ) ;
You can’t perform that action at this time.
0 commit comments