diff options
Diffstat (limited to 'crates/ra_project_model')
-rw-r--r-- | crates/ra_project_model/src/lib.rs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/crates/ra_project_model/src/lib.rs b/crates/ra_project_model/src/lib.rs index 8703429d4..c226ffa57 100644 --- a/crates/ra_project_model/src/lib.rs +++ b/crates/ra_project_model/src/lib.rs | |||
@@ -398,8 +398,18 @@ impl ProjectWorkspace { | |||
398 | let edition = cargo[pkg].edition; | 398 | let edition = cargo[pkg].edition; |
399 | let cfg_options = { | 399 | let cfg_options = { |
400 | let mut opts = default_cfg_options.clone(); | 400 | let mut opts = default_cfg_options.clone(); |
401 | opts.insert_features(cargo[pkg].features.iter().map(Into::into)); | 401 | for feature in cargo[pkg].features.iter() { |
402 | opts.insert_cfgs(cargo[pkg].cfgs.iter().map(Into::into)); | 402 | opts.insert_key_value("feature".into(), feature.into()); |
403 | } | ||
404 | for cfg in cargo[pkg].cfgs.iter() { | ||
405 | match cfg.find('=') { | ||
406 | Some(split) => opts.insert_key_value( | ||
407 | cfg[..split].into(), | ||
408 | cfg[split + 1..].trim_matches('"').into(), | ||
409 | ), | ||
410 | None => opts.insert_atom(cfg.into()), | ||
411 | }; | ||
412 | } | ||
403 | opts | 413 | opts |
404 | }; | 414 | }; |
405 | let mut env = Env::default(); | 415 | let mut env = Env::default(); |