diff options
author | Fedor Sakharov <[email protected]> | 2020-05-06 15:17:35 +0100 |
---|---|---|
committer | Fedor Sakharov <[email protected]> | 2020-05-06 15:35:22 +0100 |
commit | bd9f1f7eb78843ddd91d259a04e988b0681a5db4 (patch) | |
tree | e9fcabf13e376266b3a7065743fa3392dfdb53e9 /crates/ra_hir_def/src | |
parent | efd8e34c396f1524623a495e47111f1047cf2879 (diff) |
Fix rename of enum variant visible from module
Diffstat (limited to 'crates/ra_hir_def/src')
-rw-r--r-- | crates/ra_hir_def/src/adt.rs | 4 |
1 files changed, 3 insertions, 1 deletions
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 { | |||
33 | #[derive(Debug, Clone, PartialEq, Eq)] | 33 | #[derive(Debug, Clone, PartialEq, Eq)] |
34 | pub struct EnumData { | 34 | pub struct EnumData { |
35 | pub name: Name, | 35 | pub name: Name, |
36 | pub visibility: RawVisibility, | ||
36 | pub variants: Arena<EnumVariantData>, | 37 | pub variants: Arena<EnumVariantData>, |
37 | } | 38 | } |
38 | 39 | ||
@@ -91,7 +92,8 @@ impl EnumData { | |||
91 | let name = src.value.name().map_or_else(Name::missing, |n| n.as_name()); | 92 | let name = src.value.name().map_or_else(Name::missing, |n| n.as_name()); |
92 | let mut trace = Trace::new_for_arena(); | 93 | let mut trace = Trace::new_for_arena(); |
93 | lower_enum(db, &mut trace, &src, e.lookup(db).container.module(db)); | 94 | lower_enum(db, &mut trace, &src, e.lookup(db).container.module(db)); |
94 | Arc::new(EnumData { name, variants: trace.into_arena() }) | 95 | let visibility = RawVisibility::from_ast(db, src.with_value(src.value.visibility())); |
96 | Arc::new(EnumData { name, visibility, variants: trace.into_arena() }) | ||
95 | } | 97 | } |
96 | 98 | ||
97 | pub fn variant(&self, name: &Name) -> Option<LocalEnumVariantId> { | 99 | pub fn variant(&self, name: &Name) -> Option<LocalEnumVariantId> { |