diff options
Diffstat (limited to 'crates/ra_hir_def/src/item_scope.rs')
-rw-r--r-- | crates/ra_hir_def/src/item_scope.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/crates/ra_hir_def/src/item_scope.rs b/crates/ra_hir_def/src/item_scope.rs index db5f469c7..fe7bb9779 100644 --- a/crates/ra_hir_def/src/item_scope.rs +++ b/crates/ra_hir_def/src/item_scope.rs | |||
@@ -6,8 +6,8 @@ use once_cell::sync::Lazy; | |||
6 | use rustc_hash::FxHashMap; | 6 | use rustc_hash::FxHashMap; |
7 | 7 | ||
8 | use crate::{ | 8 | use crate::{ |
9 | per_ns::PerNs, visibility::ResolvedVisibility, AdtId, BuiltinType, ImplId, MacroDefId, | 9 | per_ns::PerNs, visibility::Visibility, AdtId, BuiltinType, ImplId, MacroDefId, ModuleDefId, |
10 | ModuleDefId, TraitId, | 10 | TraitId, |
11 | }; | 11 | }; |
12 | 12 | ||
13 | #[derive(Debug, Default, PartialEq, Eq)] | 13 | #[derive(Debug, Default, PartialEq, Eq)] |
@@ -33,9 +33,7 @@ pub struct ItemScope { | |||
33 | static BUILTIN_SCOPE: Lazy<FxHashMap<Name, PerNs>> = Lazy::new(|| { | 33 | static BUILTIN_SCOPE: Lazy<FxHashMap<Name, PerNs>> = Lazy::new(|| { |
34 | BuiltinType::ALL | 34 | BuiltinType::ALL |
35 | .iter() | 35 | .iter() |
36 | .map(|(name, ty)| { | 36 | .map(|(name, ty)| (name.clone(), PerNs::types(ty.clone().into(), Visibility::Public))) |
37 | (name.clone(), PerNs::types(ty.clone().into(), ResolvedVisibility::Public)) | ||
38 | }) | ||
39 | .collect() | 37 | .collect() |
40 | }); | 38 | }); |
41 | 39 | ||
@@ -159,7 +157,7 @@ impl ItemScope { | |||
159 | } | 157 | } |
160 | 158 | ||
161 | impl PerNs { | 159 | impl PerNs { |
162 | pub(crate) fn from_def(def: ModuleDefId, v: ResolvedVisibility) -> PerNs { | 160 | pub(crate) fn from_def(def: ModuleDefId, v: Visibility) -> PerNs { |
163 | match def { | 161 | match def { |
164 | ModuleDefId::ModuleId(_) => PerNs::types(def, v), | 162 | ModuleDefId::ModuleId(_) => PerNs::types(def, v), |
165 | ModuleDefId::FunctionId(_) => PerNs::values(def, v), | 163 | ModuleDefId::FunctionId(_) => PerNs::values(def, v), |