mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Slightly shrink DefMap
This commit is contained in:
parent
117f9b7752
commit
dc7c6d43c7
22 changed files with 130 additions and 92 deletions
|
@ -110,7 +110,7 @@ impl TestDB {
|
|||
}
|
||||
_ => {
|
||||
// FIXME: handle `mod` inside block expression
|
||||
return def_map.module_id(def_map.root());
|
||||
return def_map.module_id(DefMap::ROOT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ impl TestDB {
|
|||
/// Finds the smallest/innermost module in `def_map` containing `position`.
|
||||
fn mod_at_position(&self, def_map: &DefMap, position: FilePosition) -> LocalModuleId {
|
||||
let mut size = None;
|
||||
let mut res = def_map.root();
|
||||
let mut res = DefMap::ROOT;
|
||||
for (module, data) in def_map.modules() {
|
||||
let src = data.definition_source(self);
|
||||
if src.file_id != position.file_id.into() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue