diff options
Diffstat (limited to 'crates/ra_hir_def/src/body')
-rw-r--r-- | crates/ra_hir_def/src/body/lower.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs index 4671b72e9..443b057ab 100644 --- a/crates/ra_hir_def/src/body/lower.rs +++ b/crates/ra_hir_def/src/body/lower.rs | |||
@@ -162,8 +162,7 @@ impl ExprCollector<'_> { | |||
162 | 162 | ||
163 | fn collect_expr(&mut self, expr: ast::Expr) -> ExprId { | 163 | fn collect_expr(&mut self, expr: ast::Expr) -> ExprId { |
164 | let syntax_ptr = AstPtr::new(&expr); | 164 | let syntax_ptr = AstPtr::new(&expr); |
165 | let attrs = self.expander.parse_attrs(&expr); | 165 | if !self.expander.is_cfg_enabled(&expr) { |
166 | if !self.expander.is_cfg_enabled(&attrs) { | ||
167 | return self.missing_expr(); | 166 | return self.missing_expr(); |
168 | } | 167 | } |
169 | match expr { | 168 | match expr { |
@@ -329,8 +328,7 @@ impl ExprCollector<'_> { | |||
329 | .fields() | 328 | .fields() |
330 | .inspect(|field| field_ptrs.push(AstPtr::new(field))) | 329 | .inspect(|field| field_ptrs.push(AstPtr::new(field))) |
331 | .filter_map(|field| { | 330 | .filter_map(|field| { |
332 | let attrs = self.expander.parse_attrs(&field); | 331 | if !self.expander.is_cfg_enabled(&field) { |
333 | if !self.expander.is_cfg_enabled(&attrs) { | ||
334 | return None; | 332 | return None; |
335 | } | 333 | } |
336 | let name = field.field_name()?.as_name(); | 334 | let name = field.field_name()?.as_name(); |