diff options
Diffstat (limited to 'crates/hir_def')
-rw-r--r-- | crates/hir_def/src/data.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/hir_def/src/data.rs b/crates/hir_def/src/data.rs index 2c70b3bc0..fefc31129 100644 --- a/crates/hir_def/src/data.rs +++ b/crates/hir_def/src/data.rs | |||
@@ -252,12 +252,13 @@ fn collect_items( | |||
252 | } | 252 | } |
253 | 253 | ||
254 | let item_tree = db.item_tree(file_id); | 254 | let item_tree = db.item_tree(file_id); |
255 | let cfg_options = db.crate_graph()[module.krate].cfg_options.clone(); | 255 | let crate_graph = db.crate_graph(); |
256 | let cfg_options = &crate_graph[module.krate].cfg_options; | ||
256 | 257 | ||
257 | let mut items = Vec::new(); | 258 | let mut items = Vec::new(); |
258 | for item in assoc_items { | 259 | for item in assoc_items { |
259 | let attrs = item_tree.attrs(db, module.krate, ModItem::from(item).into()); | 260 | let attrs = item_tree.attrs(db, module.krate, ModItem::from(item).into()); |
260 | if !attrs.is_cfg_enabled(&cfg_options) { | 261 | if !attrs.is_cfg_enabled(cfg_options) { |
261 | continue; | 262 | continue; |
262 | } | 263 | } |
263 | 264 | ||