mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
Make public DefMap fields private
This commit is contained in:
parent
de5aabd48b
commit
0587b99fde
10 changed files with 31 additions and 23 deletions
|
@ -90,7 +90,7 @@ impl Crate {
|
|||
}
|
||||
|
||||
pub fn root_module(self, db: &dyn HirDatabase) -> Module {
|
||||
let module_id = db.crate_def_map(self.id).root;
|
||||
let module_id = db.crate_def_map(self.id).root();
|
||||
Module::new(self, module_id)
|
||||
}
|
||||
|
||||
|
@ -302,7 +302,7 @@ impl Module {
|
|||
/// in the module tree of any target in `Cargo.toml`.
|
||||
pub fn crate_root(self, db: &dyn HirDatabase) -> Module {
|
||||
let def_map = db.crate_def_map(self.id.krate);
|
||||
self.with_module_id(def_map.root)
|
||||
self.with_module_id(def_map.root())
|
||||
}
|
||||
|
||||
/// Iterates over all child modules.
|
||||
|
@ -1000,7 +1000,7 @@ impl MacroDef {
|
|||
/// early, in `hir_expand`, where modules simply do not exist yet.
|
||||
pub fn module(self, db: &dyn HirDatabase) -> Option<Module> {
|
||||
let krate = self.id.krate;
|
||||
let module_id = db.crate_def_map(krate).root;
|
||||
let module_id = db.crate_def_map(krate).root();
|
||||
Some(Module::new(Crate { id: krate }, module_id))
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue