diff options
-rw-r--r-- | crates/ra_hir_def/src/adt.rs | 4 | ||||
-rw-r--r-- | crates/ra_hir_def/src/body.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir_def/src/body/lower.rs | 3 | ||||
-rw-r--r-- | crates/ra_hir_def/src/data.rs | 2 |
4 files changed, 5 insertions, 6 deletions
diff --git a/crates/ra_hir_def/src/adt.rs b/crates/ra_hir_def/src/adt.rs index 2619d106d..c7c3c0bc7 100644 --- a/crates/ra_hir_def/src/adt.rs +++ b/crates/ra_hir_def/src/adt.rs | |||
@@ -202,7 +202,7 @@ fn lower_struct( | |||
202 | ast::StructKind::Tuple(fl) => { | 202 | ast::StructKind::Tuple(fl) => { |
203 | for (i, fd) in fl.fields().enumerate() { | 203 | for (i, fd) in fl.fields().enumerate() { |
204 | let attrs = expander.parse_attrs(&fd); | 204 | let attrs = expander.parse_attrs(&fd); |
205 | if !expander.check_cfg(&attrs) { | 205 | if !expander.is_cfg_enabled(&attrs) { |
206 | continue; | 206 | continue; |
207 | } | 207 | } |
208 | 208 | ||
@@ -220,7 +220,7 @@ fn lower_struct( | |||
220 | ast::StructKind::Record(fl) => { | 220 | ast::StructKind::Record(fl) => { |
221 | for fd in fl.fields() { | 221 | for fd in fl.fields() { |
222 | let attrs = expander.parse_attrs(&fd); | 222 | let attrs = expander.parse_attrs(&fd); |
223 | if !expander.check_cfg(&attrs) { | 223 | if !expander.is_cfg_enabled(&attrs) { |
224 | continue; | 224 | continue; |
225 | } | 225 | } |
226 | 226 | ||
diff --git a/crates/ra_hir_def/src/body.rs b/crates/ra_hir_def/src/body.rs index 48b797dd6..7fe5403c0 100644 --- a/crates/ra_hir_def/src/body.rs +++ b/crates/ra_hir_def/src/body.rs | |||
@@ -118,7 +118,7 @@ impl Expander { | |||
118 | Attrs::new(owner, &self.hygiene) | 118 | Attrs::new(owner, &self.hygiene) |
119 | } | 119 | } |
120 | 120 | ||
121 | pub(crate) fn check_cfg(&self, attrs: &Attrs) -> bool { | 121 | pub(crate) fn is_cfg_enabled(&self, attrs: &Attrs) -> bool { |
122 | attrs.is_cfg_enabled(&self.cfg_options) | 122 | attrs.is_cfg_enabled(&self.cfg_options) |
123 | } | 123 | } |
124 | 124 | ||
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs index 6f56d3d7a..c1d7eb826 100644 --- a/crates/ra_hir_def/src/body/lower.rs +++ b/crates/ra_hir_def/src/body/lower.rs | |||
@@ -306,8 +306,7 @@ impl ExprCollector<'_> { | |||
306 | .inspect(|field| field_ptrs.push(AstPtr::new(field))) | 306 | .inspect(|field| field_ptrs.push(AstPtr::new(field))) |
307 | .filter_map(|field| { | 307 | .filter_map(|field| { |
308 | let attrs = self.expander.parse_attrs(&field); | 308 | let attrs = self.expander.parse_attrs(&field); |
309 | 309 | if !self.expander.is_cfg_enabled(&attrs) { | |
310 | if !self.expander.check_cfg(&attrs) { | ||
311 | return None; | 310 | return None; |
312 | } | 311 | } |
313 | 312 | ||
diff --git a/crates/ra_hir_def/src/data.rs b/crates/ra_hir_def/src/data.rs index 446af9d9b..56a20c5bd 100644 --- a/crates/ra_hir_def/src/data.rs +++ b/crates/ra_hir_def/src/data.rs | |||
@@ -337,7 +337,7 @@ fn collect_impl_items( | |||
337 | .filter_map(|item_node| match item_node { | 337 | .filter_map(|item_node| match item_node { |
338 | ast::ImplItem::FnDef(it) => { | 338 | ast::ImplItem::FnDef(it) => { |
339 | let attrs = expander.parse_attrs(&it); | 339 | let attrs = expander.parse_attrs(&it); |
340 | if !expander.check_cfg(&attrs) { | 340 | if !expander.is_cfg_enabled(&attrs) { |
341 | return None; | 341 | return None; |
342 | } | 342 | } |
343 | let def = FunctionLoc { | 343 | let def = FunctionLoc { |