Create all ModuleIds through a DefMap method

`ModuleId` needs to be able to represent blocks, and only the
associated `DefMap` will know how to construct that `ModuleId`
This commit is contained in:
Jonas Schievink 2021-01-25 15:21:33 +01:00
parent 82af033f2f
commit 5c241b0766
11 changed files with 48 additions and 87 deletions

View file

@ -75,7 +75,7 @@ impl ImportMap {
// We look only into modules that are public(ly reexported), starting with the crate root.
let empty = ImportPath { segments: vec![] };
let root = ModuleId { krate, local_id: def_map.root() };
let root = def_map.module_id(def_map.root());
let mut worklist = vec![(root, empty)];
while let Some((module, mod_path)) = worklist.pop() {
let ext_def_map;