aboutsummaryrefslogtreecommitdiff
path: root/crates/hir/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir/src')
-rw-r--r--crates/hir/src/lib.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs
index e3a332d30..d5a3d9034 100644
--- a/crates/hir/src/lib.rs
+++ b/crates/hir/src/lib.rs
@@ -1114,6 +1114,7 @@ pub enum AssocItem {
1114 Const(Const), 1114 Const(Const),
1115 TypeAlias(TypeAlias), 1115 TypeAlias(TypeAlias),
1116} 1116}
1117#[derive(Debug)]
1117pub enum AssocItemContainer { 1118pub enum AssocItemContainer {
1118 Trait(Trait), 1119 Trait(Trait),
1119 Impl(Impl), 1120 Impl(Impl),
@@ -2136,6 +2137,16 @@ impl ScopeDef {
2136 } 2137 }
2137} 2138}
2138 2139
2140impl From<ItemInNs> for ScopeDef {
2141 fn from(item: ItemInNs) -> Self {
2142 match item {
2143 ItemInNs::Types(id) => ScopeDef::ModuleDef(id.into()),
2144 ItemInNs::Values(id) => ScopeDef::ModuleDef(id.into()),
2145 ItemInNs::Macros(id) => ScopeDef::MacroDef(id.into()),
2146 }
2147 }
2148}
2149
2139pub trait HasVisibility { 2150pub trait HasVisibility {
2140 fn visibility(&self, db: &dyn HirDatabase) -> Visibility; 2151 fn visibility(&self, db: &dyn HirDatabase) -> Visibility;
2141 fn is_visible_from(&self, db: &dyn HirDatabase, module: Module) -> bool { 2152 fn is_visible_from(&self, db: &dyn HirDatabase, module: Module) -> bool {