Skip to content

add parallelized method to apply function to each item in module #97998

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions compiler/rustc_middle/src/hir/map/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ impl<'hir> Map<'hir> {
par_for_each_in(&self.tcx.hir_crate_items(()).items[..], |id| f(*id));
}

pub fn par_for_each_item_in_module(self, module: LocalDefId, f: impl Fn(ItemId) + Sync + Send) {
par_for_each_in(&self.tcx.hir_module_items(module).items[..], |id| f(*id));
}

pub fn def_key(self, def_id: LocalDefId) -> DefKey {
// Accessing the DefKey is ok, since it is part of DefPathHash.
self.tcx.untracked_resolutions.definitions.def_key(def_id)
Expand Down