aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_def')
-rw-r--r--crates/ra_hir_def/src/adt.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/crates/ra_hir_def/src/adt.rs b/crates/ra_hir_def/src/adt.rs
index 8eef51828..d0912ddaa 100644
--- a/crates/ra_hir_def/src/adt.rs
+++ b/crates/ra_hir_def/src/adt.rs
@@ -117,7 +117,13 @@ fn lower_enum(
117 ast: &InFile<ast::EnumDef>, 117 ast: &InFile<ast::EnumDef>,
118 module_id: ModuleId, 118 module_id: ModuleId,
119) { 119) {
120 for var in ast.value.variant_list().into_iter().flat_map(|it| it.variants()) { 120 let expander = CfgExpander::new(db, ast.file_id, module_id.krate);
121 let variants =
122 ast.value.variant_list().into_iter().flat_map(|it| it.variants()).filter(|var| {
123 let attrs = expander.parse_attrs(var);
124 expander.is_cfg_enabled(&attrs)
125 });
126 for var in variants {
121 trace.alloc( 127 trace.alloc(
122 || var.clone(), 128 || var.clone(),
123 || EnumVariantData { 129 || EnumVariantData {