Skip to content

Commit e64dada

Browse files
committed
add parallelized method to apply function to each item in module
Signed-off-by: Miguel Guarniz <[email protected]>
1 parent fa68e73 commit e64dada

File tree

1 file changed

+4
-0
lines changed
  • compiler/rustc_middle/src/hir/map

1 file changed

+4
-0
lines changed

compiler/rustc_middle/src/hir/map/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,10 @@ impl<'hir> Map<'hir> {
168168
par_for_each_in(&self.tcx.hir_crate_items(()).items[..], |id| f(*id));
169169
}
170170

171+
pub fn par_for_each_item_in_module(self, module: LocalDefId, f: impl Fn(ItemId) + Sync + Send) {
172+
par_for_each_in(&self.tcx.hir_module_items(module).items[..], |id| f(*id));
173+
}
174+
171175
pub fn def_key(self, def_id: LocalDefId) -> DefKey {
172176
// Accessing the DefKey is ok, since it is part of DefPathHash.
173177
self.tcx.untracked_resolutions.definitions.def_key(def_id)

0 commit comments

Comments
 (0)