diff options
| author | bors <bors@rust-lang.org> | 2022-04-17 08:06:53 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-04-17 08:06:53 +0000 |
| commit | edba28277038f24ee80b88b66e054ec33facefa4 (patch) | |
| tree | 66aa0b39634acf3f80162389109c7d01e741f6e3 /compiler/rustc_middle/src/query | |
| parent | ac8b11810f4a0def3596ee401feb9ef00015b555 (diff) | |
| parent | 88108bd5d9832a9286b899dc7c8916a9bd104711 (diff) | |
| download | rust-edba28277038f24ee80b88b66e054ec33facefa4.tar.gz rust-edba28277038f24ee80b88b66e054ec33facefa4.zip | |
Auto merge of #95655 - kckeiks:create-hir-crate-items-query, r=cjgillot
Refactor HIR item-like traversal (part 1) Issue #95004 - Create hir_crate_items query which traverses tcx.hir_crate(()).owners to return a hir::ModuleItems - use tcx.hir_crate_items in tcx.hir().items() to return an iterator of hir::ItemId - use tcx.hir_crate_items to introduce a tcx.hir().par_items(impl Fn(hir::ItemId)) to traverse all items in parallel; Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com> cc `@cjgillot`
Diffstat (limited to 'compiler/rustc_middle/src/query')
| -rw-r--r-- | compiler/rustc_middle/src/query/mod.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs index f38ade1076e..999cb9f30b8 100644 --- a/compiler/rustc_middle/src/query/mod.rs +++ b/compiler/rustc_middle/src/query/mod.rs @@ -45,6 +45,13 @@ rustc_queries! { desc { "get the crate HIR" } } + /// All items in the crate. + query hir_crate_items(_: ()) -> rustc_middle::hir::ModuleItems { + storage(ArenaCacheSelector<'tcx>) + eval_always + desc { "get HIR crate items" } + } + /// The items in a module. /// /// This can be conveniently accessed by `tcx.hir().visit_item_likes_in_module`. |
