aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_db
diff options
context:
space:
mode:
authorFedor Sakharov <[email protected]>2020-05-07 14:30:20 +0100
committerFedor Sakharov <[email protected]>2020-05-07 14:31:51 +0100
commit210f0cbd27b0621c47e15c74bbb16ab47a642999 (patch)
tree29254a5781765ac930e413bfee99f8d6abca1148 /crates/ra_ide_db
parentbd9f1f7eb78843ddd91d259a04e988b0681a5db4 (diff)
Remove HasVisibility implementation
Diffstat (limited to 'crates/ra_ide_db')
-rw-r--r--crates/ra_ide_db/src/defs.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/ra_ide_db/src/defs.rs b/crates/ra_ide_db/src/defs.rs
index 2e2850efb..f990e3bb9 100644
--- a/crates/ra_ide_db/src/defs.rs
+++ b/crates/ra_ide_db/src/defs.rs
@@ -6,7 +6,7 @@
6// FIXME: this badly needs rename/rewrite (matklad, 2020-02-06). 6// FIXME: this badly needs rename/rewrite (matklad, 2020-02-06).
7 7
8use hir::{ 8use hir::{
9 Field, HasVisibility, ImplDef, Local, MacroDef, Module, ModuleDef, Name, PathResolution, 9 Adt, Field, HasVisibility, ImplDef, Local, MacroDef, Module, ModuleDef, Name, PathResolution,
10 Semantics, TypeParam, Visibility, 10 Semantics, TypeParam, Visibility,
11}; 11};
12use ra_prof::profile; 12use ra_prof::profile;
@@ -48,7 +48,10 @@ impl Definition {
48 Definition::Macro(_) => None, 48 Definition::Macro(_) => None,
49 Definition::Field(sf) => Some(sf.visibility(db)), 49 Definition::Field(sf) => Some(sf.visibility(db)),
50 Definition::ModuleDef(def) => match def { 50 Definition::ModuleDef(def) => match def {
51 ModuleDef::EnumVariant(id) => Some(id.visibility(db)), 51 ModuleDef::EnumVariant(id) => {
52 let parent = id.parent_enum(db);
53 module?.visibility_of(db, &ModuleDef::Adt(Adt::Enum(parent)))
54 }
52 _ => module?.visibility_of(db, def), 55 _ => module?.visibility_of(db, def),
53 }, 56 },
54 Definition::SelfType(_) => None, 57 Definition::SelfType(_) => None,