@@ -209,7 +209,7 @@ use std::cell::OnceCell;
209209use std:: ops:: ControlFlow ;
210210
211211use rustc_data_structures:: fx:: FxIndexMap ;
212- use rustc_data_structures:: sync:: { MTLock , par_for_each_in} ;
212+ use rustc_data_structures:: sync:: { Lock , par_for_each_in} ;
213213use rustc_data_structures:: unord:: { UnordMap , UnordSet } ;
214214use rustc_hir as hir;
215215use rustc_hir:: attrs:: InlineAttr ;
@@ -251,12 +251,12 @@ pub(crate) enum MonoItemCollectionStrategy {
251251/// The state that is shared across the concurrent threads that are doing collection.
252252struct SharedState < ' tcx > {
253253 /// Items that have been or are currently being recursively collected.
254- visited : MTLock < UnordSet < MonoItem < ' tcx > > > ,
254+ visited : Lock < UnordSet < MonoItem < ' tcx > > > ,
255255 /// Items that have been or are currently being recursively treated as "mentioned", i.e., their
256256 /// consts are evaluated but nothing is added to the collection.
257- mentioned : MTLock < UnordSet < MonoItem < ' tcx > > > ,
257+ mentioned : Lock < UnordSet < MonoItem < ' tcx > > > ,
258258 /// Which items are being used where, for better errors.
259- usage_map : MTLock < UsageMap < ' tcx > > ,
259+ usage_map : Lock < UsageMap < ' tcx > > ,
260260}
261261
262262pub ( crate ) struct UsageMap < ' tcx > {
@@ -359,7 +359,7 @@ fn collect_items_root<'tcx>(
359359 state : & SharedState < ' tcx > ,
360360 recursion_limit : Limit ,
361361) {
362- if !state. visited . lock_mut ( ) . insert ( starting_item. node ) {
362+ if !state. visited . lock ( ) . insert ( starting_item. node ) {
363363 // We've been here already, no need to search again.
364364 return ;
365365 }
@@ -568,21 +568,21 @@ fn collect_items_rec<'tcx>(
568568 // This is part of the output of collection and hence only relevant for "used" items.
569569 // ("Mentioned" items are only considered internally during collection.)
570570 if mode == CollectionMode :: UsedItems {
571- state. usage_map . lock_mut ( ) . record_used ( starting_item. node , & used_items) ;
571+ state. usage_map . lock ( ) . record_used ( starting_item. node , & used_items) ;
572572 }
573573
574574 {
575575 let mut visited = OnceCell :: default ( ) ;
576576 if mode == CollectionMode :: UsedItems {
577577 used_items
578578 . items
579- . retain ( |k, _| visited. get_mut_or_init ( || state. visited . lock_mut ( ) ) . insert ( * k) ) ;
579+ . retain ( |k, _| visited. get_mut_or_init ( || state. visited . lock ( ) ) . insert ( * k) ) ;
580580 }
581581
582582 let mut mentioned = OnceCell :: default ( ) ;
583583 mentioned_items. items . retain ( |k, _| {
584584 !visited. get_or_init ( || state. visited . lock ( ) ) . contains ( k)
585- && mentioned. get_mut_or_init ( || state. mentioned . lock_mut ( ) ) . insert ( * k)
585+ && mentioned. get_mut_or_init ( || state. mentioned . lock ( ) ) . insert ( * k)
586586 } ) ;
587587 }
588588 if mode == CollectionMode :: MentionedItems {
@@ -1810,9 +1810,9 @@ pub(crate) fn collect_crate_mono_items<'tcx>(
18101810 debug ! ( "building mono item graph, beginning at roots" ) ;
18111811
18121812 let state = SharedState {
1813- visited : MTLock :: new ( UnordSet :: default ( ) ) ,
1814- mentioned : MTLock :: new ( UnordSet :: default ( ) ) ,
1815- usage_map : MTLock :: new ( UsageMap :: new ( ) ) ,
1813+ visited : Lock :: new ( UnordSet :: default ( ) ) ,
1814+ mentioned : Lock :: new ( UnordSet :: default ( ) ) ,
1815+ usage_map : Lock :: new ( UsageMap :: new ( ) ) ,
18161816 } ;
18171817 let recursion_limit = tcx. recursion_limit ( ) ;
18181818
0 commit comments