aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/ra_ide/src/runnables.rs2
-rw-r--r--crates/rust-analyzer/src/main_loop/handlers.rs14
2 files changed, 1 insertions, 15 deletions
diff --git a/crates/ra_ide/src/runnables.rs b/crates/ra_ide/src/runnables.rs
index a96c5f157..ed98e58e0 100644
--- a/crates/ra_ide/src/runnables.rs
+++ b/crates/ra_ide/src/runnables.rs
@@ -5,7 +5,7 @@ use itertools::Itertools;
5use ra_ide_db::RootDatabase; 5use ra_ide_db::RootDatabase;
6use ra_syntax::{ 6use ra_syntax::{
7 ast::{self, AstNode, AttrsOwner, ModuleItemOwner, NameOwner}, 7 ast::{self, AstNode, AttrsOwner, ModuleItemOwner, NameOwner},
8 match_ast, SmolStr, SyntaxNode, TextRange, 8 match_ast, SyntaxNode, TextRange,
9}; 9};
10 10
11use crate::FileId; 11use crate::FileId;
diff --git a/crates/rust-analyzer/src/main_loop/handlers.rs b/crates/rust-analyzer/src/main_loop/handlers.rs
index 5f6e845a8..c51e4346a 100644
--- a/crates/rust-analyzer/src/main_loop/handlers.rs
+++ b/crates/rust-analyzer/src/main_loop/handlers.rs
@@ -39,7 +39,6 @@ use crate::{
39 world::WorldSnapshot, 39 world::WorldSnapshot,
40 LspError, Result, 40 LspError, Result,
41}; 41};
42use hir::Attrs;
43 42
44pub fn handle_analyzer_status(world: WorldSnapshot, _: ()) -> Result<String> { 43pub fn handle_analyzer_status(world: WorldSnapshot, _: ()) -> Result<String> {
45 let _p = profile("handle_analyzer_status"); 44 let _p = profile("handle_analyzer_status");
@@ -1039,19 +1038,6 @@ fn to_lsp_runnable(
1039 }) 1038 })
1040} 1039}
1041 1040
1042fn get_features_needed(attrs: Attrs) -> Option<Vec<SmolStr>> {
1043 let cfg_expr = attrs.by_key("cfg").tt_values().map(|subtree| ra_cfg::parse_cfg(subtree));
1044 let features_needed = cfg_expr
1045 .map(|cfg| {
1046 let mut min_features = vec![];
1047 collect_minimal_features_needed(&cfg, &mut min_features);
1048 min_features
1049 })
1050 .flatten()
1051 .collect();
1052 Some(features_needed).filter(|it: &Vec<SmolStr>| !it.is_empty())
1053}
1054
1055/// Fill minimal features needed 1041/// Fill minimal features needed
1056fn collect_minimal_features_needed(cfg_expr: &CfgExpr, features: &mut Vec<SmolStr>) { 1042fn collect_minimal_features_needed(cfg_expr: &CfgExpr, features: &mut Vec<SmolStr>) {
1057 match cfg_expr { 1043 match cfg_expr {