diff options
Diffstat (limited to 'crates/hir')
-rw-r--r-- | crates/hir/src/lib.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index 62692c2c1..c4691d34c 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs | |||
@@ -1115,6 +1115,7 @@ pub enum AssocItem { | |||
1115 | Const(Const), | 1115 | Const(Const), |
1116 | TypeAlias(TypeAlias), | 1116 | TypeAlias(TypeAlias), |
1117 | } | 1117 | } |
1118 | #[derive(Debug)] | ||
1118 | pub enum AssocItemContainer { | 1119 | pub enum AssocItemContainer { |
1119 | Trait(Trait), | 1120 | Trait(Trait), |
1120 | Impl(Impl), | 1121 | Impl(Impl), |
@@ -2148,6 +2149,16 @@ impl ScopeDef { | |||
2148 | } | 2149 | } |
2149 | } | 2150 | } |
2150 | 2151 | ||
2152 | impl From<ItemInNs> for ScopeDef { | ||
2153 | fn from(item: ItemInNs) -> Self { | ||
2154 | match item { | ||
2155 | ItemInNs::Types(id) => ScopeDef::ModuleDef(id.into()), | ||
2156 | ItemInNs::Values(id) => ScopeDef::ModuleDef(id.into()), | ||
2157 | ItemInNs::Macros(id) => ScopeDef::MacroDef(id.into()), | ||
2158 | } | ||
2159 | } | ||
2160 | } | ||
2161 | |||
2151 | pub trait HasVisibility { | 2162 | pub trait HasVisibility { |
2152 | fn visibility(&self, db: &dyn HirDatabase) -> Visibility; | 2163 | fn visibility(&self, db: &dyn HirDatabase) -> Visibility; |
2153 | fn is_visible_from(&self, db: &dyn HirDatabase, module: Module) -> bool { | 2164 | fn is_visible_from(&self, db: &dyn HirDatabase, module: Module) -> bool { |