File tree 1 file changed +5
-4
lines changed
compiler/rustc_query_system/src/query
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,6 @@ use std::collections::hash_map::Entry;
25
25
use std:: fmt:: Debug ;
26
26
use std:: hash:: Hash ;
27
27
use std:: mem;
28
- use std:: ptr;
29
28
use thin_vec:: ThinVec ;
30
29
31
30
use super :: QueryConfig ;
@@ -250,13 +249,16 @@ where
250
249
where
251
250
C : QueryCache < Key = K > ,
252
251
{
253
- // We can move out of `self` here because we `mem::forget` it below
254
- let key = unsafe { ptr:: read ( & self . key ) } ;
252
+ let key = self . key ;
255
253
let state = self . state ;
256
254
257
255
// Forget ourself so our destructor won't poison the query
258
256
mem:: forget ( self ) ;
259
257
258
+ // Mark as complete before we remove the job from the active state
259
+ // so no other thread can re-execute this query.
260
+ cache. complete ( key, result, dep_node_index) ;
261
+
260
262
let job = {
261
263
#[ cfg( parallel_compiler) ]
262
264
let mut lock = state. active . get_shard_by_value ( & key) . lock ( ) ;
@@ -267,7 +269,6 @@ where
267
269
QueryResult :: Poisoned => panic ! ( ) ,
268
270
}
269
271
} ;
270
- cache. complete ( key, result, dep_node_index) ;
271
272
272
273
job. signal_complete ( ) ;
273
274
}
You can’t perform that action at this time.
0 commit comments