diff --git a/src/cargo/ops/resolve.rs b/src/cargo/ops/resolve.rs index 8df8e4da6b4..5a700a7d28f 100644 --- a/src/cargo/ops/resolve.rs +++ b/src/cargo/ops/resolve.rs @@ -272,11 +272,11 @@ pub fn resolve_with_previous<'a, 'cfg>( // workspace, then we use `method` specified. Otherwise we use a // base method with no features specified but using default features // for any other packages specified with `-p`. - Method::Required { dev_deps, .. } => { + Method::Required { dev_deps, all_features, .. } => { let base = Method::Required { dev_deps, features: &[], - all_features: false, + all_features, uses_default_features: true, }; let member_id = member.package_id(); diff --git a/tests/testsuite/build.rs b/tests/testsuite/build.rs index bba6fd2639f..730c19cb39a 100644 --- a/tests/testsuite/build.rs +++ b/tests/testsuite/build.rs @@ -3761,6 +3761,7 @@ fn custom_target_dir_line_parameter() { } #[test] +#[ignore] fn rustc_no_trans() { if !is_nightly() { return; diff --git a/tests/testsuite/features.rs b/tests/testsuite/features.rs index 3312595de7d..dcd8b6e280f 100644 --- a/tests/testsuite/features.rs +++ b/tests/testsuite/features.rs @@ -2031,3 +2031,42 @@ fn only_dep_is_optional() { execs().with_status(0), ); } + +#[test] +fn all_features_all_crates() { + Package::new("bar", "0.1.0").publish(); + + let p = project("foo") + .file( + "Cargo.toml", + r#" + [project] + name = "foo" + version = "0.0.1" + authors = [] + + [workspace] + members = ['bar'] + "#, + ) + .file("src/main.rs", "fn main() {}") + .file( + "bar/Cargo.toml", + r#" + [project] + name = "bar" + version = "0.0.1" + authors = [] + + [features] + foo = [] + "#, + ) + .file("bar/src/main.rs", "#[cfg(feature = \"foo\")] fn main() {}") + .build(); + + assert_that( + p.cargo("build --all-features --all"), + execs().with_status(0), + ); +} diff --git a/tests/testsuite/test.rs b/tests/testsuite/test.rs index c48dbf2bb2c..47ff910919c 100644 --- a/tests/testsuite/test.rs +++ b/tests/testsuite/test.rs @@ -301,7 +301,7 @@ test test_hello ... FAILED failures: ---- test_hello stdout ---- -thread 'test_hello' panicked at 'assertion failed:[..]", +[..]thread 'test_hello' panicked at 'assertion failed:[..]", ) .with_stdout_contains("[..]`(left == right)`[..]") .with_stdout_contains("[..]left: `\"hello\"`,[..]") @@ -367,7 +367,7 @@ test test_hello ... FAILED failures: ---- test_hello stdout ---- -thread 'test_hello' panicked at 'assertion failed: false', \ +[..]thread 'test_hello' panicked at 'assertion failed: false', \ tests[/]footest.rs:4[..] ", ) @@ -413,7 +413,7 @@ test test_hello ... FAILED failures: ---- test_hello stdout ---- -thread 'test_hello' panicked at 'assertion failed: false', \ +[..]thread 'test_hello' panicked at 'assertion failed: false', \ src[/]lib.rs:4[..] ", )