aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide')
-rw-r--r--crates/ra_ide/src/runnables.rs13
1 files changed, 2 insertions, 11 deletions
diff --git a/crates/ra_ide/src/runnables.rs b/crates/ra_ide/src/runnables.rs
index 3a3d0b0ac..a460370c5 100644
--- a/crates/ra_ide/src/runnables.rs
+++ b/crates/ra_ide/src/runnables.rs
@@ -190,17 +190,8 @@ fn runnable_mod(
190 190
191fn get_features_needed(attrs: Attrs) -> Option<Vec<SmolStr>> { 191fn get_features_needed(attrs: Attrs) -> Option<Vec<SmolStr>> {
192 let cfg_expr = attrs.by_key("cfg").tt_values().map(|subtree| ra_cfg::parse_cfg(subtree)); 192 let cfg_expr = attrs.by_key("cfg").tt_values().map(|subtree| ra_cfg::parse_cfg(subtree));
193 let features_needed = cfg_expr.fold(vec![], |mut acc, cfg| { 193 let features_needed = cfg_expr.map(|cfg| cfg.minimal_features_needed()).flatten().collect();
194 if let Some(features_needed) = cfg.minimal_features_needed() { 194 Some(features_needed).filter(|it: &Vec<SmolStr>| !it.is_empty())
195 acc.extend(features_needed);
196 }
197 acc
198 });
199 if features_needed.is_empty() {
200 None
201 } else {
202 Some(features_needed)
203 }
204} 195}
205 196
206#[cfg(test)] 197#[cfg(test)]