2626
2727use std:: cell:: RefCell ;
2828use std:: collections:: hash_map:: Entry ;
29+ use std:: collections:: hash_set:: Entry as SetEntry ;
2930use std:: fmt;
3031use std:: hash:: Hash ;
3132
@@ -1270,7 +1271,7 @@ pub struct HygieneDecodeContext {
12701271 inner : Lock < HygieneDecodeContextInner > ,
12711272
12721273 /// 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 > > > ,
12741275}
12751276
12761277/// 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
13641365 match inner. decoding . entry ( raw_id) {
13651366 Entry :: Occupied ( ctxt_entry) => {
13661367 match context. local_in_progress . borrow_mut ( ) . entry ( raw_id) {
1367- Entry :: Occupied ( ..) => {
1368+ SetEntry :: Occupied ( ..) => {
13681369 // We're decoding this already on the current thread. Return here
13691370 // and let the function higher up the stack finish decoding to handle
13701371 // recursive cases.
13711372 return * ctxt_entry. get ( ) ;
13721373 }
1373- Entry :: Vacant ( entry) => {
1374- entry. insert ( ( ) ) ;
1374+ SetEntry :: Vacant ( entry) => {
1375+ entry. insert ( ) ;
13751376
13761377 // Some other thread is current decoding this. Race with it.
13771378 * ctxt_entry. get ( )
@@ -1380,7 +1381,7 @@ pub fn decode_syntax_context<D: Decoder, F: FnOnce(&mut D, u32) -> SyntaxContext
13801381 }
13811382 Entry :: Vacant ( entry) => {
13821383 // 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) ;
13841385
13851386 // Allocate and store SyntaxContext id *before* calling the decoder function,
13861387 // as the SyntaxContextData may reference itself.
0 commit comments