diff options
| author | Miguel Guarniz <mi9uel9@gmail.com> | 2022-05-07 14:45:30 -0400 |
|---|---|---|
| committer | Miguel Guarniz <mi9uel9@gmail.com> | 2022-05-13 11:46:06 -0400 |
| commit | cdba1dcef65545b2634e3bf53b358de789f23675 (patch) | |
| tree | 91d0831abdb0e6a2e02f34ed89cb483298a1bc53 | |
| parent | e166409f0d1560a7172cac6ee457391a1f3a4e77 (diff) | |
| download | rust-cdba1dcef65545b2634e3bf53b358de789f23675.tar.gz rust-cdba1dcef65545b2634e3bf53b358de789f23675.zip | |
add module_items
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
| -rw-r--r-- | compiler/rustc_middle/src/hir/map/mod.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/hir/map/mod.rs b/compiler/rustc_middle/src/hir/map/mod.rs index 20c8b0bb70f..b1de4b8289a 100644 --- a/compiler/rustc_middle/src/hir/map/mod.rs +++ b/compiler/rustc_middle/src/hir/map/mod.rs @@ -161,6 +161,10 @@ impl<'hir> Map<'hir> { self.tcx.hir_crate_items(()).items.iter().copied() } + pub fn module_items(self, module: LocalDefId) -> impl Iterator<Item = ItemId> + 'hir { + self.tcx.hir_module_items(module).items() + } + pub fn par_for_each_item(self, f: impl Fn(ItemId) + Sync + Send) { par_for_each_in(&self.tcx.hir_crate_items(()).items[..], |id| f(*id)); } |
