26
26
27
27
use std:: cell:: RefCell ;
28
28
use std:: collections:: hash_map:: Entry ;
29
+ use std:: collections:: hash_set:: Entry as SetEntry ;
29
30
use std:: fmt;
30
31
use std:: hash:: Hash ;
31
32
@@ -1270,7 +1271,7 @@ pub struct HygieneDecodeContext {
1270
1271
inner : Lock < HygieneDecodeContextInner > ,
1271
1272
1272
1273
/// A set of serialized `SyntaxContext` ids that are currently being decoded on each thread.
1273
- local_in_progress : WorkerLocal < RefCell < FxHashMap < u32 , ( ) > > > ,
1274
+ local_in_progress : WorkerLocal < RefCell < FxHashSet < u32 > > > ,
1274
1275
}
1275
1276
1276
1277
/// Register an expansion which has been decoded from the on-disk-cache for the local crate.
@@ -1364,14 +1365,14 @@ pub fn decode_syntax_context<D: Decoder, F: FnOnce(&mut D, u32) -> SyntaxContext
1364
1365
match inner. decoding . entry ( raw_id) {
1365
1366
Entry :: Occupied ( ctxt_entry) => {
1366
1367
match context. local_in_progress . borrow_mut ( ) . entry ( raw_id) {
1367
- Entry :: Occupied ( ..) => {
1368
+ SetEntry :: Occupied ( ..) => {
1368
1369
// We're decoding this already on the current thread. Return here
1369
1370
// and let the function higher up the stack finish decoding to handle
1370
1371
// recursive cases.
1371
1372
return * ctxt_entry. get ( ) ;
1372
1373
}
1373
- Entry :: Vacant ( entry) => {
1374
- entry. insert ( ( ) ) ;
1374
+ SetEntry :: Vacant ( entry) => {
1375
+ entry. insert ( ) ;
1375
1376
1376
1377
// Some other thread is current decoding this. Race with it.
1377
1378
* ctxt_entry. get ( )
@@ -1380,7 +1381,7 @@ pub fn decode_syntax_context<D: Decoder, F: FnOnce(&mut D, u32) -> SyntaxContext
1380
1381
}
1381
1382
Entry :: Vacant ( entry) => {
1382
1383
// We are the first thread to start decoding. Mark the current thread as being progress.
1383
- context. local_in_progress . borrow_mut ( ) . insert ( raw_id, ( ) ) ;
1384
+ context. local_in_progress . borrow_mut ( ) . insert ( raw_id) ;
1384
1385
1385
1386
// Allocate and store SyntaxContext id *before* calling the decoder function,
1386
1387
// as the SyntaxContextData may reference itself.
0 commit comments