1
Fork 0

rustc_metadata: Switch module children decoding to an iterator

This commit is contained in:
Vadim Petrochenkov 2022-11-22 20:01:44 +03:00
parent f3b5791a47
commit 6a233b5e2a
4 changed files with 61 additions and 64 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()
}
}