1
Fork 0

Auto merge of #104730 - petrochenkov:modchild5, r=cjgillot

rustc_metadata: Switch module children decoding to an iterator

Previously https://github.com/rust-lang/rust/pull/103578, https://github.com/rust-lang/rust/pull/103524 and previous PRs simplified it as much as possible.

A couple of cleanup commits is also added.
r? `@cjgillot`
This commit is contained in:
bors 2022-11-26 05:41:34 +00:00
commit f8a2e491eb
5 changed files with 56 additions and 84 deletions

View file

@ -204,7 +204,9 @@ impl<'a> Resolver<'a> {
}
pub(crate) fn build_reduced_graph_external(&mut self, module: Module<'a>) {
for child in self.cstore().module_children_untracked(module.def_id(), self.session) {
for child in
Vec::from_iter(self.cstore().module_children_untracked(module.def_id(), self.session))
{
let parent_scope = ParentScope::module(module, self);
BuildReducedGraphVisitor { r: self, parent_scope }
.build_reduced_graph_for_external_crate_res(child);

View file

@ -1920,7 +1920,7 @@ impl<'a> Resolver<'a> {
if let Some(def_id) = def_id.as_local() {
self.reexport_map.get(&def_id).cloned().unwrap_or_default()
} else {
self.cstore().module_children_untracked(def_id, self.session)
self.cstore().module_children_untracked(def_id, self.session).collect()
}
}