Skip to content

Commit cdba1dc

Browse files
committed
add module_items
Signed-off-by: Miguel Guarniz <[email protected]>
1 parent e166409 commit cdba1dc

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@ impl<'hir> Map<'hir> {
161161
self.tcx.hir_crate_items(()).items.iter().copied()
162162
}
163163

164+
pub fn module_items(self, module: LocalDefId) -> impl Iterator<Item = ItemId> + 'hir {
165+
self.tcx.hir_module_items(module).items()
166+
}
167+
164168
pub fn par_for_each_item(self, f: impl Fn(ItemId) + Sync + Send) {
165169
par_for_each_in(&self.tcx.hir_crate_items(()).items[..], |id| f(*id));
166170
}

0 commit comments

Comments
 (0)