aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_def/src')
-rw-r--r--crates/ra_hir_def/src/adt.rs4
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)]
34pub struct EnumData { 34pub 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> {