diff options
author | Jonas Schievink <[email protected]> | 2021-01-25 14:21:33 +0000 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2021-01-25 14:21:33 +0000 |
commit | 5c241b07666bc7b29e97b8206e505944775266a0 (patch) | |
tree | 09c289ee88d13b794356e2316e9305d9746069fe /crates/hir_def/src/import_map.rs | |
parent | 82af033f2fa19d370797b7c6f3a99acd3e47c89e (diff) |
Create all `ModuleId`s through a `DefMap` method
`ModuleId` needs to be able to represent blocks, and only the
associated `DefMap` will know how to construct that `ModuleId`
Diffstat (limited to 'crates/hir_def/src/import_map.rs')
-rw-r--r-- | crates/hir_def/src/import_map.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/hir_def/src/import_map.rs b/crates/hir_def/src/import_map.rs index 0b7830445..0a3dc7956 100644 --- a/crates/hir_def/src/import_map.rs +++ b/crates/hir_def/src/import_map.rs | |||
@@ -75,7 +75,7 @@ impl ImportMap { | |||
75 | 75 | ||
76 | // We look only into modules that are public(ly reexported), starting with the crate root. | 76 | // We look only into modules that are public(ly reexported), starting with the crate root. |
77 | let empty = ImportPath { segments: vec![] }; | 77 | let empty = ImportPath { segments: vec![] }; |
78 | let root = ModuleId { krate, local_id: def_map.root() }; | 78 | let root = def_map.module_id(def_map.root()); |
79 | let mut worklist = vec![(root, empty)]; | 79 | let mut worklist = vec![(root, empty)]; |
80 | while let Some((module, mod_path)) = worklist.pop() { | 80 | while let Some((module, mod_path)) = worklist.pop() { |
81 | let ext_def_map; | 81 | let ext_def_map; |