Skip to content

Commit 4096619

Browse files
committed
Auto merge of rust-lang#110542 - petrochenkov:qcstore4, r=cjgillot
resolve: Remove `module_children_untracked` One of the expensive spans in `ModChild` was removed in rust-lang#109772, so let's try again.
2 parents 1151ea6 + 53c71b6 commit 4096619

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs

-8
Original file line numberDiff line numberDiff line change
@@ -516,14 +516,6 @@ impl CStore {
516516
self.get_crate_data(def.krate).get_ctor(def.index)
517517
}
518518

519-
pub fn module_children_untracked<'a>(
520-
&'a self,
521-
def_id: DefId,
522-
sess: &'a Session,
523-
) -> impl Iterator<Item = ModChild> + 'a {
524-
self.get_crate_data(def_id.krate).get_module_children(def_id.index, sess)
525-
}
526-
527519
pub fn load_macro_untracked(&self, id: DefId, sess: &Session) -> LoadedMacro {
528520
let _prof_timer = sess.prof.generic_activity("metadata_load_macro");
529521

compiler/rustc_resolve/src/build_reduced_graph.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
197197
}
198198

199199
pub(crate) fn build_reduced_graph_external(&mut self, module: Module<'a>) {
200-
// Query `module_children` is not used because hashing spans in its result is expensive.
201-
let children =
202-
Vec::from_iter(self.cstore().module_children_untracked(module.def_id(), self.tcx.sess));
203-
for child in children {
200+
for child in self.tcx.module_children(module.def_id()) {
204201
let parent_scope = ParentScope::module(module, self);
205202
BuildReducedGraphVisitor { r: self, parent_scope }
206203
.build_reduced_graph_for_external_crate_res(child);
@@ -929,9 +926,9 @@ impl<'a, 'b, 'tcx> BuildReducedGraphVisitor<'a, 'b, 'tcx> {
929926
}
930927

931928
/// Builds the reduced graph for a single item in an external crate.
932-
fn build_reduced_graph_for_external_crate_res(&mut self, child: ModChild) {
929+
fn build_reduced_graph_for_external_crate_res(&mut self, child: &ModChild) {
933930
let parent = self.parent_scope.module;
934-
let ModChild { ident, res, vis, reexport_chain } = child;
931+
let ModChild { ident, res, vis, ref reexport_chain } = *child;
935932
let span = self.r.def_span(
936933
reexport_chain
937934
.first()

0 commit comments

Comments
 (0)