Create all ModuleIds through a DefMap method

`ModuleId` needs to be able to represent blocks, and only the
associated `DefMap` will know how to construct that `ModuleId`
This commit is contained in:
Jonas Schievink
2021-01-25 15:21:33 +01:00
parent 82af033f2f
commit 5c241b0766
11 changed files with 48 additions and 87 deletions

View File

@@ -78,10 +78,6 @@ pub struct ModuleId {
}
impl ModuleId {
pub fn top_level(krate: CrateId, local_id: LocalModuleId) -> Self {
Self { krate, local_id }
}
pub fn def_map(&self, db: &dyn db::DefDatabase) -> Arc<DefMap> {
db.crate_def_map(self.krate)
}