Skip to content

Commit cde8f6f

Browse files
authored
Merge branch 'master' into stabilize-crate-type
2 parents 3dfbecd + 8ba2cb6 commit cde8f6f

Some content is hidden

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

58 files changed

+163
-168
lines changed

src/cargo/core/compiler/compile_kind.rs

+1-4
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

+3-1
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/ops/vendor.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ struct VendorConfig {
6060
#[serde(rename_all = "lowercase", untagged)]
6161
enum VendorSource {
6262
Directory {
63-
directory: PathBuf,
63+
directory: String,
6464
},
6565
Registry {
6666
registry: Option<String>,
@@ -298,7 +298,10 @@ fn sync(
298298
config.insert(
299299
merged_source_name.to_string(),
300300
VendorSource::Directory {
301-
directory: opts.destination.to_path_buf(),
301+
// Windows-flavour paths are valid here on Windows but Unix.
302+
// This backslash normalization is for making output paths more
303+
// cross-platform compatible.
304+
directory: opts.destination.to_string_lossy().replace("\\", "/"),
302305
},
303306
);
304307
} else if !dest_dir_already_exists {

src/cargo/util/config/mod.rs

+1-7
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

+1
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

+1
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

+1
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

+1
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

+1
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

+1
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

+1
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

src/doc/man/cargo-package.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# cargo-package(1)
22
{{*set actionverb="Package"}}
33
{{*set noall=true}}
4+
{{*set multitarget=true}}
45

56
## NAME
67

src/doc/man/cargo-publish.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# cargo-publish(1)
22
{{*set actionverb="Publish"}}
3+
{{*set multitarget=true}}
34

45
## NAME
56

src/doc/man/cargo-rustc.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# cargo-rustc(1)
22
{{*set actionverb="Build"}}
3+
{{*set multitarget=true}}
34

45
## NAME
56

src/doc/man/cargo-rustdoc.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# cargo-rustdoc(1)
22
{{*set actionverb="Document"}}
3+
{{*set multitarget=true}}
34

45
## NAME
56

src/doc/man/cargo-test.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# cargo-test(1)
22
{{*set actionverb="Test"}}
33
{{*set nouns="tests"}}
4+
{{*set multitarget=true}}
45

56
## NAME
67

src/doc/man/generated_txt/cargo-bench.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@ OPTIONS
208208
Benchmark for the given architecture. The default is the host
209209
architecture. The general format of the triple is
210210
<arch><sub>-<vendor>-<sys>-<abi>. Run rustc --print target-list for
211-
a list of supported targets.
211+
a list of supported targets. This flag may be specified multiple
212+
times.
212213

213214
This may also be specified with the build.target config value
214215
<https://doc.rust-lang.org/cargo/reference/config.html>.

src/doc/man/generated_txt/cargo-build.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ OPTIONS
140140
Build for the given architecture. The default is the host
141141
architecture. The general format of the triple is
142142
<arch><sub>-<vendor>-<sys>-<abi>. Run rustc --print target-list for
143-
a list of supported targets.
143+
a list of supported targets. This flag may be specified multiple
144+
times.
144145

145146
This may also be specified with the build.target config value
146147
<https://doc.rust-lang.org/cargo/reference/config.html>.

src/doc/man/generated_txt/cargo-check.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ OPTIONS
137137
Check for the given architecture. The default is the host
138138
architecture. The general format of the triple is
139139
<arch><sub>-<vendor>-<sys>-<abi>. Run rustc --print target-list for
140-
a list of supported targets.
140+
a list of supported targets. This flag may be specified multiple
141+
times.
141142

142143
This may also be specified with the build.target config value
143144
<https://doc.rust-lang.org/cargo/reference/config.html>.

src/doc/man/generated_txt/cargo-clean.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ OPTIONS
4343
Clean for the given architecture. The default is the host
4444
architecture. The general format of the triple is
4545
<arch><sub>-<vendor>-<sys>-<abi>. Run rustc --print target-list for
46-
a list of supported targets.
46+
a list of supported targets. This flag may be specified multiple
47+
times.
4748

4849
This may also be specified with the build.target config value
4950
<https://doc.rust-lang.org/cargo/reference/config.html>.

src/doc/man/generated_txt/cargo-doc.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ OPTIONS
115115
Document for the given architecture. The default is the host
116116
architecture. The general format of the triple is
117117
<arch><sub>-<vendor>-<sys>-<abi>. Run rustc --print target-list for
118-
a list of supported targets.
118+
a list of supported targets. This flag may be specified multiple
119+
times.
119120

120121
This may also be specified with the build.target config value
121122
<https://doc.rust-lang.org/cargo/reference/config.html>.

src/doc/man/generated_txt/cargo-fetch.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ OPTIONS
2828
Fetch for the given architecture. The default is all architectures.
2929
The general format of the triple is
3030
<arch><sub>-<vendor>-<sys>-<abi>. Run rustc --print target-list for
31-
a list of supported targets.
31+
a list of supported targets. This flag may be specified multiple
32+
times.
3233

3334
This may also be specified with the build.target config value
3435
<https://doc.rust-lang.org/cargo/reference/config.html>.

src/doc/man/generated_txt/cargo-fix.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ OPTIONS
210210
Fix for the given architecture. The default is the host
211211
architecture. The general format of the triple is
212212
<arch><sub>-<vendor>-<sys>-<abi>. Run rustc --print target-list for
213-
a list of supported targets.
213+
a list of supported targets. This flag may be specified multiple
214+
times.
214215

215216
This may also be specified with the build.target config value
216217
<https://doc.rust-lang.org/cargo/reference/config.html>.

src/doc/man/generated_txt/cargo-package.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ OPTIONS
112112
Package for the given architecture. The default is the host
113113
architecture. The general format of the triple is
114114
<arch><sub>-<vendor>-<sys>-<abi>. Run rustc --print target-list for
115-
a list of supported targets.
115+
a list of supported targets. This flag may be specified multiple
116+
times.
116117

117118
This may also be specified with the build.target config value
118119
<https://doc.rust-lang.org/cargo/reference/config.html>.

src/doc/man/generated_txt/cargo-publish.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ OPTIONS
7979
Publish for the given architecture. The default is the host
8080
architecture. The general format of the triple is
8181
<arch><sub>-<vendor>-<sys>-<abi>. Run rustc --print target-list for
82-
a list of supported targets.
82+
a list of supported targets. This flag may be specified multiple
83+
times.
8384

8485
This may also be specified with the build.target config value
8586
<https://doc.rust-lang.org/cargo/reference/config.html>.

src/doc/man/generated_txt/cargo-rustc.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ OPTIONS
131131
Build for the given architecture. The default is the host
132132
architecture. The general format of the triple is
133133
<arch><sub>-<vendor>-<sys>-<abi>. Run rustc --print target-list for
134-
a list of supported targets.
134+
a list of supported targets. This flag may be specified multiple
135+
times.
135136

136137
This may also be specified with the build.target config value
137138
<https://doc.rust-lang.org/cargo/reference/config.html>.

src/doc/man/generated_txt/cargo-rustdoc.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ OPTIONS
131131
Document for the given architecture. The default is the host
132132
architecture. The general format of the triple is
133133
<arch><sub>-<vendor>-<sys>-<abi>. Run rustc --print target-list for
134-
a list of supported targets.
134+
a list of supported targets. This flag may be specified multiple
135+
times.
135136

136137
This may also be specified with the build.target config value
137138
<https://doc.rust-lang.org/cargo/reference/config.html>.

src/doc/man/generated_txt/cargo-test.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ OPTIONS
222222
Test for the given architecture. The default is the host
223223
architecture. The general format of the triple is
224224
<arch><sub>-<vendor>-<sys>-<abi>. Run rustc --print target-list for
225-
a list of supported targets.
225+
a list of supported targets. This flag may be specified multiple
226+
times.
226227

227228
This may also be specified with the build.target config value
228229
<https://doc.rust-lang.org/cargo/reference/config.html>.

src/doc/man/includes/options-target-triple.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
{{~/if}} The general format of the triple is
66
`<arch><sub>-<vendor>-<sys>-<abi>`. Run `rustc --print target-list` for a
77
list of supported targets.
8+
{{~#if multitarget }} This flag may be specified multiple times. {{~/if}}
89

910
This may also be specified with the `build.target`
1011
[config value](../reference/config.html).

src/doc/src/commands/cargo-bench.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33

44

5+
56
## NAME
67

78
cargo-bench - Execute benchmarks of a package
@@ -255,7 +256,7 @@ be specified multiple times, which enables all specified features.</dd>
255256
<dt class="option-term" id="option-cargo-bench---target"><a class="option-anchor" href="#option-cargo-bench---target"></a><code>--target</code> <em>triple</em></dt>
256257
<dd class="option-desc">Benchmark for the given architecture. The default is the host architecture. The general format of the triple is
257258
<code>&lt;arch&gt;&lt;sub&gt;-&lt;vendor&gt;-&lt;sys&gt;-&lt;abi&gt;</code>. Run <code>rustc --print target-list</code> for a
258-
list of supported targets.</p>
259+
list of supported targets. This flag may be specified multiple times.</p>
259260
<p>This may also be specified with the <code>build.target</code>
260261
<a href="../reference/config.html">config value</a>.</p>
261262
<p>Note that specifying this flag makes Cargo run in a different mode where the

src/doc/src/commands/cargo-build.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# cargo-build(1)
22

33

4+
45
## NAME
56

67
cargo-build - Compile the current package
@@ -182,7 +183,7 @@ be specified multiple times, which enables all specified features.</dd>
182183
<dt class="option-term" id="option-cargo-build---target"><a class="option-anchor" href="#option-cargo-build---target"></a><code>--target</code> <em>triple</em></dt>
183184
<dd class="option-desc">Build for the given architecture. The default is the host architecture. The general format of the triple is
184185
<code>&lt;arch&gt;&lt;sub&gt;-&lt;vendor&gt;-&lt;sys&gt;-&lt;abi&gt;</code>. Run <code>rustc --print target-list</code> for a
185-
list of supported targets.</p>
186+
list of supported targets. This flag may be specified multiple times.</p>
186187
<p>This may also be specified with the <code>build.target</code>
187188
<a href="../reference/config.html">config value</a>.</p>
188189
<p>Note that specifying this flag makes Cargo run in a different mode where the

src/doc/src/commands/cargo-check.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# cargo-check(1)
22

33

4+
45
## NAME
56

67
cargo-check - Check the current package
@@ -177,7 +178,7 @@ be specified multiple times, which enables all specified features.</dd>
177178
<dt class="option-term" id="option-cargo-check---target"><a class="option-anchor" href="#option-cargo-check---target"></a><code>--target</code> <em>triple</em></dt>
178179
<dd class="option-desc">Check for the given architecture. The default is the host architecture. The general format of the triple is
179180
<code>&lt;arch&gt;&lt;sub&gt;-&lt;vendor&gt;-&lt;sys&gt;-&lt;abi&gt;</code>. Run <code>rustc --print target-list</code> for a
180-
list of supported targets.</p>
181+
list of supported targets. This flag may be specified multiple times.</p>
181182
<p>This may also be specified with the <code>build.target</code>
182183
<a href="../reference/config.html">config value</a>.</p>
183184
<p>Note that specifying this flag makes Cargo run in a different mode where the

src/doc/src/commands/cargo-clean.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# cargo-clean(1)
22

33

4+
45
## NAME
56

67
cargo-clean - Remove generated artifacts
@@ -59,7 +60,7 @@ Defaults to <code>target</code> in the root of the workspace.</dd>
5960
<dt class="option-term" id="option-cargo-clean---target"><a class="option-anchor" href="#option-cargo-clean---target"></a><code>--target</code> <em>triple</em></dt>
6061
<dd class="option-desc">Clean for the given architecture. The default is the host architecture. The general format of the triple is
6162
<code>&lt;arch&gt;&lt;sub&gt;-&lt;vendor&gt;-&lt;sys&gt;-&lt;abi&gt;</code>. Run <code>rustc --print target-list</code> for a
62-
list of supported targets.</p>
63+
list of supported targets. This flag may be specified multiple times.</p>
6364
<p>This may also be specified with the <code>build.target</code>
6465
<a href="../reference/config.html">config value</a>.</p>
6566
<p>Note that specifying this flag makes Cargo run in a different mode where the

src/doc/src/commands/cargo-doc.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# cargo-doc(1)
22

33

4+
45
## NAME
56

67
cargo-doc - Build a package's documentation
@@ -155,7 +156,7 @@ be specified multiple times, which enables all specified features.</dd>
155156
<dt class="option-term" id="option-cargo-doc---target"><a class="option-anchor" href="#option-cargo-doc---target"></a><code>--target</code> <em>triple</em></dt>
156157
<dd class="option-desc">Document for the given architecture. The default is the host architecture. The general format of the triple is
157158
<code>&lt;arch&gt;&lt;sub&gt;-&lt;vendor&gt;-&lt;sys&gt;-&lt;abi&gt;</code>. Run <code>rustc --print target-list</code> for a
158-
list of supported targets.</p>
159+
list of supported targets. This flag may be specified multiple times.</p>
159160
<p>This may also be specified with the <code>build.target</code>
160161
<a href="../reference/config.html">config value</a>.</p>
161162
<p>Note that specifying this flag makes Cargo run in a different mode where the

src/doc/src/commands/cargo-fetch.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33

44

5+
56
## NAME
67

78
cargo-fetch - Fetch dependencies of a package from the network
@@ -34,7 +35,7 @@ you plan to use Cargo without a network with the `--offline` flag.
3435
<dt class="option-term" id="option-cargo-fetch---target"><a class="option-anchor" href="#option-cargo-fetch---target"></a><code>--target</code> <em>triple</em></dt>
3536
<dd class="option-desc">Fetch for the given architecture. The default is all architectures. The general format of the triple is
3637
<code>&lt;arch&gt;&lt;sub&gt;-&lt;vendor&gt;-&lt;sys&gt;-&lt;abi&gt;</code>. Run <code>rustc --print target-list</code> for a
37-
list of supported targets.</p>
38+
list of supported targets. This flag may be specified multiple times.</p>
3839
<p>This may also be specified with the <code>build.target</code>
3940
<a href="../reference/config.html">config value</a>.</p>
4041
<p>Note that specifying this flag makes Cargo run in a different mode where the

0 commit comments

Comments
 (0)