Skip to content

Commit 84f630e

Browse files
committed
Auto merge of #5567 - alexcrichton:beta-next, r=alexcrichton
[beta] Copy `--all-features` request to all workspace members Backport of #5556
2 parents cbf6c57 + 7eb5665 commit 84f630e

File tree

4 files changed

+45
-5
lines changed

4 files changed

+45
-5
lines changed

src/cargo/ops/resolve.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -272,11 +272,11 @@ pub fn resolve_with_previous<'a, 'cfg>(
272272
// workspace, then we use `method` specified. Otherwise we use a
273273
// base method with no features specified but using default features
274274
// for any other packages specified with `-p`.
275-
Method::Required { dev_deps, .. } => {
275+
Method::Required { dev_deps, all_features, .. } => {
276276
let base = Method::Required {
277277
dev_deps,
278278
features: &[],
279-
all_features: false,
279+
all_features,
280280
uses_default_features: true,
281281
};
282282
let member_id = member.package_id();

tests/testsuite/build.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3761,6 +3761,7 @@ fn custom_target_dir_line_parameter() {
37613761
}
37623762

37633763
#[test]
3764+
#[ignore]
37643765
fn rustc_no_trans() {
37653766
if !is_nightly() {
37663767
return;

tests/testsuite/features.rs

+39
Original file line numberDiff line numberDiff line change
@@ -2031,3 +2031,42 @@ fn only_dep_is_optional() {
20312031
execs().with_status(0),
20322032
);
20332033
}
2034+
2035+
#[test]
2036+
fn all_features_all_crates() {
2037+
Package::new("bar", "0.1.0").publish();
2038+
2039+
let p = project("foo")
2040+
.file(
2041+
"Cargo.toml",
2042+
r#"
2043+
[project]
2044+
name = "foo"
2045+
version = "0.0.1"
2046+
authors = []
2047+
2048+
[workspace]
2049+
members = ['bar']
2050+
"#,
2051+
)
2052+
.file("src/main.rs", "fn main() {}")
2053+
.file(
2054+
"bar/Cargo.toml",
2055+
r#"
2056+
[project]
2057+
name = "bar"
2058+
version = "0.0.1"
2059+
authors = []
2060+
2061+
[features]
2062+
foo = []
2063+
"#,
2064+
)
2065+
.file("bar/src/main.rs", "#[cfg(feature = \"foo\")] fn main() {}")
2066+
.build();
2067+
2068+
assert_that(
2069+
p.cargo("build --all-features --all"),
2070+
execs().with_status(0),
2071+
);
2072+
}

tests/testsuite/test.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ test test_hello ... FAILED
301301
failures:
302302
303303
---- test_hello stdout ----
304-
<tab>thread 'test_hello' panicked at 'assertion failed:[..]",
304+
[..]thread 'test_hello' panicked at 'assertion failed:[..]",
305305
)
306306
.with_stdout_contains("[..]`(left == right)`[..]")
307307
.with_stdout_contains("[..]left: `\"hello\"`,[..]")
@@ -367,7 +367,7 @@ test test_hello ... FAILED
367367
failures:
368368
369369
---- test_hello stdout ----
370-
<tab>thread 'test_hello' panicked at 'assertion failed: false', \
370+
[..]thread 'test_hello' panicked at 'assertion failed: false', \
371371
tests[/]footest.rs:4[..]
372372
",
373373
)
@@ -413,7 +413,7 @@ test test_hello ... FAILED
413413
failures:
414414
415415
---- test_hello stdout ----
416-
<tab>thread 'test_hello' panicked at 'assertion failed: false', \
416+
[..]thread 'test_hello' panicked at 'assertion failed: false', \
417417
src[/]lib.rs:4[..]
418418
",
419419
)

0 commit comments

Comments
 (0)