diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-01-25 14:22:24 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-01-25 14:22:24 +0000 |
commit | 2c735ed734be9b9041921478e0049fffd7160f78 (patch) | |
tree | 724e39e3933126ee3129c3e4e0c971b443221afd /crates/hir_def/src/lib.rs | |
parent | 0a6b2b784618ffbc7775e9a3e3aaf42689bb2962 (diff) | |
parent | 5c241b07666bc7b29e97b8206e505944775266a0 (diff) |
Merge #7426
7426: Create all `ModuleId`s through a `DefMap` method r=jonas-schievink a=jonas-schievink
`ModuleId` needs to be able to represent blocks, and only the
associated `DefMap` will know how to construct that `ModuleId`
bors r+
Co-authored-by: Jonas Schievink <[email protected]>
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 | } |