diff --git a/src/bin/cargo/commands/rustc.rs b/src/bin/cargo/commands/rustc.rs
index 84970185e5c..098fe6b1cee 100644
--- a/src/bin/cargo/commands/rustc.rs
+++ b/src/bin/cargo/commands/rustc.rs
@@ -39,7 +39,7 @@ pub fn cli() -> App {
.arg(multi_opt(
CRATE_TYPE_ARG_NAME,
"CRATE-TYPE",
- "Comma separated list of types of crates for the compiler to emit (unstable)",
+ "Comma separated list of types of crates for the compiler to emit",
))
.arg_target_dir()
.arg_manifest_path()
@@ -88,9 +88,6 @@ pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {
compile_opts.target_rustc_crate_types = if crate_types.is_empty() {
None
} else {
- config
- .cli_unstable()
- .fail_if_stable_opt(CRATE_TYPE_ARG_NAME, 10083)?;
Some(crate_types)
};
ops::compile(&ws, &compile_opts)?;
diff --git a/src/doc/man/cargo-rustc.md b/src/doc/man/cargo-rustc.md
index 588c080a9e0..3ce5c193ab0 100644
--- a/src/doc/man/cargo-rustc.md
+++ b/src/doc/man/cargo-rustc.md
@@ -71,6 +71,19 @@ See the [the reference](../reference/profiles.html) for more details on profiles
{{> options-timings }}
+{{#option "`--crate-type` _crate-type_"}}
+Build for the given crate type. This flag accepts a comma-separated list of
+1 or more crate types, of which the allowed values are the same as `crate-type`
+field in the manifest for configurating a Cargo target. See
+[`crate-type` field](../reference/cargo-targets.html#the-crate-type-field)
+for possible values.
+
+If the manifest contains a list, and `--crate-type` is provided,
+the command-line argument value will override what is in the manifest.
+
+This flag only works when building a `lib` or `example` library target.
+{{/option}}
+
{{/options}}
### Output Options
@@ -124,5 +137,9 @@ See the [the reference](../reference/profiles.html) for more details on profiles
cargo rustc --lib -- -Z print-type-sizes
+3. Override `crate-type` field in Cargo.toml with command-line option:
+
+ cargo rustc --lib --crate-type lib,cdylib
+
## SEE ALSO
{{man "cargo" 1}}, {{man "cargo-build" 1}}, {{man "rustc" 1}}
diff --git a/src/doc/man/generated_txt/cargo-rustc.txt b/src/doc/man/generated_txt/cargo-rustc.txt
index e971052d14c..fcf01549a4e 100644
--- a/src/doc/man/generated_txt/cargo-rustc.txt
+++ b/src/doc/man/generated_txt/cargo-rustc.txt
@@ -192,6 +192,19 @@ OPTIONS
o json (unstable, requires -Zunstable-options): Emit
machine-readable JSON information about timing information.
+ --crate-type crate-type
+ Build for the given crate type. This flag accepts a comma-separated
+ list of 1 or more crate types, of which the allowed values are the
+ same as crate-type field in the manifest for configurating a Cargo
+ target. See crate-type field
+ --crate-type
crate-typecrate-type
+field in the manifest for configurating a Cargo target. See
+crate-type
field
+for possible values.
If the manifest contains a list, and --crate-type
is provided,
+the command-line argument value will override what is in the manifest.
This flag only works when building a lib
or example
library target.
+
+
### Output Options
@@ -411,5 +422,9 @@ details on environment variables that Cargo reads.
cargo rustc --lib -- -Z print-type-sizes
+3. Override `crate-type` field in Cargo.toml with command-line option:
+
+ cargo rustc --lib --crate-type lib,cdylib
+
## SEE ALSO
[cargo(1)](cargo.html), [cargo-build(1)](cargo-build.html), [rustc(1)](https://doc.rust-lang.org/rustc/index.html)
diff --git a/src/doc/src/reference/unstable.md b/src/doc/src/reference/unstable.md
index 446b5190d90..6c83cf79d80 100644
--- a/src/doc/src/reference/unstable.md
+++ b/src/doc/src/reference/unstable.md
@@ -409,23 +409,6 @@ like to stabilize it somehow!
[rust-lang/rust#64158]: https://github.com/rust-lang/rust/pull/64158
-### crate-type
-* Tracking Issue: [#10083](https://github.com/rust-lang/cargo/issues/10083)
-* RFC: [#3180](https://github.com/rust-lang/rfcs/pull/3180)
-* Original Pull Request: [#10093](https://github.com/rust-lang/cargo/pull/10093)
-
-`cargo rustc --crate-type=lib,cdylib` forwards the `--crate-type` flag to `rustc`.
-This runs `rustc` with the corresponding
-[`--crate-type`](https://doc.rust-lang.org/rustc/command-line-arguments.html#--crate-type-a-list-of-types-of-crates-for-the-compiler-to-emit)
-flag, and compiling.
-
-When using it, it requires the `-Z unstable-options`
-command-line option:
-
-```console
-cargo rustc --crate-type lib,cdylib -Z unstable-options
-```
-
### keep-going
* Tracking Issue: [#10496](https://github.com/rust-lang/cargo/issues/10496)
@@ -1547,3 +1530,9 @@ information.
The `-Z multitarget` option has been stabilized in the 1.64 release.
See [`build.target`](config.md#buildtarget) for more information about
setting the default target platform triples.
+
+### crate-type
+
+The `--crate-type` flag for `cargo rustc` has been stabilized in the 1.64
+release. See the [`cargo rustc` documentation](../commands/cargo-rustc.md)
+for more information.
diff --git a/src/etc/man/cargo-rustc.1 b/src/etc/man/cargo-rustc.1
index e1571c41b85..02dba7b26ec 100644
--- a/src/etc/man/cargo-rustc.1
+++ b/src/etc/man/cargo-rustc.1
@@ -224,6 +224,20 @@ and does not provide machine\-readable timing data.
information about timing information.
.RE
.RE
+.sp
+\fB\-\-crate\-type\fR \fIcrate\-type\fR
+.RS 4
+Build for the given crate type. This flag accepts a comma\-separated list of
+1 or more crate types, of which the allowed values are the same as \fBcrate\-type\fR
+field in the manifest for configurating a Cargo target. See
+\fI\f(BIcrate\-type\fI field\fR