diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2023-04-19 16:27:31 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2023-04-19 16:35:08 +0300 |
| commit | 53c71b6ab3f85095789e129d2616ac95c1eff98d (patch) | |
| tree | 0ce8facb8acfccfd6c46f77a4310cf0d36564c84 | |
| parent | d7f9e81650dcee3e2d5ad1973a71da644a2eff93 (diff) | |
| download | rust-53c71b6ab3f85095789e129d2616ac95c1eff98d.tar.gz rust-53c71b6ab3f85095789e129d2616ac95c1eff98d.zip | |
resolve: Remove `module_children_untracked`
| -rw-r--r-- | compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs | 8 | ||||
| -rw-r--r-- | compiler/rustc_resolve/src/build_reduced_graph.rs | 9 |
2 files changed, 3 insertions, 14 deletions
diff --git a/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs b/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs index 31798afb852..be82d6b1811 100644 --- a/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs +++ b/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs @@ -516,14 +516,6 @@ impl CStore { self.get_crate_data(def.krate).get_ctor(def.index) } - pub fn module_children_untracked<'a>( - &'a self, - def_id: DefId, - sess: &'a Session, - ) -> impl Iterator<Item = ModChild> + 'a { - self.get_crate_data(def_id.krate).get_module_children(def_id.index, sess) - } - pub fn load_macro_untracked(&self, id: DefId, sess: &Session) -> LoadedMacro { let _prof_timer = sess.prof.generic_activity("metadata_load_macro"); diff --git a/compiler/rustc_resolve/src/build_reduced_graph.rs b/compiler/rustc_resolve/src/build_reduced_graph.rs index f905cec1011..967c9e22fb2 100644 --- a/compiler/rustc_resolve/src/build_reduced_graph.rs +++ b/compiler/rustc_resolve/src/build_reduced_graph.rs @@ -197,10 +197,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { } pub(crate) fn build_reduced_graph_external(&mut self, module: Module<'a>) { - // Query `module_children` is not used because hashing spans in its result is expensive. - let children = - Vec::from_iter(self.cstore().module_children_untracked(module.def_id(), self.tcx.sess)); - for child in children { + for child in self.tcx.module_children(module.def_id()) { let parent_scope = ParentScope::module(module, self); BuildReducedGraphVisitor { r: self, parent_scope } .build_reduced_graph_for_external_crate_res(child); @@ -929,9 +926,9 @@ impl<'a, 'b, 'tcx> BuildReducedGraphVisitor<'a, 'b, 'tcx> { } /// Builds the reduced graph for a single item in an external crate. - fn build_reduced_graph_for_external_crate_res(&mut self, child: ModChild) { + fn build_reduced_graph_for_external_crate_res(&mut self, child: &ModChild) { let parent = self.parent_scope.module; - let ModChild { ident, res, vis, reexport_chain } = child; + let ModChild { ident, res, vis, ref reexport_chain } = *child; let span = self.r.def_span( reexport_chain .first() |
