registry.lock_patches();
}
-
for member in ws.members() {
registry.add_sources(&[member.package_id().source_id().clone()])?;
}
let mut members = Vec::new();
match method {
Method::Everything => members.extend(ws.members()),
- Method::Required { features, all_features, uses_default_features, .. } => {
+ Method::Required {
+ features,
+ all_features,
+ uses_default_features,
+ ..
+ } => {
if specs.len() > 1 && !features.is_empty() {
bail!("cannot specify features for more than one package");
}
members.extend(
- ws.members().filter(|m| specs.iter().any(|spec| spec.matches(m.package_id())))
+ ws.members()
+ .filter(|m| specs.iter().any(|spec| spec.matches(m.package_id()))),
);
// Edge case: running `cargo build -p foo`, where `foo` is not a member
// of current workspace. Add all packages from workspace to get `foo`
}
};
-
let root_replace = ws.root_replace();
let replace = match previous {
main = []
"#,
)
- .file("foo/src/main.rs", r#"
+ .file(
+ "foo/src/main.rs",
+ r#"
#[cfg(feature = "main")]
fn main() {}
- "#)
+ "#,
+ )
.build();
assert_that(
p.cargo("build -Z package-features --all --features main")
.masquerade_as_nightly_cargo(),
- execs().with_status(101).with_stderr_contains("\
-[ERROR] cannot specify features for more than one package"
+ execs().with_status(101).with_stderr_contains(
+ "\
+ [ERROR] cannot specify features for more than one package",
),
);
assert_that(
p.cargo("build -Z package-features --package dep --features main")
.masquerade_as_nightly_cargo(),
- execs().with_status(101).with_stderr_contains("\
-[ERROR] cannot specify features for packages outside of workspace"
+ execs().with_status(101).with_stderr_contains(
+ "\
+ [ERROR] cannot specify features for packages outside of workspace",
),
);
assert_that(
p.cargo("build -Z package-features --package dep --all-features")
.masquerade_as_nightly_cargo(),
- execs().with_status(101).with_stderr_contains("\
-[ERROR] cannot specify features for packages outside of workspace"
+ execs().with_status(101).with_stderr_contains(
+ "\
+ [ERROR] cannot specify features for packages outside of workspace",
),
);
assert_that(
p.cargo("build -Z package-features --package dep --no-default-features")
.masquerade_as_nightly_cargo(),
- execs().with_status(101).with_stderr_contains("\
-[ERROR] cannot specify features for packages outside of workspace"
+ execs().with_status(101).with_stderr_contains(
+ "\
+ [ERROR] cannot specify features for packages outside of workspace",
),
);