diff options
Diffstat (limited to 'crates/hir')
-rw-r--r-- | crates/hir/src/code_model.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs index a4141e111..aaa7013b6 100644 --- a/crates/hir/src/code_model.rs +++ b/crates/hir/src/code_model.rs | |||
@@ -90,7 +90,7 @@ impl Crate { | |||
90 | } | 90 | } |
91 | 91 | ||
92 | pub fn root_module(self, db: &dyn HirDatabase) -> Module { | 92 | pub fn root_module(self, db: &dyn HirDatabase) -> Module { |
93 | let module_id = db.crate_def_map(self.id).root; | 93 | let module_id = db.crate_def_map(self.id).root(); |
94 | Module::new(self, module_id) | 94 | Module::new(self, module_id) |
95 | } | 95 | } |
96 | 96 | ||
@@ -302,7 +302,7 @@ impl Module { | |||
302 | /// in the module tree of any target in `Cargo.toml`. | 302 | /// in the module tree of any target in `Cargo.toml`. |
303 | pub fn crate_root(self, db: &dyn HirDatabase) -> Module { | 303 | pub fn crate_root(self, db: &dyn HirDatabase) -> Module { |
304 | let def_map = db.crate_def_map(self.id.krate); | 304 | let def_map = db.crate_def_map(self.id.krate); |
305 | self.with_module_id(def_map.root) | 305 | self.with_module_id(def_map.root()) |
306 | } | 306 | } |
307 | 307 | ||
308 | /// Iterates over all child modules. | 308 | /// Iterates over all child modules. |
@@ -1000,7 +1000,7 @@ impl MacroDef { | |||
1000 | /// early, in `hir_expand`, where modules simply do not exist yet. | 1000 | /// early, in `hir_expand`, where modules simply do not exist yet. |
1001 | pub fn module(self, db: &dyn HirDatabase) -> Option<Module> { | 1001 | pub fn module(self, db: &dyn HirDatabase) -> Option<Module> { |
1002 | let krate = self.id.krate; | 1002 | let krate = self.id.krate; |
1003 | let module_id = db.crate_def_map(krate).root; | 1003 | let module_id = db.crate_def_map(krate).root(); |
1004 | Some(Module::new(Crate { id: krate }, module_id)) | 1004 | Some(Module::new(Crate { id: krate }, module_id)) |
1005 | } | 1005 | } |
1006 | 1006 | ||