From 210f0cbd27b0621c47e15c74bbb16ab47a642999 Mon Sep 17 00:00:00 2001 From: Fedor Sakharov Date: Thu, 7 May 2020 16:30:20 +0300 Subject: Remove HasVisibility implementation --- crates/ra_ide_db/src/defs.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'crates/ra_ide_db') 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 @@ // FIXME: this badly needs rename/rewrite (matklad, 2020-02-06). use hir::{ - Field, HasVisibility, ImplDef, Local, MacroDef, Module, ModuleDef, Name, PathResolution, + Adt, Field, HasVisibility, ImplDef, Local, MacroDef, Module, ModuleDef, Name, PathResolution, Semantics, TypeParam, Visibility, }; use ra_prof::profile; @@ -48,7 +48,10 @@ impl Definition { Definition::Macro(_) => None, Definition::Field(sf) => Some(sf.visibility(db)), Definition::ModuleDef(def) => match def { - ModuleDef::EnumVariant(id) => Some(id.visibility(db)), + ModuleDef::EnumVariant(id) => { + let parent = id.parent_enum(db); + module?.visibility_of(db, &ModuleDef::Adt(Adt::Enum(parent))) + } _ => module?.visibility_of(db, def), }, Definition::SelfType(_) => None, -- cgit v1.2.3