mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Slightly shrink DefMap
This commit is contained in:
parent
117f9b7752
commit
dc7c6d43c7
22 changed files with 130 additions and 92 deletions
|
@ -13,6 +13,7 @@ use hir_def::{
|
|||
generics::{TypeOrConstParamData, TypeParamProvenance},
|
||||
item_scope::ItemInNs,
|
||||
lang_item::{LangItem, LangItemTarget},
|
||||
nameres::DefMap,
|
||||
path::{Path, PathKind},
|
||||
type_ref::{TraitBoundModifier, TypeBound, TypeRef},
|
||||
visibility::Visibility,
|
||||
|
@ -1488,7 +1489,7 @@ pub fn write_visibility(
|
|||
Visibility::Public => write!(f, "pub "),
|
||||
Visibility::Module(vis_id) => {
|
||||
let def_map = module_id.def_map(f.db.upcast());
|
||||
let root_module_id = def_map.module_id(def_map.root());
|
||||
let root_module_id = def_map.module_id(DefMap::ROOT);
|
||||
if vis_id == module_id {
|
||||
// pub(self) or omitted
|
||||
Ok(())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue