diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-03-30 10:57:44 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-03-30 21:14:37 +1100 |
| commit | eeb5b782a613b37c13bfd39588a3e3ae6dcf0ff5 (patch) | |
| tree | 6183c6c463b1dc50e659670f8d01141ea9c6443e /compiler/rustc_monomorphize/src | |
| parent | 478cbb42b730ba4739351b72ce2aa928e78e2f81 (diff) | |
| download | rust-eeb5b782a613b37c13bfd39588a3e3ae6dcf0ff5.tar.gz rust-eeb5b782a613b37c13bfd39588a3e3ae6dcf0ff5.zip | |
Improve the `rustc_data_structures::sync` module doc comment.
Also, `MTRef<'a, T>` is a typedef for a reference to a `T`, but in practice it's only used (and useful) in combination with `MTLock`, i.e. `MTRef<'a, MTLock<T>>`. So this commit changes it to be a typedef for a reference to an `MTLock<T>`, and renames it as `MTLockRef`. I think this clarifies things, because I found `MTRef` quite puzzling at first.
Diffstat (limited to 'compiler/rustc_monomorphize/src')
| -rw-r--r-- | compiler/rustc_monomorphize/src/collector.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_monomorphize/src/collector.rs b/compiler/rustc_monomorphize/src/collector.rs index 98265d58a0a..e24d31c43d3 100644 --- a/compiler/rustc_monomorphize/src/collector.rs +++ b/compiler/rustc_monomorphize/src/collector.rs @@ -174,7 +174,7 @@ //! regardless of whether it is actually needed or not. use rustc_data_structures::fx::{FxHashMap, FxHashSet}; -use rustc_data_structures::sync::{par_for_each_in, MTLock, MTRef}; +use rustc_data_structures::sync::{par_for_each_in, MTLock, MTLockRef}; use rustc_hir as hir; use rustc_hir::def::DefKind; use rustc_hir::def_id::{DefId, DefIdMap, LocalDefId}; @@ -340,8 +340,8 @@ pub fn collect_crate_mono_items( let recursion_limit = tcx.recursion_limit(); { - let visited: MTRef<'_, _> = &mut visited; - let inlining_map: MTRef<'_, _> = &mut inlining_map; + let visited: MTLockRef<'_, _> = &mut visited; + let inlining_map: MTLockRef<'_, _> = &mut inlining_map; tcx.sess.time("monomorphization_collector_graph_walk", || { par_for_each_in(roots, |root| { @@ -406,10 +406,10 @@ fn collect_roots(tcx: TyCtxt<'_>, mode: MonoItemCollectionMode) -> Vec<MonoItem< fn collect_items_rec<'tcx>( tcx: TyCtxt<'tcx>, starting_point: Spanned<MonoItem<'tcx>>, - visited: MTRef<'_, MTLock<FxHashSet<MonoItem<'tcx>>>>, + visited: MTLockRef<'_, FxHashSet<MonoItem<'tcx>>>, recursion_depths: &mut DefIdMap<usize>, recursion_limit: Limit, - inlining_map: MTRef<'_, MTLock<InliningMap<'tcx>>>, + inlining_map: MTLockRef<'_, InliningMap<'tcx>>, ) { if !visited.lock_mut().insert(starting_point.node) { // We've been here already, no need to search again. |
