Skip to content

Commit 97f0139

Browse files
Merge #2658
2658: Only add features flags if non-empty r=matklad a=edwin0cheng This prevent error when disabled `all-features` in a cargo workspace, because of `--features is not allowed in the root of a virtual workspace` when running `cargo metadata`. Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2 parents 24e552f + 4ee3c52 commit 97f0139

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/ra_project_model/src/cargo_workspace.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ impl CargoWorkspace {
165165
// FIXME: `NoDefaultFeatures` is mutual exclusive with `SomeFeatures`
166166
// https://github.com/oli-obk/cargo_metadata/issues/79
167167
meta.features(CargoOpt::NoDefaultFeatures);
168-
} else {
168+
} else if cargo_features.features.len() > 0 {
169169
meta.features(CargoOpt::SomeFeatures(cargo_features.features.clone()));
170170
}
171171
if let Some(parent) = cargo_toml.parent() {

0 commit comments

Comments
 (0)