@@ -209,7 +209,7 @@ use std::path::PathBuf;
209209
210210use rustc_attr_parsing:: InlineAttr ;
211211use rustc_data_structures:: fx:: FxIndexMap ;
212- use rustc_data_structures:: sync:: { LRef , MTLock , par_for_each_in} ;
212+ use rustc_data_structures:: sync:: { MTLock , par_for_each_in} ;
213213use rustc_data_structures:: unord:: { UnordMap , UnordSet } ;
214214use rustc_hir as hir;
215215use rustc_hir:: def:: DefKind ;
@@ -357,7 +357,7 @@ impl<'tcx> Extend<Spanned<MonoItem<'tcx>>> for MonoItems<'tcx> {
357357fn collect_items_rec < ' tcx > (
358358 tcx : TyCtxt < ' tcx > ,
359359 starting_item : Spanned < MonoItem < ' tcx > > ,
360- state : LRef < ' _ , SharedState < ' tcx > > ,
360+ state : & SharedState < ' tcx > ,
361361 recursion_depths : & mut DefIdMap < usize > ,
362362 recursion_limit : Limit ,
363363 mode : CollectionMode ,
@@ -1671,30 +1671,26 @@ pub(crate) fn collect_crate_mono_items<'tcx>(
16711671
16721672 debug ! ( "building mono item graph, beginning at roots" ) ;
16731673
1674- let mut state = SharedState {
1674+ let state = SharedState {
16751675 visited : MTLock :: new ( UnordSet :: default ( ) ) ,
16761676 mentioned : MTLock :: new ( UnordSet :: default ( ) ) ,
16771677 usage_map : MTLock :: new ( UsageMap :: new ( ) ) ,
16781678 } ;
16791679 let recursion_limit = tcx. recursion_limit ( ) ;
16801680
1681- {
1682- let state: LRef < ' _ , _ > = & mut state;
1683-
1684- tcx. sess . time ( "monomorphization_collector_graph_walk" , || {
1685- par_for_each_in ( roots, |root| {
1686- let mut recursion_depths = DefIdMap :: default ( ) ;
1687- collect_items_rec (
1688- tcx,
1689- dummy_spanned ( root) ,
1690- state,
1691- & mut recursion_depths,
1692- recursion_limit,
1693- CollectionMode :: UsedItems ,
1694- ) ;
1695- } ) ;
1681+ tcx. sess . time ( "monomorphization_collector_graph_walk" , || {
1682+ par_for_each_in ( roots, |root| {
1683+ let mut recursion_depths = DefIdMap :: default ( ) ;
1684+ collect_items_rec (
1685+ tcx,
1686+ dummy_spanned ( root) ,
1687+ & state,
1688+ & mut recursion_depths,
1689+ recursion_limit,
1690+ CollectionMode :: UsedItems ,
1691+ ) ;
16961692 } ) ;
1697- }
1693+ } ) ;
16981694
16991695 // The set of MonoItems was created in an inherently indeterministic order because
17001696 // of parallelism. We sort it here to ensure that the output is deterministic.
0 commit comments