1010// * `Spanned<MonoItem>` is returned in `AccessMap` instead of just `MonoItem`.
1111
1212use rustc_data_structures:: fx:: { FxHashMap , FxIndexMap } ;
13- use rustc_data_structures:: sync:: { MTLock , par_for_each_in} ;
13+ use rustc_data_structures:: sync:: { Lock , par_for_each_in} ;
1414use rustc_data_structures:: unord:: UnordSet ;
1515use rustc_hir as hir;
1616use rustc_hir:: attrs:: InlineAttr ;
@@ -91,12 +91,12 @@ fn custom_coerce_unsize_info<'tcx>(
9191/// The state that is shared across the concurrent threads that are doing collection.
9292struct SharedState < ' tcx > {
9393 /// Items that have been or are currently being recursively collected.
94- visited : MTLock < UnordSet < MonoItem < ' tcx > > > ,
94+ visited : Lock < UnordSet < MonoItem < ' tcx > > > ,
9595 /// Items that have been or are currently being recursively treated as "mentioned", i.e., their
9696 /// consts are evaluated but nothing is added to the collection.
97- mentioned : MTLock < UnordSet < MonoItem < ' tcx > > > ,
97+ mentioned : Lock < UnordSet < MonoItem < ' tcx > > > ,
9898 /// Which items are being used where, for better errors.
99- usage_map : MTLock < UsageMap < ' tcx > > ,
99+ usage_map : Lock < UsageMap < ' tcx > > ,
100100}
101101
102102#[ derive( PartialEq ) ]
@@ -197,7 +197,7 @@ fn collect_items_root<'tcx>(
197197 state : & SharedState < ' tcx > ,
198198 recursion_limit : Limit ,
199199) {
200- if !state. visited . lock_mut ( ) . insert ( starting_item. node ) {
200+ if !state. visited . lock ( ) . insert ( starting_item. node ) {
201201 // We've been here already, no need to search again.
202202 return ;
203203 }
@@ -398,7 +398,7 @@ fn collect_items_rec<'tcx>(
398398 if mode == CollectionMode :: UsedItems {
399399 state
400400 . usage_map
401- . lock_mut ( )
401+ . lock ( )
402402 . record_used ( starting_item. node , & used_items) ;
403403 }
404404
@@ -407,7 +407,7 @@ fn collect_items_rec<'tcx>(
407407 if mode == CollectionMode :: UsedItems {
408408 used_items. items . retain ( |k, _| {
409409 visited
410- . get_mut_or_init ( || state. visited . lock_mut ( ) )
410+ . get_mut_or_init ( || state. visited . lock ( ) )
411411 . insert ( * k)
412412 } ) ;
413413 }
@@ -416,7 +416,7 @@ fn collect_items_rec<'tcx>(
416416 mentioned_items. items . retain ( |k, _| {
417417 !visited. get_or_init ( || state. visited . lock ( ) ) . contains ( k)
418418 && mentioned
419- . get_mut_or_init ( || state. mentioned . lock_mut ( ) )
419+ . get_mut_or_init ( || state. mentioned . lock ( ) )
420420 . insert ( * k)
421421 } ) ;
422422 }
@@ -1605,9 +1605,9 @@ pub fn collect_crate_mono_items(
16051605 debug ! ( "building mono item graph, beginning at roots" ) ;
16061606
16071607 let state = SharedState {
1608- visited : MTLock :: new ( UnordSet :: default ( ) ) ,
1609- mentioned : MTLock :: new ( UnordSet :: default ( ) ) ,
1610- usage_map : MTLock :: new ( UsageMap :: new ( ) ) ,
1608+ visited : Lock :: new ( UnordSet :: default ( ) ) ,
1609+ mentioned : Lock :: new ( UnordSet :: default ( ) ) ,
1610+ usage_map : Lock :: new ( UsageMap :: new ( ) ) ,
16111611 } ;
16121612 let recursion_limit = tcx. recursion_limit ( ) ;
16131613
0 commit comments