diff options
Diffstat (limited to 'crates/hir/src')
-rw-r--r-- | crates/hir/src/code_model.rs | 8 | ||||
-rw-r--r-- | crates/hir/src/semantics.rs | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs index 5a4c27906..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 | ||
@@ -2046,7 +2046,7 @@ impl Callable { | |||
2046 | pub enum ScopeDef { | 2046 | pub enum ScopeDef { |
2047 | ModuleDef(ModuleDef), | 2047 | ModuleDef(ModuleDef), |
2048 | MacroDef(MacroDef), | 2048 | MacroDef(MacroDef), |
2049 | GenericParam(TypeParam), | 2049 | GenericParam(GenericParam), |
2050 | ImplSelfType(Impl), | 2050 | ImplSelfType(Impl), |
2051 | AdtSelfType(Adt), | 2051 | AdtSelfType(Adt), |
2052 | Local(Local), | 2052 | Local(Local), |
diff --git a/crates/hir/src/semantics.rs b/crates/hir/src/semantics.rs index ab213e04c..0a30b4f5b 100644 --- a/crates/hir/src/semantics.rs +++ b/crates/hir/src/semantics.rs | |||
@@ -814,7 +814,7 @@ impl<'a> SemanticsScope<'a> { | |||
814 | } | 814 | } |
815 | resolver::ScopeDef::ImplSelfType(it) => ScopeDef::ImplSelfType(it.into()), | 815 | resolver::ScopeDef::ImplSelfType(it) => ScopeDef::ImplSelfType(it.into()), |
816 | resolver::ScopeDef::AdtSelfType(it) => ScopeDef::AdtSelfType(it.into()), | 816 | resolver::ScopeDef::AdtSelfType(it) => ScopeDef::AdtSelfType(it.into()), |
817 | resolver::ScopeDef::GenericParam(id) => ScopeDef::GenericParam(TypeParam { id }), | 817 | resolver::ScopeDef::GenericParam(id) => ScopeDef::GenericParam(id.into()), |
818 | resolver::ScopeDef::Local(pat_id) => { | 818 | resolver::ScopeDef::Local(pat_id) => { |
819 | let parent = resolver.body_owner().unwrap().into(); | 819 | let parent = resolver.body_owner().unwrap().into(); |
820 | ScopeDef::Local(Local { parent, pat_id }) | 820 | ScopeDef::Local(Local { parent, pat_id }) |