resolve: Split module_map into two maps for local and extern modules

This commit is contained in:
Vadim Petrochenkov
2025-07-07 00:15:13 +03:00
parent 8d7193973f
commit 8b8889df25
3 changed files with 69 additions and 41 deletions

View File

@@ -2159,7 +2159,16 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
.keys()
.map(|ident| ident.name)
.chain(
self.module_map
self.local_module_map
.iter()
.filter(|(_, module)| {
current_module.is_ancestor_of(**module) && current_module != **module
})
.flat_map(|(_, module)| module.kind.name()),
)
.chain(
self.extern_module_map
.borrow()
.iter()
.filter(|(_, module)| {
current_module.is_ancestor_of(**module) && current_module != **module