diff options
Diffstat (limited to 'crates/ra_hir_def/src/resolver.rs')
-rw-r--r-- | crates/ra_hir_def/src/resolver.rs | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/crates/ra_hir_def/src/resolver.rs b/crates/ra_hir_def/src/resolver.rs index 8e7a83ffe..43dc751d9 100644 --- a/crates/ra_hir_def/src/resolver.rs +++ b/crates/ra_hir_def/src/resolver.rs | |||
@@ -19,7 +19,7 @@ use crate::{ | |||
19 | nameres::CrateDefMap, | 19 | nameres::CrateDefMap, |
20 | path::{ModPath, PathKind}, | 20 | path::{ModPath, PathKind}, |
21 | per_ns::PerNs, | 21 | per_ns::PerNs, |
22 | visibility::{RawVisibility, ResolvedVisibility}, | 22 | visibility::{RawVisibility, Visibility}, |
23 | AdtId, AssocContainerId, ConstId, ContainerId, DefWithBodyId, EnumId, EnumVariantId, | 23 | AdtId, AssocContainerId, ConstId, ContainerId, DefWithBodyId, EnumId, EnumVariantId, |
24 | FunctionId, GenericDefId, HasModule, ImplId, LocalModuleId, Lookup, ModuleDefId, ModuleId, | 24 | FunctionId, GenericDefId, HasModule, ImplId, LocalModuleId, Lookup, ModuleDefId, ModuleId, |
25 | StaticId, StructId, TraitId, TypeAliasId, TypeParamId, VariantId, | 25 | StaticId, StructId, TraitId, TypeAliasId, TypeParamId, VariantId, |
@@ -236,7 +236,7 @@ impl Resolver { | |||
236 | &self, | 236 | &self, |
237 | db: &impl DefDatabase, | 237 | db: &impl DefDatabase, |
238 | visibility: &RawVisibility, | 238 | visibility: &RawVisibility, |
239 | ) -> Option<ResolvedVisibility> { | 239 | ) -> Option<Visibility> { |
240 | match visibility { | 240 | match visibility { |
241 | RawVisibility::Module(_) => { | 241 | RawVisibility::Module(_) => { |
242 | let (item_map, module) = match self.module() { | 242 | let (item_map, module) = match self.module() { |
@@ -245,7 +245,7 @@ impl Resolver { | |||
245 | }; | 245 | }; |
246 | item_map.resolve_visibility(db, module, visibility) | 246 | item_map.resolve_visibility(db, module, visibility) |
247 | } | 247 | } |
248 | RawVisibility::Public => Some(ResolvedVisibility::Public), | 248 | RawVisibility::Public => Some(Visibility::Public), |
249 | } | 249 | } |
250 | } | 250 | } |
251 | 251 | ||
@@ -466,16 +466,10 @@ impl Scope { | |||
466 | f(name.clone(), ScopeDef::PerNs(def)); | 466 | f(name.clone(), ScopeDef::PerNs(def)); |
467 | }); | 467 | }); |
468 | m.crate_def_map[m.module_id].scope.legacy_macros().for_each(|(name, macro_)| { | 468 | m.crate_def_map[m.module_id].scope.legacy_macros().for_each(|(name, macro_)| { |
469 | f( | 469 | f(name.clone(), ScopeDef::PerNs(PerNs::macros(macro_, Visibility::Public))); |
470 | name.clone(), | ||
471 | ScopeDef::PerNs(PerNs::macros(macro_, ResolvedVisibility::Public)), | ||
472 | ); | ||
473 | }); | 470 | }); |
474 | m.crate_def_map.extern_prelude.iter().for_each(|(name, &def)| { | 471 | m.crate_def_map.extern_prelude.iter().for_each(|(name, &def)| { |
475 | f( | 472 | f(name.clone(), ScopeDef::PerNs(PerNs::types(def.into(), Visibility::Public))); |
476 | name.clone(), | ||
477 | ScopeDef::PerNs(PerNs::types(def.into(), ResolvedVisibility::Public)), | ||
478 | ); | ||
479 | }); | 473 | }); |
480 | if let Some(prelude) = m.crate_def_map.prelude { | 474 | if let Some(prelude) = m.crate_def_map.prelude { |
481 | let prelude_def_map = db.crate_def_map(prelude.krate); | 475 | let prelude_def_map = db.crate_def_map(prelude.krate); |