Skip to content

Commit 7d1d5fd

Browse files
committed
Auto merge of #7424 - alexcrichton:beta-next, r=ehuss
[beta] Backport two changes to 1.39.0 This is a backport of: * #7394 * #7419
2 parents b6c6f68 + f393130 commit 7d1d5fd

File tree

3 files changed

+35
-6
lines changed

3 files changed

+35
-6
lines changed

Diff for: src/cargo/core/compiler/job_queue.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ impl<'a, 'cfg> JobQueue<'a, 'cfg> {
164164
.filter(|unit| {
165165
// Binaries aren't actually needed to *compile* tests, just to run
166166
// them, so we don't include this dependency edge in the job graph.
167-
!unit.target.is_test() || !unit.target.is_bin()
167+
!unit.target.is_test() && !unit.target.is_bin()
168168
})
169169
.map(|dep| {
170170
// Handle the case here where our `unit -> dep` dependency may

Diff for: src/cargo/util/command_prelude.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@ pub trait AppExt: Sized {
100100
}
101101

102102
fn arg_features(self) -> Self {
103-
self._arg(
104-
opt("features", "Space-separated list of features to activate")
105-
.multiple(true)
106-
.value_name("FEATURES"),
107-
)
103+
self._arg(multi_opt(
104+
"features",
105+
"FEATURES",
106+
"Space-separated list of features to activate",
107+
))
108108
._arg(opt("all-features", "Activate all available features"))
109109
._arg(opt(
110110
"no-default-features",

Diff for: tests/testsuite/features.rs

+29
Original file line numberDiff line numberDiff line change
@@ -1959,3 +1959,32 @@ fn multi_multi_features() {
19591959

19601960
p.cargo("build --features a --features").arg("b c").run();
19611961
}
1962+
1963+
#[cargo_test]
1964+
fn cli_parse_ok() {
1965+
let p = project()
1966+
.file(
1967+
"Cargo.toml",
1968+
r#"
1969+
[project]
1970+
name = "foo"
1971+
version = "0.0.1"
1972+
authors = []
1973+
1974+
[features]
1975+
a = []
1976+
"#,
1977+
)
1978+
.file(
1979+
"src/main.rs",
1980+
r#"
1981+
#[cfg(feature = "a")]
1982+
fn main() {
1983+
assert_eq!(std::env::args().nth(1).unwrap(), "b");
1984+
}
1985+
"#,
1986+
)
1987+
.build();
1988+
1989+
p.cargo("run --features a b").run();
1990+
}

0 commit comments

Comments
 (0)