mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-14 22:24:14 +00:00
Merge branch 'master' into sync-from-rust
This commit is contained in:
commit
f07f17b146
2 changed files with 10 additions and 2 deletions
|
@ -167,7 +167,11 @@ fn collect_import_map(db: &dyn DefDatabase, krate: CrateId) -> ImportMap {
|
||||||
|
|
||||||
let visible_items = mod_data.scope.entries().filter_map(|(name, per_ns)| {
|
let visible_items = mod_data.scope.entries().filter_map(|(name, per_ns)| {
|
||||||
let per_ns = per_ns.filter_visibility(|vis| vis == Visibility::Public);
|
let per_ns = per_ns.filter_visibility(|vis| vis == Visibility::Public);
|
||||||
if per_ns.is_none() { None } else { Some((name, per_ns)) }
|
if per_ns.is_none() {
|
||||||
|
None
|
||||||
|
} else {
|
||||||
|
Some((name, per_ns))
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
for (name, per_ns) in visible_items {
|
for (name, per_ns) in visible_items {
|
||||||
|
|
|
@ -367,7 +367,11 @@ impl DefMap {
|
||||||
|
|
||||||
pub(crate) fn crate_root(&self, db: &dyn DefDatabase) -> ModuleId {
|
pub(crate) fn crate_root(&self, db: &dyn DefDatabase) -> ModuleId {
|
||||||
self.with_ancestor_maps(db, self.root, &mut |def_map, _module| {
|
self.with_ancestor_maps(db, self.root, &mut |def_map, _module| {
|
||||||
if def_map.block.is_none() { Some(def_map.module_id(def_map.root)) } else { None }
|
if def_map.block.is_none() {
|
||||||
|
Some(def_map.module_id(def_map.root))
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.expect("DefMap chain without root")
|
.expect("DefMap chain without root")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue