From bd9f1f7eb78843ddd91d259a04e988b0681a5db4 Mon Sep 17 00:00:00 2001 From: Fedor Sakharov Date: Wed, 6 May 2020 17:17:35 +0300 Subject: Fix rename of enum variant visible from module --- crates/ra_hir_def/src/adt.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'crates/ra_hir_def/src') diff --git a/crates/ra_hir_def/src/adt.rs b/crates/ra_hir_def/src/adt.rs index 2bc34d449..0fda4d6c9 100644 --- a/crates/ra_hir_def/src/adt.rs +++ b/crates/ra_hir_def/src/adt.rs @@ -33,6 +33,7 @@ pub struct StructData { #[derive(Debug, Clone, PartialEq, Eq)] pub struct EnumData { pub name: Name, + pub visibility: RawVisibility, pub variants: Arena, } @@ -91,7 +92,8 @@ impl EnumData { let name = src.value.name().map_or_else(Name::missing, |n| n.as_name()); let mut trace = Trace::new_for_arena(); lower_enum(db, &mut trace, &src, e.lookup(db).container.module(db)); - Arc::new(EnumData { name, variants: trace.into_arena() }) + let visibility = RawVisibility::from_ast(db, src.with_value(src.value.visibility())); + Arc::new(EnumData { name, visibility, variants: trace.into_arena() }) } pub fn variant(&self, name: &Name) -> Option { -- cgit v1.2.3