diff options
author | Aleksey Kladov <[email protected]> | 2020-05-08 01:56:53 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-05-08 01:56:53 +0100 |
commit | d3110859ba4e97cf17d2c997befa92fb63bfb138 (patch) | |
tree | 6d009aa2fd585161338cb7b7587e0c35fa0aa1a7 /crates/ra_project_model | |
parent | 7be0a29c63e23ce55a21084b845cb3266e0246a3 (diff) |
Move feature desugaring to the right abstraction layer
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(); |