Skip to content

Commit 8ba2cb6

Browse files
committed
Auto merge of #10766 - weihanglo:stabilize-multitarget, r=ehuss
Stabilize `-Zmultitarget`
2 parents 3e1016f + 3e177e0 commit 8ba2cb6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+109
-163
lines changed

src/cargo/core/compiler/compile_kind.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::core::Target;
22
use crate::util::errors::CargoResult;
33
use crate::util::interning::InternedString;
44
use crate::util::{Config, StableHasher};
5-
use anyhow::{bail, Context as _};
5+
use anyhow::Context as _;
66
use serde::Serialize;
77
use std::collections::BTreeSet;
88
use std::fs;
@@ -65,9 +65,6 @@ impl CompileKind {
6565
};
6666

6767
if !targets.is_empty() {
68-
if targets.len() > 1 && !config.cli_unstable().multitarget {
69-
bail!("specifying multiple `--target` flags requires `-Zmultitarget`")
70-
}
7168
return dedup(targets);
7269
}
7370

src/cargo/core/features.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,8 @@ const STABILISED_NAMESPACED_FEATURES: &str = "Namespaced features are now always
722722

723723
const STABILIZED_TIMINGS: &str = "The -Ztimings option has been stabilized as --timings.";
724724

725+
const STABILISED_MULTITARGET: &str = "Multiple `--target` options are now always available.";
726+
725727
fn deserialize_build_std<'de, D>(deserializer: D) -> Result<Option<Vec<String>>, D::Error>
726728
where
727729
D: serde::Deserializer<'de>,
@@ -922,7 +924,7 @@ impl CliUnstable {
922924
self.features = Some(feats);
923925
}
924926
"separate-nightlies" => self.separate_nightlies = parse_empty(k, v)?,
925-
"multitarget" => self.multitarget = parse_empty(k, v)?,
927+
"multitarget" => stabilized_warn(k, "1.64", STABILISED_MULTITARGET),
926928
"rustdoc-map" => self.rustdoc_map = parse_empty(k, v)?,
927929
"terminal-width" => self.terminal_width = Some(parse_usize_opt(v)?),
928930
"sparse-registry" => self.sparse_registry = parse_empty(k, v)?,

src/cargo/util/config/mod.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2248,13 +2248,7 @@ impl BuildTargetConfig {
22482248
};
22492249
let values = match &self.inner.val {
22502250
BuildTargetConfigInner::One(s) => vec![map(s)],
2251-
BuildTargetConfigInner::Many(v) => {
2252-
if !config.cli_unstable().multitarget {
2253-
bail!("specifying an array in `build.target` config value requires `-Zmultitarget`")
2254-
} else {
2255-
v.iter().map(map).collect()
2256-
}
2257-
}
2251+
BuildTargetConfigInner::Many(v) => v.iter().map(map).collect(),
22582252
};
22592253
Ok(values)
22602254
}

src/doc/man/cargo-bench.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# cargo-bench(1)
22
{{*set actionverb="Benchmark"}}
33
{{*set nouns="benchmarks"}}
4+
{{*set multitarget=true}}
45

56
## NAME
67

src/doc/man/cargo-build.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# cargo-build(1)
22
{{*set actionverb="Build"}}
3+
{{*set multitarget=true}}
34

45
## NAME
56

src/doc/man/cargo-check.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# cargo-check(1)
22
{{*set actionverb="Check"}}
3+
{{*set multitarget=true}}
34

45
## NAME
56

src/doc/man/cargo-clean.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# cargo-clean(1)
22
{{*set actionverb="Clean"}}
3+
{{*set multitarget=true}}
34

45
## NAME
56

src/doc/man/cargo-doc.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# cargo-doc(1)
22
{{*set actionverb="Document"}}
3+
{{*set multitarget=true}}
34

45
## NAME
56

src/doc/man/cargo-fetch.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# cargo-fetch(1)
22
{{*set actionverb="Fetch"}}
33
{{*set target-default-to-all-arch=true}}
4+
{{*set multitarget=true}}
45

56
## NAME
67

src/doc/man/cargo-fix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# cargo-fix(1)
22
{{*set actionverb="Fix"}}
3+
{{*set multitarget=true}}
34

45
## NAME
56

0 commit comments

Comments
 (0)