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/lib.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/lib.rs')
-rw-r--r-- | crates/hir_def/src/lib.rs | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/crates/hir_def/src/lib.rs b/crates/hir_def/src/lib.rs index c8dbb2aeb..cf09ebd3f 100644 --- a/crates/hir_def/src/lib.rs +++ b/crates/hir_def/src/lib.rs | |||
@@ -78,10 +78,6 @@ pub struct ModuleId { | |||
78 | } | 78 | } |
79 | 79 | ||
80 | impl ModuleId { | 80 | impl ModuleId { |
81 | pub fn top_level(krate: CrateId, local_id: LocalModuleId) -> Self { | ||
82 | Self { krate, local_id } | ||
83 | } | ||
84 | |||
85 | pub fn def_map(&self, db: &dyn db::DefDatabase) -> Arc<DefMap> { | 81 | pub fn def_map(&self, db: &dyn db::DefDatabase) -> Arc<DefMap> { |
86 | db.crate_def_map(self.krate) | 82 | db.crate_def_map(self.krate) |
87 | } | 83 | } |