diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_project_model/src/cargo_workspace.rs | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/crates/ra_project_model/src/cargo_workspace.rs b/crates/ra_project_model/src/cargo_workspace.rs index fb88e0f06..10513542e 100644 --- a/crates/ra_project_model/src/cargo_workspace.rs +++ b/crates/ra_project_model/src/cargo_workspace.rs | |||
@@ -144,12 +144,15 @@ impl CargoWorkspace { | |||
144 | meta.manifest_path(cargo_toml.to_path_buf()); | 144 | meta.manifest_path(cargo_toml.to_path_buf()); |
145 | if cargo_features.all_features { | 145 | if cargo_features.all_features { |
146 | meta.features(CargoOpt::AllFeatures); | 146 | meta.features(CargoOpt::AllFeatures); |
147 | } else if cargo_features.no_default_features { | 147 | } else { |
148 | // FIXME: `NoDefaultFeatures` is mutual exclusive with `SomeFeatures` | 148 | if cargo_features.no_default_features { |
149 | // https://github.com/oli-obk/cargo_metadata/issues/79 | 149 | // FIXME: `NoDefaultFeatures` is mutual exclusive with `SomeFeatures` |
150 | meta.features(CargoOpt::NoDefaultFeatures); | 150 | // https://github.com/oli-obk/cargo_metadata/issues/79 |
151 | } else if !cargo_features.features.is_empty() { | 151 | meta.features(CargoOpt::NoDefaultFeatures); |
152 | meta.features(CargoOpt::SomeFeatures(cargo_features.features.clone())); | 152 | } |
153 | if !cargo_features.features.is_empty() { | ||
154 | meta.features(CargoOpt::SomeFeatures(cargo_features.features.clone())); | ||
155 | } | ||
153 | } | 156 | } |
154 | if let Some(parent) = cargo_toml.parent() { | 157 | if let Some(parent) = cargo_toml.parent() { |
155 | meta.current_dir(parent.to_path_buf()); | 158 | meta.current_dir(parent.to_path_buf()); |
@@ -289,12 +292,16 @@ pub fn load_extern_resources( | |||
289 | cmd.args(&["check", "--message-format=json", "--manifest-path"]).arg(cargo_toml); | 292 | cmd.args(&["check", "--message-format=json", "--manifest-path"]).arg(cargo_toml); |
290 | if cargo_features.all_features { | 293 | if cargo_features.all_features { |
291 | cmd.arg("--all-features"); | 294 | cmd.arg("--all-features"); |
292 | } else if cargo_features.no_default_features { | ||
293 | // FIXME: `NoDefaultFeatures` is mutual exclusive with `SomeFeatures` | ||
294 | // https://github.com/oli-obk/cargo_metadata/issues/79 | ||
295 | cmd.arg("--no-default-features"); | ||
296 | } else { | 295 | } else { |
297 | cmd.args(&cargo_features.features); | 296 | if cargo_features.no_default_features { |
297 | // FIXME: `NoDefaultFeatures` is mutual exclusive with `SomeFeatures` | ||
298 | // https://github.com/oli-obk/cargo_metadata/issues/79 | ||
299 | cmd.arg("--no-default-features"); | ||
300 | } | ||
301 | if !cargo_features.features.is_empty() { | ||
302 | cmd.arg("--features"); | ||
303 | cmd.arg(cargo_features.features.join(" ")); | ||
304 | } | ||
298 | } | 305 | } |
299 | 306 | ||
300 | let output = cmd.output()?; | 307 | let output = cmd.output()?; |